From 8a3e50da8839f27ffb8f62c143edac30c90a665c Mon Sep 17 00:00:00 2001 From: Ignacio Pascual <4764217+ignapas@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:07:43 +0100 Subject: [PATCH 1/5] made submit data/models the default form --- pages/contact-us/index.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pages/contact-us/index.vue b/pages/contact-us/index.vue index 63248daf..af2a862e 100644 --- a/pages/contact-us/index.vue +++ b/pages/contact-us/index.vue @@ -11,7 +11,7 @@ + + + + +
@@ -79,6 +89,7 @@ import NewsletterMixin from '../NewsletterMixin' import RecaptchaMixin from '@/mixins/recaptcha/index' import UserContactFormItem from '../UserContactFormItem.vue' import { saveForm, loadForm, populateFormWithUserData } from '~/pages/data/utils' +import UrlInput from '@/components/Url/UrlInput.vue' export default { name: 'FeedbackForm', @@ -86,15 +97,25 @@ export default { mixins: [NewsletterMixin, RecaptchaMixin], components: { - UserContactFormItem + UserContactFormItem, + UrlInput }, data() { + const validateDoi = (rule, value, callback) => { + const form = this.$refs.submitForm + const publishedManuscriptField = form.fields.find(field => field.prop === 'publishedManuscript') + if (publishedManuscriptField && publishedManuscriptField.fieldValue === 'Yes' && value === '') { + callback(new Error('Please enter a DOI URL')) + } + callback() + } return { form: { detailedDescription: '', shortDescription: '', publishedManuscript: '', + manuscriptDoi: '', user: { typeOfUser: '', firstName: this.firstName, @@ -162,6 +183,13 @@ export default { trigger: 'change' } ], + + manuscriptDoi: [ + { + trigger: 'change', + validator: validateDoi + } + ], } } }, @@ -192,7 +220,7 @@ export default { this.isSubmitting = true const description = ` Detailed description:
${this.form.detailedDescription}

- Has a published manuscript:
${this.form.publishedManuscript}

+ Has a published manuscript:
${this.form.publishedManuscript === 'Yes' ? this.form.manuscriptDoi : this.form.publishedManuscript}

What type of user are you?
${this.form.user.typeOfUser}

Name:
${this.form.user.firstName} ${this.form.user.lastName}

Email:
${this.form.user.email} From 1a6e0f894a34465604da445bc171bcbfa3cc5519 Mon Sep 17 00:00:00 2001 From: Ignacio Pascual <4764217+ignapas@users.noreply.github.com> Date: Wed, 8 Nov 2023 17:31:25 +0100 Subject: [PATCH 3/5] code fix --- components/Url/UrlInput.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/Url/UrlInput.vue b/components/Url/UrlInput.vue index 97fb24aa..3419e31a 100644 --- a/components/Url/UrlInput.vue +++ b/components/Url/UrlInput.vue @@ -2,9 +2,9 @@
- +
From 71b3a38463767b533933a1a991f39e7d61617672 Mon Sep 17 00:00:00 2001 From: Ignacio Pascual <4764217+ignapas@users.noreply.github.com> Date: Wed, 8 Nov 2023 17:31:43 +0100 Subject: [PATCH 4/5] added short description to description fieild --- components/ContactUsForms/BugForm/BugForm.vue | 1 + components/ContactUsForms/FeedbackForm/FeedbackForm.vue | 1 + components/ContactUsForms/ResearchForm/ResearchForm.vue | 1 + 3 files changed, 3 insertions(+) diff --git a/components/ContactUsForms/BugForm/BugForm.vue b/components/ContactUsForms/BugForm/BugForm.vue index 71281ee9..01938966 100644 --- a/components/ContactUsForms/BugForm/BugForm.vue +++ b/components/ContactUsForms/BugForm/BugForm.vue @@ -200,6 +200,7 @@ export default { const fileName = propOr('', 'name', this.file) const description = ` Problematic page URL:
${this.form.pageUrl ? this.form.pageUrl : 'N/A'}

+ Short description:
${this.form.shortDescription}

Detailed Description
${this.form.detailedDescription}

${fileName != '' ? `File Attachment:
${fileName}

` : ''} What type of user are you?
${this.form.user.typeOfUser}

diff --git a/components/ContactUsForms/FeedbackForm/FeedbackForm.vue b/components/ContactUsForms/FeedbackForm/FeedbackForm.vue index fb2aa2bf..821cc681 100644 --- a/components/ContactUsForms/FeedbackForm/FeedbackForm.vue +++ b/components/ContactUsForms/FeedbackForm/FeedbackForm.vue @@ -179,6 +179,7 @@ export default { this.isSubmitting = true const description = ` What area of the SPARC Portal is this related to?
${this.form.pageOrResource}

+ Short description:
${this.form.shortDescription}

Detailed description:
${this.form.detailedDescription}

What type of user are you?
${this.form.user.typeOfUser}

Name:
${this.form.user.firstName} ${this.form.user.lastName}

diff --git a/components/ContactUsForms/ResearchForm/ResearchForm.vue b/components/ContactUsForms/ResearchForm/ResearchForm.vue index 96c568f9..c61514ac 100644 --- a/components/ContactUsForms/ResearchForm/ResearchForm.vue +++ b/components/ContactUsForms/ResearchForm/ResearchForm.vue @@ -219,6 +219,7 @@ export default { async sendForm() { this.isSubmitting = true const description = ` + Short description:
${this.form.shortDescription}

Detailed description:
${this.form.detailedDescription}

Has a published manuscript:
${this.form.publishedManuscript === 'Yes' ? this.form.manuscriptDoi : this.form.publishedManuscript}

What type of user are you?
${this.form.user.typeOfUser}

From 488f97d2f79b7b5a1989b42561f4482a816ccb9e Mon Sep 17 00:00:00 2001 From: Eric Gauzens Date: Fri, 10 Nov 2023 14:36:55 -0500 Subject: [PATCH 5/5] test resetting dataLayer --- pages/datasets/_datasetId.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/datasets/_datasetId.vue b/pages/datasets/_datasetId.vue index 8fa1983b..3818f9ca 100644 --- a/pages/datasets/_datasetId.vue +++ b/pages/datasets/_datasetId.vue @@ -375,6 +375,7 @@ export default { version_id: propOr('undefined', 'version', this.datasetInfo), doi: propOr('undefined', 'doi', this.datasetInfo) }) + window['google_tag_manager'][`${process.env.GOOGLE_TAG_MANAGER_ID}`].dataLayer.reset() }, computed: {