diff --git a/backend/src/components/eas/eas.js b/backend/src/components/eas/eas.js index bd3b49c8..3717fa45 100644 --- a/backend/src/components/eas/eas.js +++ b/backend/src/components/eas/eas.js @@ -11,6 +11,9 @@ async function getAssessmentSessions(req, res) { try { const url = `${config.get('server:eas:assessmentSessionsURL')}`; const data = await getData(url); + data.forEach(session => { + session.isOpen = new Date(session.activeFromDate) <= new Date() && new Date(session.activeUntilDate) >= new Date(); + }); return res.status(200).json(data); } catch (e) { logApiError(e, 'getAssessmentSessions', 'Error occurred while attempting to GET assessment sessions.'); diff --git a/backend/src/components/eas/studentFilters.js b/backend/src/components/eas/studentFilters.js index 72df184c..fe51dcc4 100644 --- a/backend/src/components/eas/studentFilters.js +++ b/backend/src/components/eas/studentFilters.js @@ -56,7 +56,7 @@ function createMoreFiltersSearchCriteria(searchFilter = []) { searchCriteriaList.push({ key: 'provincialSpecialCaseCode', value: pValue.toString(), operation: FILTER_OPERATION.IN, valueType: VALUE_TYPE.STRING, condition: CONDITION.AND }); } - if (key === 'proficienyScore' && pValue) { + if (key === 'proficiencyScore' && pValue) { if(JSON.parse(pValue) === true) { searchCriteriaList.push({ key: 'proficiencyScore', value: 0, operation: FILTER_OPERATION.NOT_EQUAL, valueType: VALUE_TYPE.INTEGER, condition: CONDITION.AND }); } else { @@ -64,7 +64,7 @@ function createMoreFiltersSearchCriteria(searchFilter = []) { } } - if (key === 'proficienyScoreValue' && pValue) { + if (key === 'proficiencyScoreValue' && pValue) { searchCriteriaList.push({ key: 'proficiencyScore', value: pValue.toString(), operation: FILTER_OPERATION.IN, valueType: VALUE_TYPE.INTEGER, condition: CONDITION.AND }); } diff --git a/frontend/src/components/assessments/AssessmentSessions.vue b/frontend/src/components/assessments/AssessmentSessions.vue index 7779ae2c..24399793 100644 --- a/frontend/src/components/assessments/AssessmentSessions.vue +++ b/frontend/src/components/assessments/AssessmentSessions.vue @@ -109,7 +109,6 @@ export default { }, data() { return { - topN: 4, schoolYear: null, search: null, itemsPerPage: 5, @@ -132,7 +131,7 @@ export default { activeSessions() { const orderedSessions = []; const allsessions = this.allsessions - .filter((session, index) => index < this.topN) + .filter(session => session.isOpen) .map((session) => { return { ...session, @@ -147,7 +146,7 @@ export default { }, historicalSessions() { const allsessions = this.allsessions - .filter((session, index) => index >= this.topN) + .filter(session => !session.isOpen) .map((entry) => { return { ...entry, diff --git a/frontend/src/components/assessments/sessions/SessionEdit.vue b/frontend/src/components/assessments/sessions/SessionEdit.vue index 87cbab14..a083046f 100644 --- a/frontend/src/components/assessments/sessions/SessionEdit.vue +++ b/frontend/src/components/assessments/sessions/SessionEdit.vue @@ -24,7 +24,7 @@ v-model="editSession.activeUntilDate" label="Close Date" model-type="yyyy-MM-dd'T'00:00:00" - :rules="[rules.endDateRule(editSession.activeFromDate, editSession.activeUntilDate, 'Close Date cannot be before Open Date'), rules.required()]" + :rules="[rules.endDateRule(editSession.activeFromDate, editSession.activeUntilDate, 'Close date cannot be earlier than the Open date'), rules.required()]" :allow-teleport="true" @update:model-value="validateForm" @clear-date="clearCloseDate" diff --git a/frontend/src/utils/eas/StudentRegistrationTableConfiguration.js b/frontend/src/utils/eas/StudentRegistrationTableConfiguration.js index 2515c6d8..44036115 100644 --- a/frontend/src/utils/eas/StudentRegistrationTableConfiguration.js +++ b/frontend/src/utils/eas/StudentRegistrationTableConfiguration.js @@ -121,8 +121,8 @@ export const SCHOOL_YEAR_REGISTRATIONS_VIEW = Object.freeze( session: SESSION_CODE_FILTER, assessmentTypeCode: ASSESSMENT_TYPE_CODE_FILTER, specialCaseCode: SPECIAL_CASE_FILTER, - proficienyScore: PROFICIENCY_SCORE_FILTER, - proficienyScoreValue: PROFICIENCY_SCORE_RANGE_FILTER + proficiencyScore: PROFICIENCY_SCORE_FILTER, + proficiencyScoreValue: PROFICIENCY_SCORE_RANGE_FILTER } }); @@ -144,8 +144,8 @@ export const SESSION_REGISTRATIONS_VIEW = Object.freeze( session: SESSION_CODE_FILTER, assessmentTypeCode: ASSESSMENT_TYPE_CODE_FILTER, specialCaseCode: SPECIAL_CASE_FILTER, - proficienyScore: PROFICIENCY_SCORE_FILTER, - proficienyScoreValue: PROFICIENCY_SCORE_RANGE_FILTER + proficiencyScore: PROFICIENCY_SCORE_FILTER, + proficiencyScoreValue: PROFICIENCY_SCORE_RANGE_FILTER } });