Skip to content

Commit

Permalink
ECER-966: SetStage input changed to PortalStage (PR feedbacks)
Browse files Browse the repository at this point in the history
  • Loading branch information
Farzad committed Mar 25, 2024
1 parent e71414d commit 3798a51
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export default defineComponent({
},
totalHours(): number {
return this.referenceList.reduce((acc, reference) => {
return acc + (reference.hours as number);
}, 0);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<h3 class="font-black">Certification Selection</h3>
</v-col>
<v-col align="end">
<v-btn @click="setWizard('CertificationType')" v-bind="props" icon="mdi-pencil" color="primary" variant="plain" />
<v-btn v-bind="props" icon="mdi-pencil" color="primary" variant="plain" @click="setWizard('CertificationType')" />
</v-col>
</v-row>
<v-row>
Expand All @@ -23,11 +23,12 @@

<script lang="ts">
import { defineComponent } from "vue";
import { useApplicationStore } from "@/store/application";
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: {
Expand All @@ -43,15 +44,10 @@ export default defineComponent({
const wizardStore = useWizardStore();
const applicationStore = useApplicationStore();
return {
wizardStore,applicationStore,
wizardStore,
applicationStore,
};
},
methods:{
setWizard(stage:string) {
this.wizardStore.setCurrentStep(stage);
this.applicationStore.draftApplication.stage = this.wizardStore.currentStepStage;
},
},
computed: {
certificationType() {
let certificationType = "";
Expand All @@ -74,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;
},
},
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<h3 class="font-black">Character Reference</h3>
</v-col>
<v-col align="end">
<v-btn v-bind="props" @click="setWizard('CharacterReferences')" icon="mdi-pencil" color="primary" variant="plain" />
<v-btn v-bind="props" icon="mdi-pencil" color="primary" variant="plain" @click="setWizard('CharacterReferences')" />
</v-col>
</v-row>
<v-row>
Expand Down Expand Up @@ -47,8 +47,9 @@

<script lang="ts">
import { defineComponent } from "vue";
import { useApplicationStore } from "@/store/application";
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";
Expand All @@ -68,15 +69,10 @@ export default defineComponent({
const wizardStore = useWizardStore();
const applicationStore = useApplicationStore();
return {
wizardStore, applicationStore,
wizardStore,
applicationStore,
};
},
methods:{
setWizard(stage:string) {
this.wizardStore.setCurrentStep(stage);
this.applicationStore.draftApplication.stage = this.wizardStore.currentStepStage;
},
},
computed: {
characterReference(): Components.Schemas.CharacterReference {
return {
Expand All @@ -88,5 +84,11 @@ export default defineComponent({
};
},
},
methods: {
setWizard(stage: Components.Schemas.PortalStage) {
this.wizardStore.setCurrentStep(stage);
this.applicationStore.draftApplication.stage = this.wizardStore.currentStepStage;
},
},
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<h3 class="font-black">Contact Information</h3>
</v-col>
<v-col align="end">
<v-btn @click="setWizard('ContactInformation')" v-bind="props" icon="mdi-pencil" color="primary" variant="plain" />
<v-btn v-bind="props" icon="mdi-pencil" color="primary" variant="plain" @click="setWizard('ContactInformation')" />
</v-col>
</v-row>
<v-row>
Expand Down Expand Up @@ -103,12 +103,13 @@

<script lang="ts">
import { defineComponent } from "vue";
import { useApplicationStore } from "@/store/application";
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: {
Expand All @@ -124,15 +125,10 @@ export default defineComponent({
const wizardStore = useWizardStore();
const applicationStore = useApplicationStore();
return {
wizardStore,applicationStore,
wizardStore,
applicationStore,
};
},
methods:{
setWizard(stage:string) {
this.wizardStore.setCurrentStep(stage);
this.applicationStore.draftApplication.stage = this.wizardStore.currentStepStage;
},
},
computed: {
legalLastName() {
return this.wizardStore.wizardData[this.wizardStore.wizardConfig.steps.profile.form.inputs.legalLastName.id] ?? "";
Expand Down Expand Up @@ -170,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;
},
},
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<h3>Education</h3>
</v-col>
<v-col align="end">
<v-btn @click="setWizard('Education')" v-bind="props" icon="mdi-pencil" color="primary" variant="plain" />
<v-btn v-bind="props" icon="mdi-pencil" color="primary" variant="plain" @click="setWizard('Education')" />
</v-col>
</v-row>
<div v-for="(education, id, index) in educations" :key="id">
Expand Down Expand Up @@ -79,8 +79,9 @@

<script lang="ts">
import { defineComponent } from "vue";
import { useApplicationStore } from "@/store/application";
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";
Expand All @@ -100,19 +101,20 @@ export default defineComponent({
const wizardStore = useWizardStore();
const applicationStore = useApplicationStore();
return {
wizardStore,applicationStore,
wizardStore,
applicationStore,
};
},
methods:{
setWizard(stage:string) {
this.wizardStore.setCurrentStep(stage);
this.applicationStore.draftApplication.stage = this.wizardStore.currentStepStage;
},
},
computed: {
educations(): { [id: string]: Components.Schemas.Transcript } {
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;
},
},
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<h3>Work Experience References</h3>
</v-col>
<v-col align="end">
<v-btn @click="setWizard('WorkReferences')" v-bind="props" icon="mdi-pencil" color="primary" variant="plain" />
<v-btn v-bind="props" icon="mdi-pencil" color="primary" variant="plain" @click="setWizard('WorkReferences')" />
</v-col>
</v-row>
<div v-for="(experience, id, index) in references" :key="id">
Expand Down Expand Up @@ -47,8 +47,9 @@

<script lang="ts">
import { defineComponent } from "vue";
import { useApplicationStore } from "@/store/application";
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";
Expand All @@ -69,19 +70,20 @@ export default defineComponent({
const applicationStore = useApplicationStore();
return {
wizardStore,applicationStore,
wizardStore,
applicationStore,
};
},
methods:{
setWizard(stage:string) {
this.wizardStore.setCurrentStep(stage);
this.applicationStore.draftApplication.stage = this.wizardStore.currentStepStage;
},
},
computed: {
references(): { [id: string]: Components.Schemas.WorkExperienceReference } {
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;
},
},
});
</script>
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { defineStore } from "pinia";

import { AddressType } from "@/components/inputs/EceAddresses.vue";
import type { Components } from "@/types/openapi";
import type { Step, Wizard } from "@/types/wizard";
import { useUserStore } from "./user";

import { useUserStore } from "./user";
export interface WizardData {
[key: string]: any;
}
Expand Down Expand Up @@ -99,7 +100,7 @@ export const useWizardStore = defineStore("wizard", {
setWizardData(wizardData: WizardData): void {
this.wizardData = { ...this.wizardData, ...wizardData };
},
setCurrentStep(stage: string): void {
setCurrentStep(stage: Components.Schemas.PortalStage): void {
const item = Object.values(this.wizardConfig.steps).findIndex((step) => step.stage === stage) + 1;
this.step = item;
},
Expand Down

0 comments on commit 3798a51

Please sign in to comment.