LP1849212: fixes to course associate fields and grid
authorJane Sandberg <sandbej@linnbenton.edu>
Sat, 1 Aug 2020 05:41:21 +0000 (22:41 -0700)
committerJane Sandberg <sandbej@linnbenton.edu>
Mon, 7 Sep 2020 18:11:26 +0000 (11:11 -0700)
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-material.component.html
Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-material.component.ts

index 724545a..242357b 100644 (file)
                   placeholder="e.g. Required" class="flex-grow-1" />
               </div>
             </div>
-            <div class="d-flex" [ngClass]="isDialog() ? 'col-md-6' : 'col-md-12 mt-3'">
-              <div class="input-group">
-                <div class="input-group-prepend">
-                  <span class="input-group-text" i18n>Relationship</span>
-                </div>
-                <input type="text" [(ngModel)]="relationshipInput"
-                  [disabled]="currentCourse && currentCourse.is_archived() == 't'" placeholder-i18n
-                  placeholder="e.g. Required" class="flex-grow-1" />
-              </div>
-            </div>
             <eg-marc-simplified-editor (xmlRecordEvent)="associateBriefRecord($event)" buttonLabel="Add material" i18n-buttonLabel>
               <eg-marc-simplified-editor-field tag="245" subfield="a"></eg-marc-simplified-editor-field>
               <eg-marc-simplified-editor-field tag="856" subfield="u"></eg-marc-simplified-editor-field>
               <div class="d-flex" [ngClass]="isDialog() ? 'col-md-6' : 'col-md-12 mt-3'">
                 <div class="input-group">
                   <div class="input-group-prepend">
-                    <span class="input-group-text" i18n>Relationship</span>
+                    <label for="bib-id" class="input-group-text" i18n>Bibliographic Record ID</label>
                   </div>
-                  <input type="text" [(ngModel)]="relationshipInput"
+                  <input type="text" [(ngModel)]="bibId" id="bib-id"
                     [disabled]="currentCourse && currentCourse.is_archived() == 't'" class="flex-grow-1" />
                 </div>
               </div>
               <div class="d-flex" [ngClass]="isDialog() ? 'col-md-6' : 'col-md-12 mt-3'">
                 <div class="input-group">
                   <div class="input-group-prepend">
-                    <label for="bib-id" class="input-group-text" i18n>Bibliographic Record ID</label>
+                    <span class="input-group-text" i18n>Relationship</span>
                   </div>
-                  <input type="text" [(ngModel)]="bibId" id="bib-id"
+                  <input type="text" [(ngModel)]="relationshipInput"
                     [disabled]="currentCourse && currentCourse.is_archived() == 't'" class="flex-grow-1" />
                 </div>
               </div>
       </ngb-tabset>
 
       <div class="mt-3" [ngClass]="isDialog() ? 'col-md-12' : 'col-md-8'">
-        <eg-grid #materialsGrid [dataSource]="materialsDataSource">
+        <eg-grid #materialsGrid [dataSource]="materialsDataSource" [useLocalSort]="true">
           <eg-grid-toolbar-action label="Remove Selected" i18n-label (onClick)="deleteSelectedMaterials($event)">
           </eg-grid-toolbar-action>
           <eg-grid-toolbar-action label="Edit Selected" i18n-label (onClick)="editSelectedMaterials($event)">
           </eg-grid-toolbar-action>
           <eg-grid-column path="id" [index]=true [hidden]="true" label="ID" i18n-label></eg-grid-column>
-          <eg-grid-column label="Barcode" i18n-label name="card" [cellTemplate]="barcodeCellTemplate"></eg-grid-column>
-          <eg-grid-column label="Title" i18n-label name="title" [cellTemplate]="titleCellTemplate"></eg-grid-column>
+          <eg-grid-column label="Barcode" i18n-label name="barcode" [cellTemplate]="barcodeCellTemplate"></eg-grid-column>
+          <eg-grid-column label="Title" i18n-label name="title" flex="3" [cellTemplate]="titleCellTemplate"></eg-grid-column>
           <eg-grid-column path="call_number.label" label="Call Number" i18n-label></eg-grid-column>
           <eg-grid-column path="call_number.prefix.label" [hidden]="true" label="Call Number Prefix" i18n-label hidden>
           </eg-grid-column>
index 5fdd404..541ea1a 100644 (file)
@@ -28,7 +28,7 @@ export class CourseAssociateMaterialComponent extends DialogComponent implements
     @Input() displayMode: String;
     materials: any[] = [];
     @ViewChild('editDialog', { static: true }) editDialog: FmRecordEditorComponent;
-    @ViewChild('materialsGrid', {static: true}) materialsGrid: GridComponent;
+    @ViewChild('materialsGrid', {static: false}) materialsGrid: GridComponent;
     @ViewChild('materialDeleteFailedString', { static: true })
         materialDeleteFailedString: StringComponent;
     @ViewChild('materialDeleteSuccessString', { static: true })