Skip to content

Commit

Permalink
Merge pull request #2097 from bcgov/feature/EAC-8
Browse files Browse the repository at this point in the history
Changes to eliminate the TopN logic + spell fix for proficiency.
  • Loading branch information
eckermania authored Nov 14, 2024
2 parents 4f8a69b + 790f9fd commit b7842ac
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
3 changes: 3 additions & 0 deletions backend/src/components/eas/eas.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down
4 changes: 2 additions & 2 deletions backend/src/components/eas/studentFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ 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 {
searchCriteriaList.push({ key: 'proficiencyScore', value:0, operation: FILTER_OPERATION.EQUAL, valueType: VALUE_TYPE.INTEGER, condition: CONDITION.AND });
}
}

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 });
}

Expand Down
5 changes: 2 additions & 3 deletions frontend/src/components/assessments/AssessmentSessions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export default {
},
data() {
return {
topN: 4,
schoolYear: null,
search: null,
itemsPerPage: 5,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
});

Expand All @@ -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
}
});

0 comments on commit b7842ac

Please sign in to comment.