diff --git a/backend/src/components/sdc/sdc.js b/backend/src/components/sdc/sdc.js index 57d87751c..52c14136a 100644 --- a/backend/src/components/sdc/sdc.js +++ b/backend/src/components/sdc/sdc.js @@ -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: { @@ -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); diff --git a/backend/src/config/index.js b/backend/src/config/index.js index 82e64b42c..23f76a379 100644 --- a/backend/src/config/index.js +++ b/backend/src/config/index.js @@ -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, diff --git a/backend/src/routes/config.js b/backend/src/routes/config.js index 3437d0309..096bd0da7 100644 --- a/backend/src/routes/config.js +++ b/backend/src/routes/config.js @@ -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); } diff --git a/backend/src/routes/sdc.js b/backend/src/routes/sdc.js index eabe68a5e..d6ec961fb 100644 --- a/backend/src/routes/sdc.js +++ b/backend/src/routes/sdc.js @@ -54,6 +54,7 @@ router.get('/collection/:collectionID/sdcSchoolCollections', passport.authentica router.get('/collection/:collectionID/sdcDistrictCollections', passport.authenticate('jwt', {session: false}, undefined), permUtils.checkUserHasPermission(PERMISSION.STUDENT_DATA_COLLECTION), extendSession, permUtils.isValidUUIDParam('collectionID'), getSdcDistrictCollections); //student +router.get('/sdcSchoolCollectionStudent/byAssignedStudentID', passport.authenticate('jwt', {session: false}, undefined), permUtils.checkUserHasPermission(PERMISSION.STUDENT_DATA_COLLECTION), extendSession, permUtils.isValidUUIDQueryParam('assignedStudentID'), getSDCSchoolCollectionStudentPaginated); router.get('/sdcSchoolCollectionStudent/:sdcSchoolCollectionStudentID', passport.authenticate('jwt', {session: false}, undefined), permUtils.checkUserHasPermission(PERMISSION.STUDENT_DATA_COLLECTION), extendSession, permUtils.isValidUUIDParam('sdcSchoolCollectionStudentID'), getSDCSchoolCollectionStudentDetail); router.post('/sdcSchoolCollectionStudent/:sdcSchoolCollectionStudentID/update-pen/:penCode', passport.authenticate('jwt', {session: false}, undefined), permUtils.checkUserHasPermission(PERMISSION.STUDENT_DATA_COLLECTION), extendSession, updateStudentPEN); diff --git a/frontend/src/components/common/CompareDemographicModal.vue b/frontend/src/components/common/CompareDemographicModal.vue index 5566bbda0..8fad42347 100644 --- a/frontend/src/components/common/CompareDemographicModal.vue +++ b/frontend/src/components/common/CompareDemographicModal.vue @@ -11,13 +11,13 @@ text="Compare" icon="mdi-content-copy" :disabled="disabled" - @click-action="compare" :bind="props" + @click-action="compare" /> + + + @@ -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 }, @@ -94,6 +140,7 @@ export default { required: true } }, + emits: ['update:selectedRecords','closeCompare'], data() { return { compareModalOpen: false, @@ -101,6 +148,7 @@ export default { }; }, computed: { + ...mapState(appStore, ['config']), studentRecords: { get: function() { return this.selectedRecords; @@ -108,6 +156,9 @@ export default { set: function(value) { this.$emit('update:selectedRecords', value); } + }, + useEdxRelease() { + return this.config.ENABLE_EDX_RELEASE; } }, created() { diff --git a/frontend/src/components/common/CompareDemographicsCommonV2.vue b/frontend/src/components/common/CompareDemographicsCommonV2.vue new file mode 100644 index 000000000..4cd90e1bc --- /dev/null +++ b/frontend/src/components/common/CompareDemographicsCommonV2.vue @@ -0,0 +1,1125 @@ + -