Skip to content

Commit

Permalink
Merge pull request #1986 from bcgov/feature/EDX-2446
Browse files Browse the repository at this point in the history
EDX-2446 - update sld history page to use new sdc api
  • Loading branch information
SodhiA1 authored Aug 20, 2024
2 parents 79724e3 + 0d9c476 commit f95d5c8
Show file tree
Hide file tree
Showing 15 changed files with 1,845 additions and 391 deletions.
44 changes: 30 additions & 14 deletions backend/src/components/sdc/sdc.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,50 +91,65 @@ async function getSDCSchoolCollectionStudentPaginated(req, res) {
try {
const search = [];

search.push({
condition: null,
searchCriteriaList: [{ key: 'sdcSchoolCollection.collectionEntity.collectionID', value: req.params.collectionID, operation: FILTER_OPERATION.EQUAL, valueType: VALUE_TYPE.UUID }]
});

search.push({
condition: CONDITION.AND,
searchCriteriaList: createSearchCriteria(req.query.searchParams)
});
if(req.params.collectionID) {
search.push({
condition: null,
searchCriteriaList: [{
key: 'sdcSchoolCollection.collectionEntity.collectionID',
value: req.params.collectionID,
operation: FILTER_OPERATION.EQUAL,
valueType: VALUE_TYPE.UUID
}]
});
}
if(req.query.searchParams) {
search.push({
condition: CONDITION.AND,
searchCriteriaList: createSearchCriteria(req.query.searchParams)
});
}

if(req.query.searchParams['tabFilter']) {
if(req.query.searchParams?.['tabFilter']) {
search.push({
condition: CONDITION.AND,
searchCriteriaList: createTabFilter(req.query.searchParams['tabFilter'])
});
}

if (req.query.searchParams['multiFieldName']) {
if (req.query.searchParams?.['multiFieldName']) {
search.push({
condition: CONDITION.AND,
searchCriteriaList: createMultiFieldNameSearchCriteria(req.query.searchParams['multiFieldName'])
});
}
if (req.query.searchParams['penLocalIdNumber']) {
if (req.query.searchParams?.['penLocalIdNumber']) {
search.push({
condition: CONDITION.AND,
searchCriteriaList: createLocalIdPenSearchCriteria(req.query.searchParams['penLocalIdNumber'])
});
}

if (req.query.searchParams['moreFilters']) {
if (req.query.searchParams?.['moreFilters']) {
let criteriaArray = createMoreFiltersSearchCriteria(req.query.searchParams['moreFilters']);
criteriaArray.forEach(criteria => {
search.push(criteria);
});
}

if(req.query.searchParams['assignedPen']) {
if(req.query.searchParams?.['assignedPen']) {
search.push({
condition: CONDITION.AND,
searchCriteriaList: createAssignedPENSearchCriteria(req.query.searchParams['assignedPen'])
});
}

if(req.query.assignedStudentID) {
search.push({
condition: null,
searchCriteriaList: [{ key: 'assignedStudentId', value: req.query.assignedStudentID, operation: FILTER_OPERATION.EQUAL, valueType: VALUE_TYPE.UUID }]
});
}


const params = {
params: {
Expand Down Expand Up @@ -225,6 +240,7 @@ async function getSDCSchoolCollectionStudentPaginatedSlice(req, res) {
value.schoolName = getSchoolName(school);
value.districtName = getDistrictName(cacheService.getDistrictJSONByDistrictId(school.districtID));
value.districtID = school.districtID;
value.mincode = cacheService.getSchoolBySchoolID(value.schoolID)?.mincode;
});

return res.status(HttpStatus.OK).json(data);
Expand Down
3 changes: 2 additions & 1 deletion backend/src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ nconf.defaults({
bannerColor: process.env.BANNER_COLOR,
webSocketURL: process.env.WEB_SOCKET_URL,
disableSdcFunctionality: process.env.DISABLE_SDC_FUNCTIONALITY === 'true',
edxURL: process.env.EDX_URL
edxURL: process.env.EDX_URL,
enableEdxRelease: process.env.ENABLE_EDX_RELEASE
},
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 @@ -14,7 +14,8 @@ async function getConfig(req, res) {
BANNER_COLOR: frontendConfig.bannerColor,
WEB_SOCKET_URL: frontendConfig.webSocketURL,
DISABLE_SDC_FUNCTIONALITY: frontendConfig.disableSdcFunctionality,
EDX_URL: frontendConfig.edxURL
EDX_URL: frontendConfig.edxURL,
ENABLE_EDX_RELEASE: frontendConfig.enableEdxRelease
};
return res.status(HttpStatus.OK).json(frontConfig);
}
Expand Down
1 change: 1 addition & 0 deletions backend/src/routes/sdc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 54 additions & 3 deletions frontend/src/components/common/CompareDemographicModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
text="Compare"
icon="mdi-content-copy"
:disabled="disabled"
@click-action="compare"
:bind="props"
@click-action="compare"
/>
</template>
<v-card id="requestInfoDialogCard">
<CompareDemographicsCommon
v-if="compareModalOpen"
v-if="compareModalOpen && !useEdxRelease"
v-model:selected-records="studentRecords"
title="Compare/View"
:close-compare-modal="closeCompareModal"
Expand Down Expand Up @@ -59,6 +59,49 @@
/>
</template>
</CompareDemographicsCommon>
<CompareDemographicsCommonV2
v-if="compareModalOpen && useEdxRelease"
v-model:selected-records="studentRecords"
title="Compare/View"
:close-compare-modal="closeCompareModal"
>
<template #actions="{clearError, validateAction, disableMerge, disableDemerge, disableMoveSld, twin, merge, demerge, moveSldRecords}">
<PrimaryButton
id="compareModalCancelBtn"
text="Cancel"
secondary
@click-action="[closeCompareModal(), clearError()]"
/>
<PrimaryButton
id="moveSldBtn"
text="Move Sld Record"
primary
:disabled="disableMoveSld()"
@click-action="moveSldRecords()"
/>
<PrimaryButton
id="twinBtn"
text="Twin"
primary
:disabled="validateAction()"
@click-action="twin()"
/>
<PrimaryButton
id="demergeBtn"
text="Demerge"
primary
:disabled="disableDemerge()"
@click-action="demerge()"
/>
<PrimaryButton
id="mergeBtn"
text="Merge PENs"
primary
:disabled="disableMerge()"
@click-action="merge()"
/>
</template>
</CompareDemographicsCommonV2>
</v-card>
</v-dialog>
</template>
Expand All @@ -70,12 +113,15 @@ import CompareDemographicsCommon from './CompareDemographicsCommon.vue';
import {deepCloneObject} from '@/utils/common';
import alertMixin from '@/mixins/alertMixin';
import staleStudentRecordMixin from '@/mixins/staleStudentRecordMixin';
import CompareDemographicsCommonV2 from '@/components/common/CompareDemographicsCommonV2.vue';
import {mapState} from 'pinia';
import {appStore} from '@/store/modules/app';
export default {
emits: ['update:selectedRecords','closeCompare'],
name: 'CompareDemographicModal',
components: {
CompareDemographicsCommon,
CompareDemographicsCommonV2,
PrimaryButton,
TertiaryButton
},
Expand All @@ -94,20 +140,25 @@ export default {
required: true
}
},
emits: ['update:selectedRecords','closeCompare'],
data() {
return {
compareModalOpen: false,
initialSelectedRecord: []
};
},
computed: {
...mapState(appStore, ['config']),
studentRecords: {
get: function() {
return this.selectedRecords;
},
set: function(value) {
this.$emit('update:selectedRecords', value);
}
},
useEdxRelease() {
return this.config.ENABLE_EDX_RELEASE;
}
},
created() {
Expand Down
Loading

0 comments on commit f95d5c8

Please sign in to comment.