diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/WorkExperienceReferenceProgressBar.vue b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/WorkExperienceReferenceProgressBar.vue index af583dfe6..b286a62eb 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/WorkExperienceReferenceProgressBar.vue +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/WorkExperienceReferenceProgressBar.vue @@ -37,7 +37,6 @@ export default defineComponent({ }, totalHours(): number { return this.referenceList.reduce((acc, reference) => { - return acc + (reference.hours as number); }, 0); }, diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceCertificationTypePreview.vue b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceCertificationTypePreview.vue index 9b16dc2f4..fbeaedd60 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceCertificationTypePreview.vue +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceCertificationTypePreview.vue @@ -6,7 +6,7 @@

Certification Selection

- + @@ -25,9 +25,10 @@ import { defineComponent } from "vue"; import PreviewCard from "@/components/PreviewCard.vue"; +import { useApplicationStore } from "@/store/application"; import { useWizardStore } from "@/store/wizard"; import type { EcePreviewProps } from "@/types/input"; - +import type { Components } from "@/types/openapi"; export default defineComponent({ name: "EceCertificationTypePreview", components: { @@ -41,9 +42,10 @@ export default defineComponent({ }, setup: () => { const wizardStore = useWizardStore(); - + const applicationStore = useApplicationStore(); return { wizardStore, + applicationStore, }; }, computed: { @@ -68,5 +70,11 @@ export default defineComponent({ return certificationType; }, }, + methods: { + setWizard(stage: Components.Schemas.PortalStage) { + this.wizardStore.setCurrentStep(stage); + this.applicationStore.draftApplication.stage = this.wizardStore.currentStepStage; + }, + }, }); diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceCharacterReferencePreview.vue b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceCharacterReferencePreview.vue index cb5a63fbc..01345a69e 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceCharacterReferencePreview.vue +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceCharacterReferencePreview.vue @@ -6,7 +6,7 @@

Character Reference

- +
@@ -49,6 +49,7 @@ import { defineComponent } from "vue"; import PreviewCard from "@/components/PreviewCard.vue"; +import { useApplicationStore } from "@/store/application"; import { useWizardStore } from "@/store/wizard"; import type { EcePreviewProps } from "@/types/input"; import type { Components } from "@/types/openapi"; @@ -66,9 +67,10 @@ export default defineComponent({ }, setup: () => { const wizardStore = useWizardStore(); - + const applicationStore = useApplicationStore(); return { wizardStore, + applicationStore, }; }, computed: { @@ -82,5 +84,11 @@ export default defineComponent({ }; }, }, + methods: { + setWizard(stage: Components.Schemas.PortalStage) { + this.wizardStore.setCurrentStep(stage); + this.applicationStore.draftApplication.stage = this.wizardStore.currentStepStage; + }, + }, }); diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceContactInformationPreview.vue b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceContactInformationPreview.vue index 39b5518b3..a1cc0cf43 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceContactInformationPreview.vue +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceContactInformationPreview.vue @@ -6,7 +6,7 @@

Contact Information

- +
@@ -106,9 +106,10 @@ import { defineComponent } from "vue"; import type { AddressesData } from "@/components/inputs/EceAddresses.vue"; import PreviewCard from "@/components/PreviewCard.vue"; +import { useApplicationStore } from "@/store/application"; import { useWizardStore } from "@/store/wizard"; import type { EcePreviewProps } from "@/types/input"; - +import type { Components } from "@/types/openapi"; export default defineComponent({ name: "EceContactInformationPreview", components: { @@ -122,9 +123,10 @@ export default defineComponent({ }, setup: () => { const wizardStore = useWizardStore(); - + const applicationStore = useApplicationStore(); return { wizardStore, + applicationStore, }; }, computed: { @@ -164,5 +166,11 @@ export default defineComponent({ return this.wizardStore.wizardData[this.wizardStore.wizardConfig.steps.profile.form.inputs.alternateContactNumber.id] ?? "—"; }, }, + methods: { + setWizard(stage: Components.Schemas.PortalStage) { + this.wizardStore.setCurrentStep(stage); + this.applicationStore.draftApplication.stage = this.wizardStore.currentStepStage; + }, + }, }); diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceEducationPreview.vue b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceEducationPreview.vue index c72767ba0..2623ce384 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceEducationPreview.vue +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceEducationPreview.vue @@ -6,7 +6,7 @@

Education

- +
@@ -81,6 +81,7 @@ import { defineComponent } from "vue"; import PreviewCard from "@/components/PreviewCard.vue"; +import { useApplicationStore } from "@/store/application"; import { useWizardStore } from "@/store/wizard"; import type { EcePreviewProps } from "@/types/input"; import type { Components } from "@/types/openapi"; @@ -98,9 +99,10 @@ export default defineComponent({ }, setup: () => { const wizardStore = useWizardStore(); - + const applicationStore = useApplicationStore(); return { wizardStore, + applicationStore, }; }, computed: { @@ -108,5 +110,11 @@ export default defineComponent({ return this.wizardStore.wizardData[this.wizardStore.wizardConfig.steps.education.form.inputs.educationList.id]; }, }, + methods: { + setWizard(stage: Components.Schemas.PortalStage) { + this.wizardStore.setCurrentStep(stage); + this.applicationStore.draftApplication.stage = this.wizardStore.currentStepStage; + }, + }, }); diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceWorkExperienceReferencePreview.vue b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceWorkExperienceReferencePreview.vue index b969d151d..2926211e4 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceWorkExperienceReferencePreview.vue +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceWorkExperienceReferencePreview.vue @@ -6,7 +6,7 @@

Work Experience References

- +
@@ -49,6 +49,7 @@ import { defineComponent } from "vue"; import PreviewCard from "@/components/PreviewCard.vue"; +import { useApplicationStore } from "@/store/application"; import { useWizardStore } from "@/store/wizard"; import type { EcePreviewProps } from "@/types/input"; import type { Components } from "@/types/openapi"; @@ -66,9 +67,11 @@ export default defineComponent({ }, setup: () => { const wizardStore = useWizardStore(); + const applicationStore = useApplicationStore(); return { wizardStore, + applicationStore, }; }, computed: { @@ -76,5 +79,11 @@ export default defineComponent({ return this.wizardStore.wizardData[this.wizardStore.wizardConfig.steps.workReference.form.inputs.referenceList.id]; }, }, + methods: { + setWizard(stage: Components.Schemas.PortalStage) { + this.wizardStore.setCurrentStep(stage); + this.applicationStore.draftApplication.stage = this.wizardStore.currentStepStage; + }, + }, }); diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceWorkExperienceReferences.vue b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceWorkExperienceReferences.vue index 2584f70f8..792518c7b 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceWorkExperienceReferences.vue +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceWorkExperienceReferences.vue @@ -216,7 +216,7 @@ export default defineComponent({ lastName: this.lastName, emailAddress: this.email, phoneNumber: this.phoneNumber, - hours: parseInt(this.hours), + hours: parseInt(this.hours!.toString()), }; // see if we already have a clientId (which is edit), if not use the newClientId (which is add) diff --git a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/wizard.ts b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/wizard.ts index c889446f3..e56b9df83 100644 --- a/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/wizard.ts +++ b/src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/store/wizard.ts @@ -5,7 +5,6 @@ import type { Components } from "@/types/openapi"; import type { Step, Wizard } from "@/types/wizard"; import { useUserStore } from "./user"; - export interface WizardData { [key: string]: any; } @@ -101,6 +100,10 @@ export const useWizardStore = defineStore("wizard", { setWizardData(wizardData: WizardData): void { this.wizardData = { ...this.wizardData, ...wizardData }; }, + setCurrentStep(stage: Components.Schemas.PortalStage): void { + const item = Object.values(this.wizardConfig.steps).findIndex((step) => step.stage === stage) + 1; + this.step = item; + }, incrementStep(): void { if (this.step < Object.keys(this.wizardConfig.steps).length) { this.step += 1;