LP#1779158 Queued record page / marc html
authorBill Erickson <berickxx@gmail.com>
Tue, 10 Jul 2018 16:46:53 +0000 (12:46 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 11 Oct 2018 18:56:30 +0000 (14:56 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue-record.component.html [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue-record.component.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue.component.html
Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue.component.ts
Open-ILS/src/eg2/src/app/staff/cat/vandelay/routing.module.ts
Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.module.ts

diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue-record.component.html b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue-record.component.html
new file mode 100644 (file)
index 0000000..de55343
--- /dev/null
@@ -0,0 +1,9 @@
+
+<ngb-tabset #recordTabs [activeId]="recordTab" (tabChange)="onTabChange($event)">
+       <ngb-tab title="Record HTML" i18n-title id="marc_html">
+               <ng-template ngbTabContent>
+      <eg-marc-html [recordId]="recordId" [recordType]="'vandelay-'+queueType">
+      </eg-marc-html>
+               </ng-template>
+       </ngb-tab>
+</ngb-tabset>
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue-record.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue-record.component.ts
new file mode 100644 (file)
index 0000000..abc12b8
--- /dev/null
@@ -0,0 +1,32 @@
+import {Component, OnInit, ViewChild} from '@angular/core';
+import {Router, ActivatedRoute, ParamMap} from '@angular/router';              
+
+@Component({
+  /*
+  template: `
+    <eg-marc-html [recordId]="recordId" [recordType]="recordType">
+    </eg-marc-html>
+    `
+    */
+  templateUrl: 'queue-record.component.html'
+})
+export class QueueRecordComponent {
+
+    queueId: number;
+    queueType: string;
+    recordId: number;
+    recordTab: string;
+
+    constructor(
+        private router: Router,
+        private route: ActivatedRoute) {
+
+        this.route.paramMap.subscribe((params: ParamMap) => {                  
+            this.queueId = +params.get('id');
+            this.recordId = +params.get('recordId');
+            this.queueType = params.get('qtype');
+            this.recordTab = params.get('recordType');
+        });
+    }
+}
+
index 8ea700c..0393355 100644 (file)
   </div>
 </ng-container>
 
-<ng-template #viewMarcTmpl let-row="row">
-  <!-- TODO click -->
-  <a href i18n>TODO</a>
-</ng-template>
-
 <ng-template #matchesTmpl let-row="row">
   <!-- TODO click -->
   <a href i18n>TODO</a>
@@ -118,6 +113,7 @@ because there are a lot of them.
 -->
 
 <eg-grid #queueGrid [dataSource]="queueSource"
+  (onRowActivate)="openRecord($event)"
   hideFields="language,pagination,price,rec_identifier,eg_tcn_source,eg_identifier,item_barcode,zsource">
 
   <eg-grid-toolbar-checkbox i18n-label label="Limit to Records With Matches"
@@ -131,8 +127,6 @@ because there are a lot of them.
 
   <eg-grid-column name="id" [index]="true" 
     [hidden]="true"></eg-grid-column>
-  <eg-grid-column i18n-label label="View MARC" 
-    name="+viewMarc" [cellTemplate]="viewMarcTmpl"></eg-grid-column>
   <eg-grid-column i18n-label label="Matches" 
     name="+matches" [cellTemplate]="matchesTmpl"></eg-grid-column>
   <eg-grid-column name="import_error" i18n-label 
index 600ef25..d2ec377 100644 (file)
@@ -86,6 +86,12 @@ export class QueueComponent implements AfterViewInit {
         }
     }
 
+    openRecord(row: any) {
+        const url = 
+          `/staff/cat/vandelay/queue/${this.queueType}/${this.queueId}/record/${row.id}/marc`;
+        this.router.navigate([url]);
+    }
+
     applyQueueType() {
         this.queuedRecClass = this.queueType.match(/bib/) ? 'vqbr' : 'vqar';
         this.vandelay.getAttrDefs(this.queueType).then(
index 4d08569..2f23f98 100644 (file)
@@ -4,6 +4,7 @@ import {VandelayComponent} from './vandelay.component';
 import {ImportComponent} from './import.component';
 import {ExportComponent} from './export.component';
 import {QueueComponent} from './queue.component';
+import {QueueRecordComponent} from './queue-record.component';
 import {QueueListComponent} from './queue-list.component';
 
 const routes: Routes = [{
@@ -25,6 +26,12 @@ const routes: Routes = [{
   }, {
     path: 'queue/:qtype/:id',
     component: QueueComponent
+  }, {
+    path: 'queue/:qtype/:id/record/:recordId',
+    component: QueueRecordComponent
+  }, {
+    path: 'queue/:qtype/:id/record/:recordId/:recordTab',
+    component: QueueRecordComponent
   }]
 }];
 
index aed9845..dba5324 100644 (file)
@@ -7,9 +7,9 @@ import {ImportComponent} from './import.component';
 import {ExportComponent} from './export.component';
 import {QueueComponent} from './queue.component';
 import {QueueListComponent} from './queue-list.component';
+import {QueueRecordComponent} from './queue-record.component';
 import {GridModule} from '@eg/share/grid/grid.module';
 import {HttpClientModule} from '@angular/common/http';
-import {RecordBucketDialogComponent} from '@eg/staff/share/buckets/record-bucket-dialog.component';
 
 @NgModule({
   declarations: [
@@ -18,7 +18,7 @@ import {RecordBucketDialogComponent} from '@eg/staff/share/buckets/record-bucket
     ExportComponent,
     QueueComponent,
     QueueListComponent,
-    RecordBucketDialogComponent
+    QueueRecordComponent
   ],
   imports: [
     StaffCommonModule,