Skip to content

Commit 0e7f884

Browse files
Merge pull request #1026 from midhunmanoj2024/SBCQ-60
SBCQ-60 Exam module changes
2 parents 06dea9d + 3bc0ec1 commit 0e7f884

12 files changed

+1526
-3235
lines changed

frontend/package-lock.json

Lines changed: 1253 additions & 3094 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
"bootstrap-vue": "^2.22.0",
3434
"buefy": "^0.9.21",
3535
"buffer": "^6.0.3",
36-
"camunda-formio-tasklist-vue": "1.0.18",
37-
"core-js": "^3.9.1",
36+
"camunda-formio-tasklist-vue": "^1.0.19",
3837
"crypto-browserify": "^3.12.0",
3938
"es6-promise": "^4.2.8",
4039
"es6-shim": "^0.35.6",
@@ -51,6 +50,7 @@
5150
"postinstall-postinstall": "^2.1.0",
5251
"process": "^0.11.10",
5352
"rrule": "^2.6.8",
53+
"select2": "^4.1.0-rc.0",
5454
"semantic-ui-css": "git+https://github.com/Semantic-Org/Semantic-UI-CSS.git",
5555
"socket.io-client": "^4.0.0",
5656
"stream-browserify": "^3.0.0",
@@ -62,9 +62,11 @@
6262
"vue-bootstrap-typeahead": "^0.2.6",
6363
"vue-class-component": "^7.2.3",
6464
"vue-fragment": "^1.5.2",
65+
"vue-multiselect": "^2.1.9",
6566
"vue-property-decorator": "^9.1.2",
66-
"vue-router": "^3.5.1",
67-
"vue-video-player": "^5.0.2",
67+
"vue-router": "3.5.1",
68+
"vue-search-select": "^2.9.6",
69+
"vue-video-player": "5.0.2",
6870
"vue2-datepicker": "^3.11.0",
6971
"vue2-timepicker": "^1.1.6",
7072
"vuetify": "^2.6.10",
@@ -105,6 +107,7 @@
105107
"babel-loader": "8.2.2",
106108
"chalk": "4.1.0",
107109
"connect-history-api-fallback": "1.6.0",
110+
"core-js": "^3.37.1",
108111
"cypress": "^12.17.4",
109112
"eslint": "^7.32.0",
110113
"eslint-friendly-formatter": "4.0.1",

frontend/src/assets/css/q.css

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,4 +263,15 @@ input#app_timepicker_id {
263263
width: unset;
264264
position: unset;
265265
left: unset;
266-
}
266+
}
267+
268+
269+
.multiselect__option--highlight {
270+
background-color: #ffffff;
271+
}
272+
273+
.custom-multiselect .multiselect__option {
274+
padding: 0;
275+
text-wrap: wrap;
276+
}
277+

frontend/src/components/Booking/calendar.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@
8080
:now="currentDay"
8181
color="primary"
8282
v-model="value"
83-
first-time="08:30"
83+
:first-time="startTime"
8484
interval-minutes="30"
8585
interval-height="40"
86-
interval-count="17"
86+
:interval-count="intervalCount"
8787
:type="type"
8888
category-show-all
8989
:categories="categories"
@@ -259,6 +259,8 @@ export default class Calendar extends Vue {
259259
mode: any = 'stack'
260260
weekday: any = [1, 2, 3, 4, 5]
261261
start: any = moment().format('YYYY-MM-DD')
262+
startTime : string = '08:30'
263+
intervalCount : string = '17'
262264
263265
value: any = ''
264266
eventsList: any = []
@@ -693,10 +695,15 @@ export default class Calendar extends Vue {
693695
694696
toggleOffsite (bool) {
695697
this.toggleOffsiteVisible(bool)
698+
696699
if (bool) {
697700
// I assume this empty block is intentional
701+
this.startTime = "00:00"
702+
this.intervalCount = "48"
698703
}
699704
if (!bool) {
705+
this.startTime = "08:30"
706+
this.intervalCount = "17"
700707
if (this.offsiteOnly) {
701708
// I assume this empty block is intentional
702709
}

frontend/src/components/exams/add-exam-form-components.ts

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ import { mapState } from 'vuex'
66
import DatePicker from 'vue2-datepicker'
77
import OfficeDrop from './office-drop.vue'
88
import moment from 'moment'
9+
import { ModelListSelect } from "vue-search-select"
10+
import { throws } from 'assert'
11+
import Multiselect from 'vue-multiselect'
12+
import 'vue-multiselect/dist/vue-multiselect.min.css'
913

1014
// Checkmark
1115
@Component({
@@ -182,7 +186,9 @@ export class DateQuestion extends Vue {
182186
// DropdownQuestion
183187
@Component({
184188
components: {
185-
Checkmark
189+
Checkmark,
190+
ModelListSelect,
191+
Multiselect
186192
},
187193
computed: {
188194
...mapState({
@@ -195,38 +201,35 @@ export class DateQuestion extends Vue {
195201
<b-row no-gutters>
196202
<b-row>
197203
<b-col class="dropdown">
198-
<h5 v-if="addExamModal.setup === 'group' ">Add Group Exam</h5>
199-
<h5 v-if="addExamModal.setup === 'individual' ">Add Individual SkilledTradesBC Exam</h5>
200-
<h5 v-if="addExamModal.setup === 'other' ">Add Non-SkilledTradesBC Exam</h5>
201-
<h5 v-if="addExamModal.setup === 'pesticide' ">Add Environment Exam</h5>
204+
<h5 v-if="addExamModal.setup === 'group'">Add Group Exam</h5>
205+
<h5 v-if="addExamModal.setup === 'individual'">Add Individual SkilledTradesBC Exam</h5>
206+
<h5 v-if="addExamModal.setup === 'other'">Add Non-SkilledTradesBC Exam</h5>
207+
<h5 v-if="addExamModal.setup === 'pesticide'">Add Environment Exam</h5>
202208
</b-col>
203209
<b-col>
204210
<label>Exam Type</label><br>
205-
<div @click="clickInput" id="exam_type_dropdown">
206-
<b-input read-only
207-
autocomplete="off"
208-
:value="inputText"
209-
placeholder="click here to see options"
210-
:style="inputStyle" />
211-
</div>
211+
<multiselect
212+
v-model="selectedExam"
213+
:options="dropItems"
214+
:track-by="'exam_type_id'"
215+
:label="'exam_type_name'"
216+
class="custom-multiselect"
217+
:show-labels="false"
218+
@input="preHandleInput"
219+
:placeholder="displayText"
220+
>
221+
<template #singleLabel="{ selectedOptions }">
222+
<span class="multiselect__single">
223+
<span >{{ displayText }}</span>
224+
</span>
225+
</template>
226+
<template #option="{ option }">
227+
<p :style="{ backgroundColor: option.exam_color, padding: '10px' }">
228+
{{ option.exam_type_name }}
229+
</p>
230+
</template>
231+
</multiselect>
212232
</b-col>
213-
</b-row
214-
<b-row>
215-
<div :class="dropclass"
216-
style="border: 1px solid grey"
217-
@click="clickInput">
218-
<template v-for="type in dropItems">
219-
<b-dd-header v-if="type.header"
220-
:style="{backgroundColor: type.exam_color, listStyleType: 'none'}"
221-
:class="type.class">{{ type.exam_type_name }}</b-dd-header>
222-
<b-dd-item v-else :style="{backgroundColor: type.exam_color, listStyleType: 'none'}"
223-
@click="preHandleInput(type.exam_type_id)"
224-
:name="type.exam_type_id"
225-
autocomplete="off"
226-
:id="type.exam_type_id"
227-
:class="type.class">{{ type.exam_type_name }}</b-dd-item>
228-
</template>
229-
</div>
230233
</b-row>
231234
</b-row>
232235
`
@@ -261,10 +264,16 @@ export class DropdownQuestion extends Vue {
261264
@State('addExamModal') private addExamModal!: any
262265
@State('capturedExam') private capturedExam!: any
263266
@State('nonITAExam') private nonITAExam!: any
267+
private objectItem:any = {};
268+
private selectedExam:any = []
269+
private displayText : string = 'Select An Exam Type'
264270

265271
@Mutation('setAddExamModalSetting') public setAddExamModalSetting: any
266272

267273
get dropItems () {
274+
this.objectItem = {
275+
exam_type_id: this.capturedExam.exam_type_id
276+
}
268277
const sorter = (a, b) => {
269278
const typeA = a.exam_type_name
270279
const typeB = b.exam_type_name
@@ -313,13 +322,6 @@ export class DropdownQuestion extends Vue {
313322
return ''
314323
}
315324

316-
get inputStyle () {
317-
if (this.exam_object && this.exam_object.exam_type_name) {
318-
return { backgroundColor: `${this.exam_object.exam_color}` }
319-
}
320-
return {}
321-
}
322-
323325
get dropclass () {
324326
if (!this.addExamModal.step1MenuOpen) {
325327
return 'dropdown-menu'
@@ -337,13 +339,19 @@ export class DropdownQuestion extends Vue {
337339
this.setAddExamModalSetting({ step1MenuOpen: false })
338340
}
339341

340-
preHandleInput (id) {
342+
customLabel(option) {
343+
return option.exam_type_name
344+
}
345+
346+
preHandleInput (item) {
341347
this.handleInput({
342348
target: {
343349
name: 'exam_type_id',
344-
value: id
350+
value: item.exam_type_id
345351
}
346352
})
353+
this.displayText = item.exam_type_name
354+
console.log("CAPTURED EXAM", item.exam_type_id);
347355
}
348356
}
349357

frontend/src/components/exams/add-exam-modal.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@shown="initialize"
1010
@hidden="hideModal"
1111
:size="modalSize"
12-
scrollable
12+
style="overflow: visible !important;"
1313
>
1414
<template slot="modal-footer">
1515
<template v-if="unSubmitted">
@@ -467,6 +467,14 @@ export default class AddExamModal extends Vue {
467467
</script>
468468

469469
<style>
470+
/* .modal-content {
471+
overflow: unset !important;
472+
} */
473+
#add-exam-modal {
474+
.modal-content {
475+
overflow: unset !important;
476+
}
477+
}
470478
.message-text {
471479
font-size: 0.9rem;
472480
font-weight: 500;
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<template>
2+
<div v-if="visible" class="confirmation-modal">
3+
<div class="modal-content">
4+
<p>Room booking for the exam will be deleted. Are you sure you want to proceed?</p>
5+
<div class="button-container">
6+
<b-btn class="btn-primary mr-2" @click="$emit('cancel')">Cancel</b-btn>
7+
<b-btn class="btn-danger ml-2" @click="$emit('confirm')">Confirm</b-btn>
8+
</div>
9+
</div>
10+
</div>
11+
</template>
12+
13+
<script>
14+
export default {
15+
props: {
16+
visible: {
17+
type: Boolean,
18+
default: false
19+
}
20+
}
21+
}
22+
</script>
23+
24+
<style scoped>
25+
.confirmation-modal {
26+
position: fixed;
27+
top: 0;
28+
left: 0;
29+
width: 100%;
30+
height: 100%;
31+
background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
32+
display: flex;
33+
justify-content: center;
34+
align-items: center;
35+
z-index: 1000; /* Ensure it's above the parent component */
36+
}
37+
38+
.modal-content {
39+
background-color: #fff;
40+
padding: 20px;
41+
border-radius: 8px;
42+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
43+
max-width: 25%;
44+
text-align: center;
45+
}
46+
47+
.modal-content p {
48+
margin-bottom: 20px;
49+
}
50+
51+
.button-container {
52+
display: flex;
53+
justify-content: center;
54+
margin-top: 20px;
55+
gap: 20 px
56+
}
57+
</style>

0 commit comments

Comments
 (0)