Skip to content

Commit

Permalink
Merge pull request #800 from bcgov/bugs/ecer-3988
Browse files Browse the repository at this point in the history
bug fix, province drop down doesn't work for work experience reference
  • Loading branch information
SoLetsDev authored Jan 3, 2025
2 parents d2132c6 + bff9723 commit fa6feb0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<label>
{{ label }}
<v-text-field
ref="textField"
v-bind="$attrs"
:aria-label="label"
label=""
Expand All @@ -19,6 +20,11 @@
<script lang="ts">
import { defineComponent } from "vue";
import { isNumber } from "@/utils/formInput";
import type { VTextField } from "vuetify/components";
export type ECETextField = {
resetValidation(): void;
};
export default defineComponent({
name: "EceTextField",
Expand All @@ -35,6 +41,9 @@ export default defineComponent({
emits: ["input"],
methods: {
isNumber,
resetValidation() {
(this.$refs.textField as VTextField).resetValidation();
},
},
});
</script>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<Wizard :ref="'wizard'" :wizard="wizardConfigSetup" :show-steps="false">
<Loading v-if="fetchingData" />
<Wizard v-else :ref="'wizard'" :wizard="wizardConfigSetup" :show-steps="false">
<template #header>
<v-container fluid class="bg-primary">
<v-container>
Expand Down Expand Up @@ -76,18 +77,23 @@ import type { Wizard as WizardType } from "@/types/wizard";
import { PortalInviteType, WorkExperienceType } from "@/utils/constant";
import Wizard from "../Wizard.vue";
import Loading from "../Loading.vue";
export default defineComponent({
name: "Reference",
components: { Wizard },
components: { Wizard, Loading },
async setup() {
const route = useRoute();
const router = useRouter();
const { data, error } = await getReference(route.params.token as string);
let wizardConfigSetup: WizardType | undefined = undefined;
//this variable prevents errors initializing the wizard when portal invitation in invalid which prevents redirecting the user to the invalid-reference page
let fetchingData = true;
if (error) {
router.push("/invalid-reference");
} else {
fetchingData = false;
}
const wizardStore = useWizardStore();
Expand Down Expand Up @@ -117,6 +123,7 @@ export default defineComponent({
wizardConfigSetup,
router,
route,
fetchingData,
};
},
computed: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,8 @@
<script lang="ts">
import { DateTime } from "luxon";
import { defineComponent } from "vue";
import type { VTextField } from "vuetify/components";
import EceTextField from "@/components/inputs/EceTextField.vue";
import EceTextField, { type ECETextField } from "@/components/inputs/EceTextField.vue";
import EceDateInput from "@/components/inputs/EceDateInput.vue";
import { useConfigStore } from "@/store/config";
import { useWizardStore } from "@/store/wizard";
Expand Down Expand Up @@ -230,7 +229,7 @@ export default defineComponent({
return true;
},
certificateProvinceIdChanged(value: string) {
(this.$refs.certificateNumberRef as VTextField)?.resetValidation();
(this.$refs.certificateNumberRef as ECETextField)?.resetValidation();
if (value === "BC") {
this.$emit("update:model-value", {
...this.modelValue,
Expand Down

0 comments on commit fa6feb0

Please sign in to comment.