Skip to content

Commit

Permalink
Merge pull request #546 from bcgov/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
marzmehr authored Nov 7, 2023
2 parents 53e2f17 + 1c583fa commit ba078f9
Show file tree
Hide file tree
Showing 26 changed files with 1,006 additions and 134 deletions.
10 changes: 5 additions & 5 deletions web/src/components/FlappSurveys.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
<lawyer-party-step v-if="getCurrentStepIndex() == 20" v-bind:step="getStep(20)"></lawyer-party-step>
<remove-lawyer-party-step v-if="getCurrentStepIndex() == 21" v-bind:step="getStep(21)"></remove-lawyer-party-step>
<affidavit-step v-if="getCurrentStepIndex() == 22" v-bind:step="getStep(22)"></affidavit-step>
<electronic-filing-statement-step v-if="getCurrentStepIndex() == 23" v-bind:step="getStep(23)"></electronic-filing-statement-step>
<!-- <electronic-filing-statement-step v-if="getCurrentStepIndex() == 23" v-bind:step="getStep(23)"></electronic-filing-statement-step> -->

<step-submit v-if="getCurrentStepIndex() == 24" v-bind:step="getStep(24)"></step-submit>
<step-submit v-if="getCurrentStepIndex() == 23" v-bind:step="getStep(23)"></step-submit>
</main>
</div>
</template>
Expand All @@ -55,7 +55,7 @@ import OtherFormStep from "./steps/otherFamilyForms/OtherFormStep.vue";
import AddressChangeStep from "./steps/addressChange/AddressChangeStep.vue";
import DiscontinuanceStep from "./steps/discontinuance/DiscontinuanceStep.vue";
import IntentionProceedStep from "./steps/intentionProceed/IntentionProceedStep.vue";
import ElectronicFilingStatementStep from "./steps/electronicFilingStatement/ElectronicFilingStatementStep.vue";
// import ElectronicFilingStatementStep from "./steps/electronicFilingStatement/ElectronicFilingStatementStep.vue";
import AffidavitStep from "./steps/affidavit/AffidavitStep.vue";
import RequestSchedulingStep from "./steps/requestScheduling/RequestSchedulingStep.vue";
import RemoveLawyerPartyStep from "./steps/noticeRemoveLawyerParty/RemoveLawyerPartyStep.vue";
Expand Down Expand Up @@ -93,8 +93,8 @@ import * as surveyEnv from "@/components/survey/survey-glossary";
RemoveLawyerChildStep,
LawyerPartyStep,
RemoveLawyerPartyStep,
AffidavitStep,
ElectronicFilingStatementStep
AffidavitStep
// ElectronicFilingStatementStep
}
})
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/status/MigrateStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export class MigrateStore{
pathwayCompleted.noticeLawyerParty = false;
pathwayCompleted.noticeRemoveLawyerParty = false;
pathwayCompleted.affidavit = false;
pathwayCompleted.electronicFilingStatement = false;
// pathwayCompleted.electronicFilingStatement = false;

pathwayCompleted.other = false;
//TODO: add the other pathway
Expand Down
20 changes: 13 additions & 7 deletions web/src/components/steps/affidavit/AffidavitStep.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<template>
<step-base v-bind:step="step">
<affidavit v-bind:step="step" v-if="step.currentPage == stPgNo.AFF.Affidavit" />
<about-affiant v-bind:step="step" v-if="step.currentPage == stPgNo.AFF.AboutAffiant" />
<your-story-aff v-bind:step="step" v-if="step.currentPage == stPgNo.AFF.YourStoryAFF" />
<filing-aff v-bind:step="step" v-if="step.currentPage == stPgNo.AFF.FilingAFF" />
<review-your-answers-aff v-bind:step="step" v-if="step.currentPage == stPgNo.AFF.ReviewYourAnswersAFF"/>
<preview-forms-aff v-bind:step="step" v-if="step.currentPage == stPgNo.AFF.PreviewFormsAFF"/>
<affidavit v-bind:step="step" v-if="step.currentPage == stPgNo.AFF.Affidavit" />
<about-affiant v-bind:step="step" v-if="step.currentPage == stPgNo.AFF.AboutAffiant" />
<your-story-aff v-bind:step="step" v-if="step.currentPage == stPgNo.AFF.YourStoryAFF" />
<filing-aff v-bind:step="step" v-if="step.currentPage == stPgNo.AFF.FilingAFF" />
<electronic-filing-statement-aff v-bind:step="step" v-if="step.currentPage == stPgNo.AFF.ElectronicFilingStatementAFF" />
<review-your-answers-aff v-bind:step="step" v-if="step.currentPage == stPgNo.AFF.ReviewYourAnswersAFF"/>
<preview-forms-aff v-bind:step="step" v-if="step.currentPage == stPgNo.AFF.PreviewFormsAFF"/>
<preview-forms-efsp v-bind:step="step" v-if="step.currentPage == stPgNo.AFF.PreviewFormsEFSP"/>
</step-base>
</template>

Expand All @@ -21,8 +23,10 @@ import Affidavit from "./Affidavit.vue";
import AboutAffiant from "./AboutAffiant.vue";
import YourStoryAff from "./YourStoryAFF.vue";
import FilingAff from "./FilingAFF.vue";
import ElectronicFilingStatementAff from "./ElectronicFilingStatementAFF.vue";
import ReviewYourAnswersAff from "./reviewAFF/ReviewYourAnswersAFF.vue";
import PreviewFormsAff from "./reviewAFF/PreviewFormsAFF.vue";
import PreviewFormsEfsp from "./reviewAFF/PreviewFormsEFSP.vue";
import { stepInfoType } from "@/types/Application";
import {stepsAndPagesNumberInfoType} from "@/types/Application/StepsAndPages";
Expand All @@ -34,8 +38,10 @@ import {stepsAndPagesNumberInfoType} from "@/types/Application/StepsAndPages";
AboutAffiant,
YourStoryAff,
FilingAff,
ElectronicFilingStatementAff,
ReviewYourAnswersAff,
PreviewFormsAff
PreviewFormsAff,
PreviewFormsEfsp
}
})
export default class AffidavitStep extends Vue {
Expand Down
161 changes: 161 additions & 0 deletions web/src/components/steps/affidavit/ElectronicFilingStatementAFF.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
<template>
<page-base :disableNext="disableNextButton" v-on:onPrev="onPrev()" v-on:onNext="onNext()" >
<survey v-bind:survey="survey"></survey>
</page-base>
</template>

<script lang="ts">
import { Component, Vue, Prop} from 'vue-property-decorator';
import * as SurveyVue from "survey-vue";
import { namespace } from "vuex-class";
import "@/store/modules/application";
const applicationState = namespace("Application");
import * as surveyEnv from "@/components/survey/survey-glossary";
import surveyJson from "./forms/electronic-filing-statement-aff.json";
import PageBase from "../PageBase.vue";
import { stepInfoType, stepResultInfoType } from "@/types/Application";
import { stepsAndPagesNumberInfoType } from '@/types/Application/StepsAndPages';
@Component({
components:{
PageBase
}
})
export default class ElectronicFilingStatementAff extends Vue {
@Prop({required: true})
step!: stepInfoType;
@applicationState.State
public stPgNo!: stepsAndPagesNumberInfoType;
@applicationState.Action
public UpdateStepResultData!: (newStepResultData: stepResultInfoType) => void
@applicationState.Action
public UpdateCommonStepResults!: (newCommonStepResults) => void
survey = new SurveyVue.Model(surveyJson);
currentStep =0;
currentPage =0;
disableNextButton = false;
beforeCreate() {
const Survey = SurveyVue;
surveyEnv.setCss(Survey);
}
created() {
this.disableNextButton = false;
}
mounted(){
this.initializeSurvey();
this.addSurveyListener();
this.reloadPageInformation();
}
public initializeSurvey(){
this.survey = new SurveyVue.Model(surveyJson);
this.survey.commentPrefix = "Comment";
this.survey.showQuestionNumbers = "off";
this.survey.showNavigationButtons = false;
surveyEnv.setGlossaryMarkdown(this.survey);
}
public addSurveyListener(){
this.survey.onValueChanged.add((sender, options) => {
if(options.name == "ApplicantName") {
this.$store.commit("Application/setApplicantName", this.survey.data["ApplicantName"]);
this.UpdateCommonStepResults({data:{'applicantName':this.survey.data["ApplicantName"]}})
}
})
}
public reloadPageInformation() {
this.currentStep = this.$store.state.Application.currentStep;
this.currentPage = this.$store.state.Application.steps[this.currentStep].currentPage;
if (this.step.result?.electronicFilingStatementAffSurvey) {
this.survey.data = this.step.result.electronicFilingStatementAffSurvey.data;
Vue.filter('scrollToLocation')(this.$store.state.Application.scrollToLocationName);
} else {
this.survey.setValue('OtherPartyInfoEfsp',[]);
this.survey.setValue('PartyInfoEfsp',[]);
}
Vue.filter('setSurveyProgress')(this.survey, this.currentStep, this.currentPage, 50, false);
}
public mergeRespondants(){
const respondentNames = [];
if(this.$store.state.Application.steps[0].result && this.$store.state.Application.steps[0].result.respondents){
const respondents = this.$store.state.Application.steps[0].result.respondents
respondentNames.push(...respondents)
}
if(this.survey.data?.Lawyer){
const applicantIsLawyer = this.survey.data.Lawyer == 'y';
if (applicantIsLawyer){
if(this.survey.data?.PartyInfoEfsp && this.survey.data?.PartyInfoEfsp.length>0){
const respondentNamesEfsp = this.survey.data.PartyInfoEfsp.map(party=>party.name)
respondentNames.push(...respondentNamesEfsp)
}
} else {
if(this.survey.data?.OtherPartyInfoEfsp && this.survey.data?.OtherPartyInfoEfsp.length>0){
const respondentNamesEfsp = this.survey.data.OtherPartyInfoEfsp.map(otherParty=>otherParty.name)
respondentNames.push(...respondentNamesEfsp)
}
}
}
const fullNamesArray =[];
for(const name of respondentNames ){
fullNamesArray.push(Vue.filter('getFullName')(name))
}
const uniqueArray = respondentNames.filter(function(item, index) {
const fullName = Vue.filter('getFullName')(item)
return fullNamesArray.indexOf(fullName) == index;
})
this.UpdateCommonStepResults({data:{'respondents':uniqueArray}})
}
public onPrev() {
Vue.prototype.$UpdateGotoPrevStepPage()
}
public onNext() {
if(!this.survey.isCurrentPageHasErrors) {
Vue.prototype.$UpdateGotoNextStepPage()
}
}
beforeDestroy() {
this.mergeRespondants();
if(this.survey.data?.["ApplicantName"]) {
this.$store.commit("Application/setApplicantName", this.survey.data["ApplicantName"]);
this.UpdateCommonStepResults({data:{'applicantName':this.survey.data["ApplicantName"]}})
}
Vue.filter('setSurveyProgress')(this.survey, this.currentStep, this.currentPage, 50, true);
this.UpdateStepResultData({step:this.step, data: {electronicFilingStatementAffSurvey: Vue.filter('getSurveyResults')(this.survey, this.currentStep, this.currentPage)}})
}
}
</script>
14 changes: 7 additions & 7 deletions web/src/components/steps/affidavit/FilingAFF.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { electronicFilingDocumentInfoType, stepInfoType, stepResultInfoType } fr
import { namespace } from "vuex-class";
import "@/store/modules/application";
import { stepsAndPagesNumberInfoType } from '@/types/Application/StepsAndPages';
import { toggleStep } from '@/components/utils/TogglePages';
import { togglePages, toggleStep } from '@/components/utils/TogglePages';
const applicationState = namespace("Application");
@Component({
Expand Down Expand Up @@ -73,17 +73,17 @@ export default class FilingAff extends Vue {
public addSurveyListener(){
this.survey.onValueChanged.add((sender, options) => {
this.determineSteps();
this.determinePages();
})
}
public determineSteps(){
public determinePages(){
if (this.survey.data?.sworn && this.steps[this.stPgNo.OTHER._StepNo].result?.otherFormsSurvey?.data?.filingMethod){
const eFiling = this.steps[this.stPgNo.OTHER._StepNo].result.otherFormsSurvey.data.filingMethod == 'eFile';
toggleStep(this.stPgNo.EFSP._StepNo, this.survey.data.sworn == 'y' && eFiling);
togglePages([this.stPgNo.AFF.ElectronicFilingStatementAFF], this.survey.data.sworn == 'y' && eFiling, this.currentStep);
}
}
Expand All @@ -103,7 +103,7 @@ export default class FilingAff extends Vue {
const eFiling = this.steps[this.stPgNo.OTHER._StepNo].result.otherFormsSurvey.data.filingMethod == 'eFile';
this.survey.setVariable('eFiling', eFiling)
}
this.determineSteps();
this.determinePages();
Vue.filter('setSurveyProgress')(this.survey, this.currentStep, this.currentPage, 50, false);
}
Expand All @@ -120,14 +120,14 @@ export default class FilingAff extends Vue {
public setEfsDocumentList(){
const efsDocumentList: electronicFilingDocumentInfoType[] = this.steps[this.stPgNo.GETSTART._StepNo].result?.efsDocuments?.length>0?this.steps[this.stPgNo.GETSTART._StepNo].result.efsDocuments:[];
const efsDocumentList: electronicFilingDocumentInfoType[] = this.steps[this.stPgNo.GETSTART._StepNo].result?.affEfsDocuments?.length>0?this.steps[this.stPgNo.GETSTART._StepNo].result.affEfsDocuments:[];
if (this.step.result.aboutAffiantSurvey?.data?.ApplicantName){
const applicantName = this.step.result.aboutAffiantSurvey.data.ApplicantName
efsDocumentList.push({documentName: 'Affidavit', efsApplicantName: applicantName});
}
this.UpdateCommonStepResults({data:{'efsDocuments':efsDocumentList}});
this.UpdateCommonStepResults({data:{'affEfsDocuments':efsDocumentList}});
}
beforeDestroy() {
Expand Down
Loading

0 comments on commit ba078f9

Please sign in to comment.