Skip to content
Snippets Groups Projects
Commit deab1a43 authored by Isaac Evavold's avatar Isaac Evavold
Browse files

ROENROLL-1545 show message when clicking on no-longer-offered course

parent 7265117d
No related branches found
No related tags found
No related merge requests found
<div
class="course-item {{ disabled ? 'disabled' : '' }} {{ status | lowercase }}"
class="course-item {{ disabled ? 'disabled' : '' }} {{ status }}"
isFocusable="true"
isTabbable="true"
tabindex="0"
......@@ -53,6 +53,14 @@
matTooltipPosition="above">
error
</i>
<i
*ngSwitchCase="'NoLongerOffered'"
class="material-icons not-offered-icon"
alt="Course no longer offered icon"
matTooltip="Course no longer offered"
matTooltipPosition="above">
remove
</i>
</span>
</div>
</div>
......
......@@ -16,7 +16,8 @@
transition: border-color 0.25s ease, box-shadow 0.25s ease;
cursor: pointer;
&.notofferedinterm {
&.NotOfferedInTerm,
&.NoLongerOffered {
border-color: map-get($uw-accent, 600);
}
......
import { Component, Input, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material';
import { MatDialog, MatSnackBar } from '@angular/material';
import { Store, select } from '@ngrx/store';
import { Observable } from 'rxjs';
import * as utils from '@app/degree-planner/shared/utils';
......@@ -58,6 +58,7 @@ export class CourseItemComponent implements OnInit {
public dialog: MatDialog,
private store: Store<GlobalState>,
private constants: ConstantsService,
private snackBar: MatSnackBar,
) {}
ngOnInit() {
......@@ -84,6 +85,8 @@ export class CourseItemComponent implements OnInit {
this.status = 'InProgress';
} else if (isNotOffered) {
this.status = 'NotOfferedInTerm';
} else if (isNoLongerOffered) {
this.status = 'NoLongerOffered';
} else {
this.status = 'Normal';
}
......@@ -316,7 +319,13 @@ export class CourseItemComponent implements OnInit {
}
openCourseDetailsDialog() {
const { subjectCode, courseId } = this.course;
const { subjectCode, courseId, catalogNumber } = this.course;
if (this.course.studentEnrollmentStatus === 'DOESNOTEXIST') {
const { short } = this.constants.subjectDescription(subjectCode);
this.snackBar.open(`'${short} ${catalogNumber}' no longer offered`);
return;
}
this.api
.getCourseDetails(subjectCode, courseId)
.subscribe(courseDetails => {
......
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