Skip to content

Commit

Permalink
Merge pull request #1843 from bcgov/feature/edx-2830
Browse files Browse the repository at this point in the history
EDX-2830:  Updated status for summer collection
  • Loading branch information
mightycox authored Aug 15, 2024
2 parents 241fec8 + aa0f27f commit ea5792a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

<v-row justify="end">
<PrimaryButton
v-if="!displayNextBtn"
v-if="!displayNextBtn "
id="step-5-submit-data-button"
class="mr-3 mb-3"
icon="mdi-check"
Expand All @@ -58,7 +58,7 @@
:click-action="submit"
/>
<PrimaryButton
v-else
v-else-if="districtCollectionObject?.collectionTypeCode !== 'JULY'"
id="step-5-submit-data-button"
class="mr-3 mb-3"
icon="mdi-check"
Expand Down Expand Up @@ -133,15 +133,17 @@ export default {
return this.isStepComplete || this.hasEditPermission;
},
submit() {
if(this.districtCollectionObject?.sdcDistrictCollectionStatusCode !== 'SUBMITTED') {
this.markStepAsComplete();
if(this.districtCollectionObject?.collectionTypeCode === 'JULY') {
this.markStepAsComplete('COMPLETED');
} else {
this.markStepAsComplete('SUBMITTED');
}
},
markStepAsComplete(){
markStepAsComplete(status){
this.isLoading = true;
let updateCollection = {
districtCollection: this.districtCollectionObject,
status: 'SUBMITTED'
status: status
};
ApiService.apiAxios.put(`${ApiRoutes.sdc.SDC_DISTRICT_COLLECTION}/${this.$route.params.sdcDistrictCollectionID}`, updateCollection)
.then(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,34 +73,35 @@
</v-window>
</div>

<v-row justify="end">
<PrimaryButton
id="step-4-next-button-district"
class="mr-3 mb-3"
:disabled="disableNextButton() || apiError"
icon="mdi-check"
text="Verify as Correct"
:click-action="next"
/>
</v-row>
<v-row
v-if="disableNextButton()"
justify="end"
class="my-0"
>
<p class="form-hint mr-3">
<span v-if="nonAllowableDuplicates.length > 0">
{{ nonAllowableDuplicates.length }} enrollment
</span>
<span v-if="nonAllowableDuplicates.length > 0 && nonAllowableProgramDuplicates.length > 0">
and
</span>
<span v-if="nonAllowableProgramDuplicates.length > 0">
{{ nonAllowableProgramDuplicates.length }} program
</span>
duplicate(s) unresolved
</p>
</v-row>
<v-row justify="end">
<PrimaryButton
id="step-4-next-button-district"
class="mr-3 mb-3"
:disabled="disableNextButton() || apiError || !hasEditPermission"
icon="mdi-check"
text="Verify as Correct"
:click-action="next"
/>
</v-row>
<v-row
v-if="disableNextButton()"
justify="end"
class="my-0"
>
<p class="form-hint mr-3">
<span v-if="nonAllowableDuplicates.length > 0">
{{ nonAllowableDuplicates.length }} enrollment
</span>
<span v-if="nonAllowableDuplicates.length > 0 && nonAllowableProgramDuplicates.length > 0">
and
</span>
<span v-if="nonAllowableProgramDuplicates.length > 0">
{{ nonAllowableProgramDuplicates.length }} program
</span>
duplicate(s) unresolved
</p>
</v-row>

</template>
<script>
import {defineComponent} from 'vue';
Expand Down Expand Up @@ -162,7 +163,7 @@ export default defineComponent({
...mapState(authStore, ['userInfo']),
PROVINCIAL_DUPLICATES() {
return SCHOOL_PROVINCIAL_DUPLICATES;
},
}
},
async created() {
sdcCollectionStore().getCodes().then(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
justify="end"
>
<PrimaryButton
v-if="!displayNextBtn && !isSubmitted"
v-if="!displayNextBtn && !isSubmitted "
id="step-4-next-button-school"
class="mr-3 mb-3"
icon="mdi-check"
Expand All @@ -90,7 +90,7 @@
:click-action="submit"
/>
<PrimaryButton
v-else-if="!isSubmitted"
v-else-if="!isSubmitted && schoolCollectionObject.collectionTypeCode !== 'JULY'"
id="step-4-next-button-school"
class="mr-3 mb-3"
icon="mdi-check"
Expand Down Expand Up @@ -169,15 +169,17 @@ export default {
},
methods: {
submit() {
if(this.schoolCollectionObject?.sdcSchoolCollectionStatusCode !== 'SUBMITTED') {
this.markStepAsComplete();
if(this.schoolCollectionObject?.collectionTypeCode === 'JULY') {
this.markStepAsComplete('COMPLETED');
} else {
this.markStepAsComplete('SUBMITTED');
}
},
markStepAsComplete() {
markStepAsComplete(status) {
this.isLoading = true;
let updateCollection = {
schoolCollection: this.schoolCollectionObject,
status: 'SUBMITTED'
status: status
};
ApiService.apiAxios.put(ApiRoutes.sdc.BASE_URL + '/' + this.sdcSchoolCollectionID, updateCollection)
.then(() => {
Expand Down

0 comments on commit ea5792a

Please sign in to comment.