Skip to content

Commit

Permalink
Merge pull request #597 from bcgov/ccfri-4050-nmf-bug-fix
Browse files Browse the repository at this point in the history
ccfri-4050 - NMF bug fixes
  • Loading branch information
vietle-cgi authored Dec 9, 2024
2 parents 421e353 + b0a89de commit 574c950
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 83 deletions.
98 changes: 39 additions & 59 deletions frontend/src/components/RFI/NMF.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<p class="text-h5">
Child Care Operating Funding Program - {{ formattedProgramYear }} Program Confirmation Form
</p>
<p class="text-h5 font-weight-bold">Parent Fees – Request for Information</p>
<p class="text-h5 font-weight-bold mt-4">Parent Fees – Request for Information</p>
<br />
<FacilityHeader
:facility-account-number="currentFacility?.facilityAccountNumber"
Expand Down Expand Up @@ -34,7 +34,7 @@
1. Did you apply for Ministry funding to create new licensed spaces prior to April 1, 2021 (e.g. New
Spaces Fund, UBCM Community Child Care Space Creation Program, Start-up Grants, Rapid Renovation Funding)?
</p>
<v-radio-group v-model="model.supportNeeds" required inline label="" :disabled="isReadOnly" :rules="rules">
<v-radio-group v-model="model.supportNeeds" inline :disabled="isReadOnly" :rules="rules.required">
<v-radio label="Yes" value="Yes" />
<v-radio label="No" value="No" />
</v-radio-group>
Expand All @@ -46,12 +46,11 @@
</p>
<v-textarea
v-model="model.supportNeedsComments"
required
variant="outlined"
name="input-7-4"
label="Type here"
:disabled="isReadOnly"
:rules="rules"
:rules="rules.required"
class="pt-2"
/>
</div>
</div>
Expand All @@ -62,27 +61,19 @@
support families experiencing vulnerability and/or underserved populations, such as Indigenous or
low-income families?
</p>
<v-radio-group
v-model="model.lowIncomeFamilies"
required
inline
label=""
:disabled="isReadOnly"
:rules="rules"
>
<v-radio-group v-model="model.lowIncomeFamilies" inline :disabled="isReadOnly" :rules="rules.required">
<v-radio label="Yes" value="Yes" />
<v-radio label="No" value="No" />
</v-radio-group>
<div v-if="model.lowIncomeFamilies === 'Yes'" class="text-h6 text--primary pt-2">
<p>Please describe the service(s) and associated expenses.</p>
<v-textarea
v-model="model.lowIncomeFamiliesComments"
required
variant="outlined"
name="input-7-4"
label="Type here"
:disabled="isReadOnly"
:rules="rules"
:rules="rules.required"
class="pt-2"
/>
</div>
</div>
Expand All @@ -91,46 +82,36 @@
3. Do you provide transportation to/from your facility to support families in rural or remote communities
who may not otherwise be able to access child care?
</p>
<v-radio-group
v-model="model.remoteCommunities"
required
inline
label=""
:disabled="isReadOnly"
:rules="rules"
>
<v-radio-group v-model="model.remoteCommunities" inline :disabled="isReadOnly" :rules="rules.required">
<v-radio label="Yes" value="Yes" />
<v-radio label="No" value="No" />
</v-radio-group>
<div v-if="model.remoteCommunities === 'Yes'" class="text-h6 text--primary pt-2">
<p>Please describe the service(s) and associated expenses.</p>
<v-textarea
v-model="model.remoteCommunitiesComments"
required
variant="outlined"
name="input-7-4"
label="Type here"
:disabled="isReadOnly"
:rules="rules"
:rules="rules.required"
class="pt-2"
/>
</div>
</div>

<div class="px-md-12 px-7 pb-10">
<p class="text-h6 text--primary my-0">
4. Please tell us anything else you’d like us to know about how your facility’s business case supports
setting fees higher than the Affordability Benchmarks outlined in the 2023-24
<a :href="fundingUrl" target="_blank">Funding Guidelines</a>
setting fees higher than the Affordability Benchmarks outlined in the {{ formattedProgramYear }}
<a :href="fundingUrl" target="_blank">Funding Guidelines</a>.
</p>
<div class="pt-6">
<v-textarea
v-model="model.otherComments"
variant="outlined"
name="input-7-4"
label="Type here"
:disabled="isReadOnly"
/>
</div>
<v-textarea
v-model="model.otherComments"
variant="outlined"
label="Type here"
:disabled="isReadOnly"
class="pt-2"
/>
</div>
</v-card-text>
</v-card>
Expand All @@ -151,19 +132,20 @@

<script>
import { mapActions, mapState } from 'pinia';
import { useAppStore } from '../../store/app.js';
import { useApplicationStore } from '../../store/application.js';
import { useNmfAppStore } from '../../store/nmfApp.js';
import { useNavBarStore } from '../../store/navBar.js';
import alertMixin from '../../mixins/alertMixin.js';
import NavButton from '../../components/util/NavButton.vue';
import FacilityHeader from '../guiComponents/FacilityHeader.vue';
import NavButton from '@/components/util/NavButton.vue';
import FacilityHeader from '@/components/guiComponents/FacilityHeader.vue';
let model = { x: [] };
import { useAppStore } from '@/store/app.js';
import { useApplicationStore } from '@/store/application.js';
import { useNmfAppStore } from '@/store/nmfApp.js';
import { useNavBarStore } from '@/store/navBar.js';
import alertMixin from '@/mixins/alertMixin.js';
import rules from '@/utils/rules.js';
export default {
name: 'CcfriRequestMoreInfo',
name: 'NmfRequestMoreInfo',
components: { NavButton, FacilityHeader },
mixins: [alertMixin],
async beforeRouteLeave(_to, _from, next) {
Expand All @@ -172,21 +154,19 @@ export default {
},
data() {
return {
model,
rules: [(v) => !!v || 'Required.'],
model: {},
isLoading: true,
isProcessing: false,
isValidForm: false,
};
},
computed: {
...mapState(useApplicationStore, ['formattedProgramYear']),
...mapState(useApplicationStore, ['formattedProgramYear', 'programYearId']),
...mapState(useNmfAppStore, ['nmfModel']),
...mapState(useNavBarStore, ['navBarList', 'nextPath', 'previousPath', 'getNavByCCFRIId']),
...mapState(useNavBarStore, ['navBarList', 'nextPath', 'previousPath']),
...mapState(useAppStore, ['getFundingUrl']),
currentFacility() {
//return this.getNavByCCFRIId(this.$route.params.urlGuid);
return this.navBarList.find((el) => el.ccfriApplicationId == this.$route.params.urlGuid);
return this.navBarList.find((el) => el.ccfriApplicationId === this.$route.params.urlGuid);
},
isReadOnly() {
return !this.currentFacility.unlockNmf;
Expand All @@ -198,9 +178,7 @@ export default {
watch: {
'$route.params.urlGuid': {
async handler() {
let ccfriId = this.$route.params.urlGuid;
console.log('ccfriId = ', ccfriId);
await this.loadNmf(ccfriId);
await this.loadNmf(this.$route.params.urlGuid);
this.isLoading = false;
},
immediate: true,
Expand All @@ -215,6 +193,9 @@ export default {
deep: true,
},
},
created() {
this.rules = rules;
},
methods: {
...mapActions(useNavBarStore, ['setNavBarNMFComplete']),
...mapActions(useNmfAppStore, ['loadNmf', 'saveNmf', 'setNmfModel', 'setIsNmfComplete', 'setHasNmf']),
Expand All @@ -231,12 +212,11 @@ export default {
this.isProcessing = true;
try {
this.setNmfModel({ ...this.model, isNmfComplete: this.isValidForm });
let ccfriId = this.$route.params.urlGuid;
let nmfId = await this.saveNmf(ccfriId);
const nmfId = await this.saveNmf(this.$route.params.urlGuid);
if (nmfId) {
this.model.nmfId = nmfId;
}
this.setNavBarNMFComplete({ ccfriId: ccfriId, complete: this.isValidForm });
this.setNavBarNMFComplete({ ccfriId: this.$route.params.urlGuid, complete: this.isValidForm });
if (showNotification) {
this.setSuccessAlert('Success! RFI information has been saved.');
}
Expand Down
42 changes: 18 additions & 24 deletions frontend/src/components/summary/group/NMFSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,28 +170,23 @@
</v-col>
</v-row>
</v-row>
<v-row v-if="!isValidForm" class="d-flex justify-start">
<v-col cols="6" lg="4" class="pb-0 pt-0">
<v-row no-gutters class="d-flex justify-start">
<v-col cols="12" class="d-flex justify-start">
<router-link :to="getLink()">
<span style="color: #ff5252; text-underline: black"
><u>To add this information, click here. This will bring you to a different page.</u></span
>
</router-link>
</v-col>
</v-row>
</v-col>
</v-row>
<div class="mt-6">
<router-link v-if="!isValidForm" :to="pcfLink">
<u class="error-message">To add this information, click here. This will bring you to a different page.</u>
</router-link>
</div>
</v-expansion-panel-text>
</v-form>
</v-row>
</template>
<script>
import rules from '../../../utils/rules.js';
import { PATHS, pcfUrlGuid } from '../../../utils/constants.js';
import { mapState } from 'pinia';
import { useSummaryDeclarationStore } from '@/store/summaryDeclaration.js';
import rules from '@/utils/rules.js';
import { PATHS, pcfUrlGuid } from '@/utils/constants.js';
export default {
name: 'NMFSummary',
props: {
Expand Down Expand Up @@ -227,7 +222,11 @@ export default {
};
},
computed: {
...mapState('summaryDeclaration', ['isLoadingComplete']),
...mapState(useSummaryDeclarationStore, ['isLoadingComplete']),
pcfLink() {
return pcfUrlGuid(PATHS.CCFRI_NMF, this.programYearId, this.ccfriId);
},
},
watch: {
isLoadingComplete: {
Expand All @@ -238,11 +237,6 @@ export default {
},
},
},
methods: {
getLink() {
return pcfUrlGuid(PATHS.CCFRI_NMF, this.programYearId, this.ccfriId);
},
},
};
</script>
<style scoped>
Expand All @@ -251,9 +245,9 @@ export default {
font-size: small;
}
>>> ::placeholder {
color: #ff5252 !important;
opacity: 1;
:deep(::placeholder) {
color: red !important;
opacity: 1 !important;
}
.summary-value {
Expand Down

0 comments on commit 574c950

Please sign in to comment.