Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
arcshiftsolutions committed Dec 5, 2024
2 parents 2b99f8f + e558205 commit 39db91e
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 40 deletions.
3 changes: 2 additions & 1 deletion backend/src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ nconf.defaults({
webSocketURL: process.env.WEB_SOCKET_URL,
disableSdcFunctionality: process.env.DISABLE_SDC_FUNCTIONALITY === 'true',
edxURL: process.env.EDX_URL,
disableEASFunctionality: process.env.DISABLE_EAS_FUNCTIONALITY ? process.env.DISABLE_EAS_FUNCTIONALITY === 'true' : true
disableEASFunctionality: process.env.DISABLE_EAS_FUNCTIONALITY ? process.env.DISABLE_EAS_FUNCTIONALITY === 'true' : true,
sldMigrationDate: process.env.SLD_MIGRATION_DATE
},
sdc: {
rootURL: process.env.SDC_API_URL,
Expand Down
3 changes: 2 additions & 1 deletion backend/src/routes/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ async function getConfig(req, res) {
WEB_SOCKET_URL: frontendConfig.webSocketURL,
DISABLE_SDC_FUNCTIONALITY: frontendConfig.disableSdcFunctionality,
EDX_URL: frontendConfig.edxURL,
DISABLE_EAS_FUNCTIONALITY: 'disableEASFunctionality' in frontendConfig ? frontendConfig.disableEASFunctionality : true
DISABLE_EAS_FUNCTIONALITY: 'disableEASFunctionality' in frontendConfig ? frontendConfig.disableEASFunctionality : true,
SLD_MIGRATION_DATE: frontendConfig.sldMigrationDate
};
return res.status(HttpStatus.OK).json(frontConfig);
}
Expand Down
73 changes: 39 additions & 34 deletions frontend/src/components/data-collection/DuplicatesPosting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<v-col>
<h4>Province Duplicates Posting</h4>
<br>
<p v-if="isPostProvincialDuplicatesButtonDisabled">
<p v-if="collectionObject?.collectionStatusCode !== 'PROVDUPES'">
The Province Duplicates can be posted once all school districts and independent schools have submitted their 1701 data, and there are no outstanding PEN fixes.
</p>
<br>
Expand Down Expand Up @@ -217,10 +217,12 @@ export default {
signoffDueDate: null
},
postedDupesReport: Routes.POSTED_DUPES_REPORT,
monitorSdcDistrictCollectionsResponse: [],
monitorSdcSchoolCollectionsResponse: [],
sdcDistrictCollectionsNotSubmitted: null,
sdcSchoolCollectionsNotSubmitted: null,
isPostProvincialDuplicatesButtonDisabled: false,
isCloseCollectionButtonDisabled: false
isCloseCollectionButtonDisabled: false,
sdcSchoolCollectionsNotCompleted: false,
sdcDistrictCollectionsNotCompleted: false
};
},
computed: {
Expand All @@ -235,57 +237,60 @@ export default {
sdcCollectionStore().getCodes().then(() => {
this.loadStudents();
});
this.getProvincialDuplicates();
sdcCollectionStore().getCollectionTypeCodesMap().finally(() => {
this.getActiveCollection();
});
this.getProvincialDuplicates();
this.checkIsPostProvincialDuplicatesButtonDisabled();
this.checkIsCloseCollectionButtonDisabled();
},
methods: {
async getSdcSchoolCollections(){
this.isLoading = true;
await ApiService.apiAxios.get(`${Routes.sdc.BASE_URL}/collection/${this.collectionObject.collectionID}/indySdcSchoolCollectionMonitoring`, {
}).then(response => {
this.monitorSdcSchoolCollectionsResponse = response?.data.monitorSdcSchoolCollections;
}).catch(error => {
console.error(error);
this.setFailureAlert(error?.response?.data?.message ? error?.response?.data?.message : 'An error occurred while trying to get indy school collections. Please try again later.');
}).finally(() => {
this.isLoading = false;
});
await ApiService.apiAxios.get(`${Routes.sdc.BASE_URL}/collection/${this.collectionObject.collectionID}/sdcSchoolCollections`)
.then((res) => {
this.sdcSchoolCollectionsNotSubmitted = res.data.filter(schools =>
schools.sdcSchoolCollectionStatusCode !== 'SUBMITTED' && schools.sdcSchoolCollectionStatusCode !== 'COMPLETED' && schools.sdcSchoolCollectionStatusCode !== 'P_DUP_POST'
&& schools.sdcSchoolCollectionStatusCode !== 'P_DUP_VRFD')?.length;
this.sdcSchoolCollectionsNotCompleted = res.data.filter(schools => schools.sdcSchoolCollectionStatusCode !== 'COMPLETED')?.length;
}).catch(error => {
console.error(error);
this.setFailureAlert(error?.response?.data?.message ? error?.response?.data?.message : 'An error occurred while trying to get indy school collections. Please try again later.');
}).finally(() => {
this.isLoading = false;
});
},
async getSdcDistrictCollectionMonitoring() {
this.isLoading = true;
await ApiService.apiAxios.get(`${Routes.sdc.BASE_URL}/collection/${this.collectionObject.collectionID}/sdcDistrictCollectionMonitoring`, {
}).then(response => {
this.monitorSdcDistrictCollectionsResponse = response?.data;
}).catch(error => {
console.error(error);
this.setFailureAlert(error?.response?.data?.message ? error?.response?.data?.message : 'An error occurred while trying to get sdc district collections. Please try again later.');
}).finally(() => {
this.isLoading = false;
});
await ApiService.apiAxios.get(`${Routes.sdc.BASE_URL}/collection/${this.collectionObject.collectionID}/sdcDistrictCollections`)
.then((res) => {
this.sdcDistrictCollectionsNotSubmitted = res.data.filter(district =>
district.sdcDistrictCollectionStatusCode !== 'SUBMITTED' && district.sdcDistrictCollectionStatusCode !== 'COMPLETED' && district.sdcDistrictCollectionStatusCode !== 'P_DUP_POST'
&& district.sdcDistrictCollectionStatusCode !== 'P_DUP_VRFD')?.length;
this.sdcDistrictCollectionsNotCompleted = res.data.filter(district => district.sdcDistrictCollectionStatusCode !== 'COMPLETED')?.length;
}).catch(error => {
console.error(error);
this.setFailureAlert(error?.response?.data?.message ? error?.response?.data?.message : 'An error occurred while trying to get sdc district collections. Please try again later.');
}).finally(() => {
this.isLoading = false;
});
},
checkIsPostProvincialDuplicatesButtonDisabled() {
const districtsNotSubmittedCount = this.monitorSdcDistrictCollectionsResponse.filter(response => response.sdcDistrictCollectionStatusCode !== 'SUBMITTED').length;
const indieSchoolsNotSubmittedCount = this.monitorSdcSchoolCollectionsResponse.filter(response => response.schoolStatus !== 'SUBMITTED').length;
const allPenFixesResolved = this.totalPenFixElements === 0;
this.isPostProvincialDuplicatesButtonDisabled = districtsNotSubmittedCount > 0 || indieSchoolsNotSubmittedCount > 0 || !allPenFixesResolved;
this.isPostProvincialDuplicatesButtonDisabled = this.sdcDistrictCollectionsNotSubmitted > 0 || this.sdcSchoolCollectionsNotSubmitted > 0 || !allPenFixesResolved;
},
checkIsCloseCollectionButtonDisabled() {
const districtsNotCompletedCount = this.monitorSdcDistrictCollectionsResponse.filter(response => response.sdcDistrictCollectionStatusCode !== 'COMPLETED').length;
const indieSchoolsNotCompletedCount = this.monitorSdcSchoolCollectionsResponse.filter(response => response.schoolStatus !== 'COMPLETED').length;
this.isCloseCollectionButtonDisabled = districtsNotCompletedCount > 0 || indieSchoolsNotCompletedCount > 0;
if(this.collectionObject?.collectionTypeCode !== 'JULY') {
this.isCloseCollectionButtonDisabled = this.sdcDistrictCollectionsNotCompleted > 0 || this.sdcSchoolCollectionsNotCompleted > 0;
}
},
getProvincialDuplicates(){
this.isLoading = true;
ApiService.apiAxios.get(Routes.sdc.BASE_URL + '/collection/'+ this.collectionID + '/provincial-duplicates').then(response => {
this.nonAllowableDuplicates = response.data?.enrollmentDuplicates?.NON_ALLOW;
this.nonAllowableProgramDuplicates = response.data?.programDuplicates?.NON_ALLOW;
this.nonAllowableDuplicates = response?.data?.enrollmentDuplicates;
this.nonAllowableProgramDuplicates = response?.data?.programDuplicates;
}).catch(error => {
console.error(error);
this.setFailureAlert(error.response?.data?.message || error.message);
Expand Down
16 changes: 13 additions & 3 deletions frontend/src/components/data-collection/Reports.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@
import {hasRequiredPermission, PERMISSION} from '@/utils/constants/Permission';
import {mapState} from 'pinia';
import {authStore} from '@/store/modules/auth';
import { appStore } from '@/store/modules/app';
import ReportSection from '@/components/data-collection/ReportSection.vue';
import {SDC_REPORTS} from '@/utils/constants';
import {LocalDate, LocalDateTime} from '@js-joda/core';
export default {
name: 'Reports',
Expand All @@ -90,13 +92,14 @@ export default {
};
},
computed: {
...mapState(authStore, ['userInfo'])
...mapState(authStore, ['userInfo']),
...mapState(appStore, ['config']),
},
created() {
this.setOriginalReportTab();
this.publicReports = this.getActiveReports(SDC_REPORTS.publicReports);
this.independentReports = this.getActiveReports(SDC_REPORTS.independentReports);
this.headcountsReports = this.getActiveReports(SDC_REPORTS.headcountReports);
this.headcountsReports = this.visibleHeadcountsReports(SDC_REPORTS.headcountReports);
},
methods: {
getActiveReports(reports){
Expand All @@ -105,7 +108,14 @@ export default {
return false;
}
return true;
});
});
},
visibleHeadcountsReports(reports) {
const activeReports = this.getActiveReports(reports);
return this.isMigratedCollection() ? activeReports.filter((report) => report.label !== 'Refugee Enroled Headcounts and FTEs') : activeReports;
},
isMigratedCollection() { //we don't show refugee reports for collections before EDX go live
return LocalDateTime.parse(this.collectionObject?.createDate).toLocalDate().isBefore(LocalDate.parse(this.config.SLD_MIGRATION_DATE));
},
setOriginalReportTab(){
if(this.hasAccessToPublicReports()){
Expand Down
Loading

0 comments on commit 39db91e

Please sign in to comment.