LP1849212: Grid improvements
authorJane Sandberg <sandbej@linnbenton.edu>
Wed, 26 Aug 2020 18:30:02 +0000 (11:30 -0700)
committerGalen Charlton <gmc@equinoxinitiative.org>
Mon, 14 Sep 2020 22:17:28 +0000 (18:17 -0400)
- Correcting some grid column labels
- Correcting ViewChild static flags, allowing grid refresh
- Also, remove the static: false flag, since it is no longer necessary

Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-list.component.html
Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-list.component.ts

index e8e470a..13f9932 100644 (file)
@@ -28,8 +28,8 @@
           </eg-grid-toolbar-action>
           <eg-grid-column label="ID" path="id" [index]=true [hidden]="true" i18n-label></eg-grid-column>
           <eg-grid-column label="Terms taught" name="terms_map" i18n-label [cellTemplate]="termMapLink"></eg-grid-column>
-          <eg-grid-column label="Title" name="name" i18n-label></eg-grid-column>
-          <eg-grid-column label="CourseNumber" name="course_number" i18n-label></eg-grid-column>
+          <eg-grid-column label="Course Name" name="name" i18n-label></eg-grid-column>
+          <eg-grid-column label="Course Number" name="course_number" i18n-label></eg-grid-column>
           <eg-grid-column label="Section Number" name="section_number" i18n-label></eg-grid-column>
           <eg-grid-column label="Is Archived?" name="is_archived" i18n-label datatype="bool"></eg-grid-column>
         </eg-grid>
index 8459935..4bcca82 100644 (file)
@@ -1,4 +1,4 @@
-import {Component, Input, ViewChild, OnInit} from '@angular/core';
+import {Component, Input, ViewChild, OnInit, AfterViewInit} from '@angular/core';
 import {Router} from '@angular/router';
 import {IdlObject} from '@eg/core/idl.service';
 import {PcrudService} from '@eg/core/pcrud.service';
@@ -21,14 +21,14 @@ import {CourseAssociateUsersComponent
     templateUrl: './course-list.component.html'
 })
 
-export class CourseListComponent implements OnInit {
+export class CourseListComponent implements OnInit, AfterViewInit {
 
     @ViewChild('editDialog', { static: true }) editDialog: FmRecordEditorComponent;
-    @ViewChild('grid', { static: true }) grid: GridComponent;
+    @ViewChild('grid') grid: GridComponent;
     @ViewChild('successString', { static: true }) successString: StringComponent;
-    @ViewChild('createString', { static: false }) createString: StringComponent;
-    @ViewChild('createErrString', { static: false }) createErrString: StringComponent;
-    @ViewChild('updateFailedString', { static: false }) updateFailedString: StringComponent;
+    @ViewChild('createString') createString: StringComponent;
+    @ViewChild('createErrString') createErrString: StringComponent;
+    @ViewChild('updateFailedString') updateFailedString: StringComponent;
     @ViewChild('deleteFailedString', { static: true }) deleteFailedString: StringComponent;
     @ViewChild('deleteSuccessString', { static: true }) deleteSuccessString: StringComponent;
     @ViewChild('archiveFailedString', { static: true }) archiveFailedString: StringComponent;
@@ -57,6 +57,9 @@ export class CourseListComponent implements OnInit {
 
     ngOnInit() {
         this.getSource();
+    }
+
+    ngAfterViewInit() {
         this.grid.onRowActivate.subscribe((course: IdlObject) => {
             const idToEdit = course.id();
             this.navigateToCoursePage(idToEdit);