Skip to content

Commit

Permalink
Merge pull request #2144 from bcgov/feature/monitoring
Browse files Browse the repository at this point in the history
Changes to monitoring screens for historical.
  • Loading branch information
SodhiA1 authored Dec 6, 2024
2 parents 74df232 + 54b52c3 commit a3f244e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
20 changes: 20 additions & 0 deletions frontend/src/components/data-collection/DistrictMonitoring.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,32 @@ export default defineComponent({
});
await sdcCollectionStore().getDistrictCollectionStatusCodeMap();
this.getSdcDistrictCollectionMonitoring();
this.setHistoricalHeaders();
},
methods: {
openDistrictContacts(districtId) {
let route = this.$router.resolve({name: 'districtDetails', query: {contact: true}, params: {districtID: districtId}});
window.open(route.href, '_blank');
},
setHistoricalHeaders(){
if(this.isHistoricalCollection()){
this.headers = [
{
title: 'District',
align: 'start',
key: 'districtTitle'
},
{
title: 'Contact',
align: 'start',
key: 'contact'
}
];
}
},
isHistoricalCollection(){
return this.collectionObject?.collectionStatusCode === 'COMPLETED';
},
async getSdcDistrictCollectionMonitoring() {
this.isLoading = true;
await ApiService.apiAxios.get(`${Routes.sdc.BASE_URL}/collection/${this.collectionObject.collectionID}/sdcDistrictCollectionMonitoring`, {
Expand Down
24 changes: 23 additions & 1 deletion frontend/src/components/data-collection/IndySchoolMonitoring.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</v-col>
</v-row>
<v-row
v-else
v-else-if="!isHistoricalCollection()"
class="mt-n6"
>
<v-spacer />
Expand Down Expand Up @@ -168,6 +168,7 @@
</v-navigation-drawer>
<v-row
v-if="!isLoading"
:class="isHistoricalCollection() ? 'mt-2' : ''"
justify="end"
no-gutters
>
Expand Down Expand Up @@ -417,11 +418,32 @@ export default defineComponent({
});
this.schoolCollectionStatusCodes = await sdcCollectionStore().getSchoolCollectionStatusCodeMap();
this.getSdcSchoolCollections();
this.setHistoricalHeaders();
},
methods: {
applyFilters($event) {
this.filters = cloneDeep($event);
},
setHistoricalHeaders(){
if(this.isHistoricalCollection()){
this.headers = [
{
title: 'School',
align: 'start',
key: 'schoolTitle',
value: item => { return { title: item.schoolTitle, sdcSchoolCollectionId: item.sdcSchoolCollectionId }; }
},
{
title: 'Contact',
align: 'center',
key: 'contact'
}
];
}
},
isHistoricalCollection(){
return this.collectionObject?.collectionStatusCode === 'COMPLETED';
},
openSchoolContacts(schoolId) {
let route = this.$router.resolve({name: 'schoolDetails', query: {contact: true}, params: {schoolID: schoolId}});
window.open(route.href, '_blank');
Expand Down

0 comments on commit a3f244e

Please sign in to comment.