Skip to content

Commit

Permalink
Merge branch 'master' into e2e-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ddjnw1yu committed Nov 16, 2023
2 parents ca0d0c1 + 8d91a61 commit f502883
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 9 deletions.
1 change: 1 addition & 0 deletions components/ContactUsForms/BugForm/BugForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ export default {
const fileName = propOr('', 'name', this.file)
const description = `
<b>Problematic page URL:</b><br>${this.form.pageUrl ? this.form.pageUrl : 'N/A'}<br><br>
<b>Short description:</b><br>${this.form.shortDescription}<br><br>
<b>Detailed Description</b><br>${this.form.detailedDescription}<br><br>
${fileName != '' ? `<b>File Attachment:</b><br>${fileName}<br><br>` : ''}
<b>What type of user are you?</b><br>${this.form.user.typeOfUser}<br><br>
Expand Down
1 change: 1 addition & 0 deletions components/ContactUsForms/FeedbackForm/FeedbackForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export default {
this.isSubmitting = true
const description = `
<b>What area of the SPARC Portal is this related to?</b><br>${this.form.pageOrResource}<br><br>
<b>Short description:</b><br>${this.form.shortDescription}<br><br>
<b>Detailed description:</b><br>${this.form.detailedDescription}<br><br>
<b>What type of user are you?</b><br>${this.form.user.typeOfUser}<br><br>
<b>Name:</b><br>${this.form.user.firstName} ${this.form.user.lastName}<br><br>
Expand Down
33 changes: 31 additions & 2 deletions components/ContactUsForms/ResearchForm/ResearchForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@
</client-only>
</el-form-item>

<el-form-item
class="mt-32 vertical-content"
prop="manuscriptDoi"
:disabled="form.publishedManuscript !== 'Yes'"
>
<url-input :disabled="form.publishedManuscript !== 'Yes'" v-model="form.manuscriptDoi" placeholder="Enter DOI URL">
<template slot="prepend">Http://</template>
</url-input>
</el-form-item>

<hr/>

<user-contact-form-item v-model="form.user"/>
Expand Down Expand Up @@ -79,22 +89,33 @@ 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',
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,
Expand Down Expand Up @@ -162,6 +183,13 @@ export default {
trigger: 'change'
}
],
manuscriptDoi: [
{
trigger: 'change',
validator: validateDoi
}
],
}
}
},
Expand Down Expand Up @@ -191,8 +219,9 @@ export default {
async sendForm() {
this.isSubmitting = true
const description = `
<b>Short description:</b><br>${this.form.shortDescription}<br><br>
<b>Detailed description:</b><br>${this.form.detailedDescription}<br><br>
<b>Has a published manuscript:</b><br>${this.form.publishedManuscript}<br><br>
<b>Has a published manuscript:</b><br>${this.form.publishedManuscript === 'Yes' ? this.form.manuscriptDoi : this.form.publishedManuscript}<br><br>
<b>What type of user are you?</b><br>${this.form.user.typeOfUser}<br><br>
<b>Name:</b><br>${this.form.user.firstName} ${this.form.user.lastName}<br><br>
<b>Email:</b><br>${this.form.user.email}
Expand Down
6 changes: 3 additions & 3 deletions components/Url/UrlInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<div>
<div class="url-input mr-16">
<el-input :disabled="disabled" :placeholder="placeholder" v-model="value">
<template slot="prepend">
<slot name="prepend" />
</template>
<template slot="prepend">
<slot name="prepend" />
</template>
</el-input>
</div>
<span v-on:click="addLinkClicked" class="add-link-button link1" v-if="showAddLink && !disabled">
Expand Down
11 changes: 7 additions & 4 deletions pages/contact-us/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<nuxt-link
class="tabs__button"
@click.native="resetForms"
:class="{ active: type.type === $route.query.type || (type.subtypes != undefined && type.subtypes.includes($route.query.type)) || ($route.query.type === undefined && type.type === 'feedback') }"
:class="{ active: type.type === $route.query.type || (type.subtypes != undefined && type.subtypes.includes($route.query.type)) || ($route.query.type === undefined && type.type === 'research') }"
:to="{
name: 'contact-us',
query: {
Expand Down Expand Up @@ -215,10 +215,13 @@ export default {
},
isFeedbackForm() {
const feedbackFormType = this.formTypes.find(formType => formType.type === 'feedback')
return this.$route.query.type === undefined || this.$route.query.type === 'feedback' || this.formType === feedbackFormType.type || feedbackFormType.subtypes.includes(this.formType)
return this.$route.query.type === 'feedback' || this.formType === feedbackFormType.type || feedbackFormType.subtypes.includes(this.formType)
},
formComponent: function() {
return defaultTo('', formComponents[this.$route.query.type])
if (this.$route.query.type === 'feedback') {
return ''
}
return defaultTo(ResearchForm, formComponents[this.$route.query.type])
},
formTypeObject() {
if (this.formType == undefined)
Expand Down Expand Up @@ -257,7 +260,7 @@ export default {
*/
$route: {
handler(to) {
this.formType = to.query.type === 'feedback' ? undefined : to.query.type
this.formType = to.query.type === 'research' ? undefined : to.query.type
},
immediate: true
},
Expand Down
1 change: 1 addition & 0 deletions pages/datasets/_datasetId.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit f502883

Please sign in to comment.