Skip to content

Commit

Permalink
Adds AT for district monitoring screen
Browse files Browse the repository at this point in the history
Allows AT setup with two or more SdcSchoolCollections
  • Loading branch information
mightycox committed May 1, 2024
1 parent 05dc483 commit 57da659
Show file tree
Hide file tree
Showing 24 changed files with 602 additions and 380 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
>
<v-col class="column-data">
<div>Have Data</div>
<span>
<span id="hasUploadedValue">
{{ monitorSdcSchoolCollectionsResponse?.schoolsWithData }}
</span>
</v-col>
Expand All @@ -39,7 +39,7 @@
/>
<v-col class="column-data">
<div>Missing Data</div>
<span>
<span id="missingUploadedValue">
{{
monitorSdcSchoolCollectionsResponse?.totalSchools - monitorSdcSchoolCollectionsResponse?.schoolsWithData
}}
Expand Down Expand Up @@ -69,7 +69,7 @@
<v-icon color="#d90606">
mdi-alert-circle-outline
</v-icon>
<span>
<span id="dataErrorValue">
{{ monitorSdcSchoolCollectionsResponse?.totalErrors }}
</span>
</v-col>
Expand All @@ -82,7 +82,7 @@
<v-icon color="orange">
mdi-alert-outline
</v-icon>
<span>
<span id="dataFundingWarnValue">
{{ monitorSdcSchoolCollectionsResponse?.totalFundingWarnings }}
</span>
</v-col>
Expand All @@ -95,7 +95,7 @@
<v-icon color="blue">
mdi-alert-circle-outline
</v-icon>
<span>
<span id="dataInfoWarnValue">
{{ monitorSdcSchoolCollectionsResponse?.totalInfoWarnings }}
</span>
</v-col>
Expand All @@ -120,7 +120,7 @@
>
<v-col class="column-data">
<div>Confirmed</div>
<span>
<span id="detailsConfirmedValue">
{{ monitorSdcSchoolCollectionsResponse?.schoolsDetailsConfirmed }}
</span>
</v-col>
Expand All @@ -130,7 +130,7 @@
/>
<v-col class="column-data">
<div>Not Confirmed</div>
<span>
<span id="detailsNotConfirmedValue">
{{
monitorSdcSchoolCollectionsResponse?.totalSchools - monitorSdcSchoolCollectionsResponse?.schoolsDetailsConfirmed
}}
Expand All @@ -157,7 +157,7 @@
>
<v-col class="column-data">
<div>Confirmed</div>
<span>
<span id="contactConfirmedValue">
{{ monitorSdcSchoolCollectionsResponse?.schoolsContactsConfirmed }}
</span>
</v-col>
Expand All @@ -167,7 +167,7 @@
/>
<v-col class="column-data">
<div>Not Confirmed</div>
<span>
<span id="noContactConfirmedValue">
{{
monitorSdcSchoolCollectionsResponse?.totalSchools - monitorSdcSchoolCollectionsResponse?.schoolsContactsConfirmed
}}
Expand All @@ -194,7 +194,7 @@
>
<v-col class="column-data">
<div>Submitted</div>
<span>
<span id="submittedValue">
{{ monitorSdcSchoolCollectionsResponse?.schoolsSubmitted }}
</span>
</v-col>
Expand All @@ -204,7 +204,7 @@
/>
<v-col class="column-data">
<div>Not Submitted</div>
<span>
<span id="notSubmittedValue">
{{
monitorSdcSchoolCollectionsResponse?.totalSchools - monitorSdcSchoolCollectionsResponse?.schoolsSubmitted
}}
Expand Down Expand Up @@ -271,12 +271,14 @@
</v-btn>
</v-row>
<v-data-table
id="monitoring-table"
:headers="headers"
:items="filteredItems"
items-per-page="-1"
>
<template #item.schoolTitle="{ value }">
<router-link
class="linkToSdcSchoolCollection"
:to="{ name: 'sdcCollection', params: { schoolCollectionID: value.sdcSchoolCollectionId }}"
target="_blank"
>
Expand Down Expand Up @@ -324,7 +326,7 @@
</v-data-table>
<v-row justify="end">
<PrimaryButton
id="step-2-next-button-school"
id="step-2-next-button-district"
class="mr-3 mt-4 mb-3"
icon="mdi-check"
text="Next"
Expand All @@ -337,10 +339,11 @@
justify="end"
class="my-0"
>
<p class="form-hint mr-3">
{{ monitorSdcSchoolCollectionsResponse?.totalSchools - monitorSdcSchoolCollectionsResponse?.schoolsSubmitted }}
schools not
submitted
<p
id="schoolNotSubmittedWarning"
class="form-hint mr-3"
>
{{ getWarningText() }}
</p>
</v-row>
</template>
Expand All @@ -349,12 +352,13 @@ import {defineComponent} from 'vue';
import ApiService from '../../../common/apiService';
import {ApiRoutes} from '../../../utils/constants';
import {setFailureAlert} from '../../composable/alertComposable';
import {formatDate, formatDateTime} from '../../../utils/format';
import PrimaryButton from '../../util/PrimaryButton.vue';
import Filters from '../../common/Filters.vue';
import {cloneDeep} from 'lodash';
import Spinner from '../../common/Spinner.vue';
import {MONITORING} from '../../../utils/sdc/DistrictCollectionTableConfiguration';
import {DateTimeFormatter, LocalDateTime} from '@js-joda/core';
export default defineComponent({
name: 'StepTwoMonitor',
components: {Spinner, Filters, PrimaryButton},
Expand Down Expand Up @@ -498,8 +502,14 @@ export default defineComponent({
return uploadDataFilter.length === 0 || uploadDataFilter.every(filter => filterFunctions[filter.value]?.());
},
formatDateTime,
formatDate,
formatDate(inputDate) {
const date = LocalDateTime.parse(inputDate);
return date.format(DateTimeFormatter.ofPattern('yyyy/MM/dd'));
},
formatDateTime(inputDateTime) {
const dateTime = LocalDateTime.parse(inputDateTime);
return dateTime.format(DateTimeFormatter.ofPattern('yyyy/MM/dd HH:mm:ss'));
},
async getSdcSchoolCollections(){
this.isLoading = true;
await ApiService.apiAxios.get(`${ApiRoutes.sdc.SDC_DISTRICT_COLLECTION}/${this.$route.params.sdcDistrictCollectionID}/sdcSchoolCollectionMonitoring`, {
Expand All @@ -512,6 +522,13 @@ export default defineComponent({
this.isLoading = false;
});
},
getWarningText() {
const numSchoolsNotSubmitted = this.monitorSdcSchoolCollectionsResponse?.totalSchools - this.monitorSdcSchoolCollectionsResponse?.schoolsSubmitted;
if(numSchoolsNotSubmitted === 1) {
return '1 school not submitted';
}
return numSchoolsNotSubmitted + ' schools not submitted';
},
markStepAsComplete(){
let updateCollection = {
districtCollection: this.districtCollectionObject,
Expand Down
17 changes: 12 additions & 5 deletions tests-e2e/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import {UserSetupUtils} from './cypress/helpers/user-set-up-utils';
import {defineConfig} from 'cypress';
import { InstituteOptions, SchoolOptions } from './cypress/services/institute-api-service';
import { UserActivationUtils } from './cypress/helpers/user-activation-utils';
import { SchoolCollectionOptions } from './cypress/services/sdc-collection-api-service';
import axios from 'axios';
import * as fs from 'fs';
import * as path from 'path';
import {SchoolCollectionOptions, DistrictCollectionOptions} from './cypress/services/sdc-collection-api-service';

export type AppSetupData = {school: SchoolEntity, district: DistrictEntity};
export type AppSetupData = {schools: SchoolEntity[], district: DistrictEntity};
const loadAppSetupData = (
config: Cypress.PluginConfigOptions,
options?: InstituteOptions
Expand All @@ -21,14 +21,15 @@ const loadAppSetupData = (
includeDistrictAddress: true,
withPrimaryActivationCode: true
},
schoolOptions: {
schoolOptions: [{
includeTombstoneValues: true,
includeSchoolAddress: true,
includeSchoolContact: true,
schoolStatus: 'Open',
withPrimaryActivationCode: true,
isIndependentSchool: false
}
isIndependentSchool: false,
schoolCode: '99998'
}]
}).then(response => {
if (response){
resolve(response);
Expand Down Expand Up @@ -56,6 +57,9 @@ export default defineConfig({
'dataLoad': async (options: InstituteOptions) => {
return await loadAppSetupData(config, options);
},
'districtDataLoad': async (options: InstituteOptions) => {
return await loadAppSetupData(config, options);
},
'recreate-school': async (schoolOptions: SchoolOptions)=> {
await new InstituteSetupUtils(config).recreateSchool(schoolOptions);
return null;
Expand All @@ -67,6 +71,9 @@ export default defineConfig({
'setup-collections': async (schoolCollection: SchoolCollectionOptions) => {
return new CollectionSetupUtils(config).setUpCollections(schoolCollection);
},
'setup-district-collections': async (districtCollectionOptions: DistrictCollectionOptions) => {
return new CollectionSetupUtils(config).setUpDistrictCollections(districtCollectionOptions);
},
'setup-student-ells': async (ells: SdcStudentEll[]) => {
return new CollectionSetupUtils(config).setUpStudentElls(ells);
},
Expand Down
Loading

0 comments on commit 57da659

Please sign in to comment.