Skip to content
Snippets Groups Projects
Commit 5ae86ac9 authored by Scott Berg's avatar Scott Berg
Browse files

Update loadTermsForPlan to use ActiveTermCodes instead of ActiveTerms

parent 5e6cb2a8
No related branches found
No related tags found
No related merge requests found
Pipeline #31972 passed
......@@ -59,7 +59,7 @@ export class DegreePlanEffects {
}),
// Wrap data in an Action for dispatch
map(stdin => new InitialPlanLoadResponse({...stdin, activeTermsCodes: []}))
map(stdin => new InitialPlanLoadResponse(stdin))
);
@Effect()
......@@ -141,11 +141,11 @@ export class DegreePlanEffects {
};
});
const activeTerms = uniqueTermCodes.filter(termCode => {
const activeTermCodes = uniqueTermCodes.filter(termCode => {
return termCode >= currentTerms[0].termCode;
});
return Object.assign({}, stdin, { visibleTerms }, { activeTerms });
return Object.assign({}, stdin, { visibleTerms }, { activeTermCodes });
})
);
}
......
......@@ -68,7 +68,7 @@ export const getDropZones = createSelector(
(state: DegreePlannerState) => {
return [
'saved-courses',
...state.activeTermsCodes.map(termCode => {
...state.activeTermCodes.map(termCode => {
return `term-${termCode}`;
})
];
......
......@@ -8,7 +8,7 @@ export interface DegreePlannerState {
visibleRoadmapId?: number;
visibleTerms: PlannedTerm[];
savedForLaterCourses: SavedForLaterCourse[];
activeTermsCodes: string[];
activeTermCodes: string[];
allDegreePlans: DegreePlan[];
}
......@@ -16,6 +16,6 @@ export const INITIAL_DEGREE_PLANNER_STATE: DegreePlannerState = {
visibleRoadmapId: undefined,
visibleTerms: [],
savedForLaterCourses: [],
activeTermsCodes: [],
activeTermCodes: [],
allDegreePlans: []
};
......@@ -52,8 +52,6 @@ export class TermContainerComponent implements OnInit {
this.isActiveTerm$ = this.store.pipe(select(isActiveTerm(this.term.termCode)));
}
// this.dropZones$ = this.store.pipe(select(getDropZones));
public openAddSidenav(): void {
this.sidenavService.open();
}
......@@ -80,57 +78,9 @@ export class TermContainerComponent implements OnInit {
return;
}
console.log(to);
console.log(from);
console.log(id);
// console.log(to);
// console.log(from);
// console.log(id);
this.store.dispatch(new ChangeCourseTermRequest({ to, from, id }));
// // Get the course JSON
// const item = event.item.data;
// console.log(event);
// const newTermCode = event.container.id.substr(5, 4);
// if (
// event.previousContainer.id === 'saved-courses' &&
// event.container.id !== 'saved-courses'
// ) {
// // If moving from favorites to term
// container.data.push(item);
// previousContainer.data.splice(previousIndex, 1);
// this.dataService
// .addCourse(
// this.degreePlannerDataSvc.getPlanId(),
// event.item.data.subjectCode,
// event.item.data.courseId,
// newTermCode
// )
// .subscribe(data => {
// const yearCode = newTermCode.substring(0, 3);
// const termCode = newTermCode.substring(3);
// });
// this.dataService
// .removeFavoriteCourse(
// event.item.data.subjectCode,
// event.item.data.courseId
// )
// .subscribe();
// } else if (event.previousContainer.id !== event.container.id) {
// container.data.push(item);
// previousContainer.data.splice(previousIndex, 1);
// // Tell the API this course updated
// this.dataService
// .updateCourseTerm(
// this.degreePlannerDataSvc.getPlanId(),
// event.item.data.id,
// newTermCode
// )
// .subscribe();
// }
// Do nothing on drop to same term
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment