From: Kyle Huckins Date: Tue, 15 Mar 2022 03:10:25 +0000 (+0000) Subject: lp1939994 Course Details Page Archive Workaround X-Git-Url: http://git.equinoxoli.org/?p=evergreen-equinox.git;a=commitdiff_plain;h=faf925ebc4bccf3b5a3836cb6384264d56922a88 lp1939994 Course Details Page Archive Workaround - Course Page stores is_archived() locally, checking for either the current course being archived, or the locally stored variable. Signed-off-by: Kyle Huckins Changes to be committed: modified: Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-material.component.html modified: Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-material.component.ts modified: Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-users.component.html modified: Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-users.component.ts modified: Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-page.component.html modified: Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-page.component.ts Signed-off-by: Jane Sandberg --- diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-material.component.html b/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-material.component.html index aec9838..94f12ee 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-material.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-material.component.html @@ -32,7 +32,7 @@ @@ -42,7 +42,7 @@ Relationship @@ -63,12 +63,12 @@
@@ -82,14 +82,14 @@
@@ -105,14 +105,14 @@
@@ -126,13 +126,13 @@
@@ -141,7 +141,7 @@
- @@ -158,7 +158,7 @@ Relationship
@@ -190,7 +190,7 @@ + [disabled]="currentCourse && (courseIsArchived || currentCourse.is_archived()) == 't'" class="flex-grow-1" />
@@ -199,14 +199,14 @@ Relationship
+ [disabled]="currentCourse && (courseIsArchived || currentCourse.is_archived()) == 't'" class="flex-grow-1" />
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-material.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-material.component.ts index 9a8264c..27c8ecf 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-material.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-material.component.ts @@ -25,6 +25,7 @@ import {CourseService} from '@eg/staff/share/course.service'; export class CourseAssociateMaterialComponent extends DialogComponent implements OnInit { @Input() currentCourse: IdlObject; @Input() courseId: any; + @Input() courseIsArchived: String; @Input() displayMode: String; materials: any[] = []; @ViewChild('editDialog', { static: true }) editDialog: FmRecordEditorComponent; diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-users.component.html b/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-users.component.html index d323638..f7187a5 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-users.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-users.component.html @@ -30,7 +30,7 @@
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-users.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-users.component.ts index d9985fa..772f023 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-users.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-users.component.ts @@ -23,6 +23,7 @@ import {ComboboxEntry} from '@eg/share/combobox/combobox.component'; export class CourseAssociateUsersComponent extends DialogComponent implements OnInit { @Input() currentCourse: IdlObject; @Input() courseId: number; + @Input() courseIsArchived: String; @Input() displayMode: String; users: any[] = []; @ViewChild('editDialog', { static: true }) editDialog: FmRecordEditorComponent; diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-page.component.html b/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-page.component.html index 4936a97..c2177f8 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-page.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-page.component.html @@ -1,16 +1,16 @@ + [bannerStyle]="(courseIsArchived || currentCourse.is_archived()) == 't' ? 'alert-secondary' : null" + [bannerIcon]="(courseIsArchived || currentCourse.is_archived()) == 't' ? 'lock' : null">
@@ -47,7 +47,8 @@ Course materials + [currentCourse]="currentCourse" displayMode="inline" + [courseIsArchived]="courseIsArchived"> @@ -57,7 +58,8 @@ Course users + [currentCourse]="currentCourse" displayMode="inline" + [courseIsArchived]="courseIsArchived"> diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-page.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-page.component.ts index 1bbc487..9ae7709 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-page.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-page.component.ts @@ -17,6 +17,7 @@ export class CoursePageComponent implements OnInit { currentCourse: IdlObject; courseId: any; + courseIsArchived: String; // Materials Tab @ViewChild('courseMaterialDialog', {static: true}) @@ -42,6 +43,8 @@ export class CoursePageComponent implements OnInit { this.courseId = +this.route.snapshot.paramMap.get('id'); this.course.getCourses([this.courseId]).then(course => { this.currentCourse = course[0]; + this.courseIsArchived = course[0].is_archived(); + console.log(this.courseIsArchived); }); } @@ -50,6 +53,7 @@ export class CoursePageComponent implements OnInit { this.course.disassociateMaterials([this.currentCourse]).then(res => { this.currentCourse.is_archived('t'); this.pcrud.update(this.currentCourse).subscribe(val => { + this.courseIsArchived = 't'; console.debug('archived: ' + val); this.archiveSuccessString.current() .then(str => this.toast.success(str));