Skip to content

SBCQ-100 exam booking issue - other exams #938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 1 addition & 7 deletions frontend/src/components/exams/add-exam-final-step.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,11 @@
<b-col cols="3">
<span class="confirm-header">Received Date</span>
</b-col>
<b-col align-self="end" v-if="setup === 'individual'">
<b-col align-self="end" v-if="setup === 'individual' || setup === 'other'">
<span class="confirm-item">{{
formatDate(exam.exam_received_date)
}}</span>
</b-col>
<b-col align-self="end" v-else>
<span v-if="!tab.showRadio" class="confirm-item">{{
formatDate(exam.exam_received_date)
}}</span>
<span v-if="tab.showRadio" class="confirm-item">Not Yet Received</span>
</b-col>
</b-row>
<b-row no-gutters align-h="between" align-v="end">
<b-col cols="1" />
Expand Down
17 changes: 12 additions & 5 deletions frontend/src/components/exams/add-exam-form-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,17 +357,17 @@ export class DropdownQuestion extends Vue {
template: `
<b-row no-gutters>
<b-col cols="6">
<b-form-group v-if="showRadio">
<b-form-group>
<label>{{ q.text1 }}
<span v-if="error" style="color: red">{{ validationObj[q.key].message }}</span>
</label><br>
<b-form-radio-group v-model="showRadio"
@input="preSetDate()"
@change="unsetDate"
autocomplete="off"
:options="['other', 'pesticide'].includes(modalSetup) ? otherOptions : options"/>
:options="options"/>
</b-form-group>
<b-form-group v-else>
<b-form-group v-if="!showRadio">
<label>{{ q.text2 }}
<span v-if="error" style="color: red">{{ validationObj[q.key].message }}</span>
</label>
Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1104,4 +1111,4 @@ export class TimeQuestion extends Vue {
}
})
}
}
}
4 changes: 4 additions & 0 deletions frontend/src/components/exams/add-exam-form-controller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/exams/add-exam-modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions frontend/src/store/actions/actions-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down