diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 0192e1f48..9c009ca53 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "theq", - "version": "2.1.4", + "version": "2.1.5", "hasInstallScript": true, "dependencies": { "@babel/polyfill": "^7.12.1", diff --git a/frontend/src/components/exams/add-exam-final-step.vue b/frontend/src/components/exams/add-exam-final-step.vue index d040203ab..417fc3d85 100644 --- a/frontend/src/components/exams/add-exam-final-step.vue +++ b/frontend/src/components/exams/add-exam-final-step.vue @@ -99,17 +99,11 @@ Received Date - + {{ formatDate(exam.exam_received_date) }} - - {{ - formatDate(exam.exam_received_date) - }} - Not Yet Received - diff --git a/frontend/src/components/exams/add-exam-form-components.ts b/frontend/src/components/exams/add-exam-form-components.ts index 6b7b93772..11ad7f9d3 100644 --- a/frontend/src/components/exams/add-exam-form-components.ts +++ b/frontend/src/components/exams/add-exam-form-components.ts @@ -357,7 +357,7 @@ export class DropdownQuestion extends Vue { template: ` - +
@@ -365,9 +365,9 @@ export class DropdownQuestion extends Vue { @input="preSetDate()" @change="unsetDate" autocomplete="off" - :options="['other', 'pesticide'].includes(modalSetup) ? otherOptions : options"/> + :options="options"/>
- + @@ -417,7 +417,7 @@ export class ExamReceivedQuestion extends Vue { } set showRadio (e) { - this.captureExamDetail({ key: 'exam_received_date', value: null }) + this.captureExamDetail({ key: 'exam_received_date', value: moment(new Date()).format() }) this.toggleIndividualCaptureTabRadio(e) } @@ -458,6 +458,13 @@ export class ExamReceivedQuestion extends Vue { } }) } + + mounted() { + // Check if the radio button is initially set to true + if (this.modalSetup === 'other' || this.modalSetup === 'pesticide') { + this.exam[this.q['exam_received_date']] = moment().format() + } + } } // InputQuestion @@ -1104,4 +1111,4 @@ export class TimeQuestion extends Vue { } }) } -} +} \ No newline at end of file diff --git a/frontend/src/components/exams/add-exam-form-controller.vue b/frontend/src/components/exams/add-exam-form-controller.vue index b27558432..1ce32fd28 100644 --- a/frontend/src/components/exams/add-exam-form-controller.vue +++ b/frontend/src/components/exams/add-exam-form-controller.vue @@ -311,6 +311,10 @@ export default class AddExamFormController extends Vue { messages[key] = '' return } + if (key === 'exam_received_date') { + valid[key] = true + return + } // To turn this on for event ID checks only on group exams, // add && group_exam_indicator to the if block // below as well diff --git a/frontend/src/components/exams/add-exam-modal.vue b/frontend/src/components/exams/add-exam-modal.vue index 5f1393e36..f515851c2 100644 --- a/frontend/src/components/exams/add-exam-modal.vue +++ b/frontend/src/components/exams/add-exam-modal.vue @@ -337,6 +337,7 @@ export default class AddExamModal extends Vue { return case 'other': this.resetModal() + this.captureExamDetail({ key: 'exam_received_date', value: moment(new Date()).format('YYYY-MM-DD') }) this.captureExamDetail({ key: 'on_or_off', value: 'on' }) this.captureExamDetail({ key: 'expiry_date', value: '' }) return diff --git a/frontend/src/store/actions/actions-model.ts b/frontend/src/store/actions/actions-model.ts index 72cbcf67d..ccedf053d 100644 --- a/frontend/src/store/actions/actions-model.ts +++ b/frontend/src/store/actions/actions-model.ts @@ -2138,12 +2138,6 @@ export const commonActions: any = { if (responses.notes === null) { responses.notes = '' } - if (context.state.addExamModal.setup === 'other') { - if (context.state.captureITAExamTabSetup.showRadio === true) { - delete responses.exam_received_date - } - } - if (context.state.addExamModal.setup === 'pesticide') { responses.exam_name = 'Environment' responses.is_pesticide = 1