From 16782451564292687b54f9ed5d2cb9b12463b6eb Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 15 Jun 2020 11:17:37 -0400 Subject: [PATCH] LPXXX Angular Volcopy Signed-off-by: Bill Erickson --- .../app/staff/cat/volcopy/vol-edit.component.html | 2 ++ .../app/staff/cat/volcopy/vol-edit.component.ts | 1 + .../app/staff/cat/volcopy/volcopy.component.html | 2 +- .../src/app/staff/cat/volcopy/volcopy.component.ts | 39 ++++++++++------------ .../src/eg2/src/app/staff/cat/volcopy/volcopy.ts | 14 ++++++++ 5 files changed, 35 insertions(+), 23 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.html b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.html index 3f30820bb4..e4ddab1fa4 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.html @@ -135,6 +135,7 @@
@@ -191,6 +192,7 @@
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.ts index 16a586221e..87d6faffe5 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.ts @@ -206,6 +206,7 @@ export class VolEditComponent implements OnInit { copy.opac_visible('t'); copy.ref('f'); copy.mint_condition('t'); + copy.parts([]); // TODO: status / fast-add / defaults? diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.html b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.html index 97256b1a6d..0de85f8647 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.html @@ -8,7 +8,7 @@ - +
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.ts index 50a1df176c..ec145c632d 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.component.ts @@ -25,16 +25,6 @@ export class VolCopyComponent implements OnInit { context: VolCopyContext; - // Note in multi-record mode this value will be unset. - recordId: number; - - // Load specific call number by ID. - volId: number; - - // Load specific copy by ID. - copyId: number; - - session: string; loading = true; @ViewChild('loadingProgress', {static: false}) loadingProgress: ProgressInlineComponent; @@ -61,10 +51,10 @@ export class VolCopyComponent implements OnInit { } negotiateRoute(params: ParamMap) { - this.recordId = +params.get('record_id') || null; - this.volId = +params.get('vol_id') || null; - this.copyId = +params.get('copy_id') || null; - this.session = params.get('session') || null; + this.context.recordId = +params.get('record_id') || null; + this.context.volId = +params.get('vol_id') || null; + this.context.copyId = +params.get('copy_id') || null; + this.context.session = params.get('session') || null; this.load(); } @@ -87,21 +77,26 @@ export class VolCopyComponent implements OnInit { } setRecordId() { - if (!this.recordId) { + if (!this.context.recordId) { const ids = this.context.getRecordIds(); if (ids.length === 1) { - this.recordId = ids[0]; + this.context.recordId = ids[0]; } } } fetchHoldings(): Promise { - if (this.copyId) { - return this.fetchCopies(this.copyId); - } else if (this.volId) { - return this.fetchVols(this.volId); - } else if (this.recordId) { - return this.fetchRecords(this.recordId); + if (this.context.copyId) { + this.context.sessionType = 'copy'; + return this.fetchCopies(this.context.copyId); + } else if (this.context.volId) { + this.context.sessionType = 'vol'; + return this.fetchVols(this.context.volId); + } else if (this.context.recordId) { + this.context.sessionType = 'record'; + return this.fetchRecords(this.context.recordId); + } else if (this.context.session) { + this.context.sessionType = 'mixed'; } } diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.ts index 891824447e..75d88cdcf2 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.ts @@ -24,6 +24,20 @@ export class VolCopyContext { holdings: HoldingsTree = new HoldingsTree(); org: OrgService; // injected + sessionType: 'copy' | 'vol' | 'record' | 'mixed'; + + // Edit content comes from a cached session + session: string; + + // Note in multi-record mode this value will be unset. + recordId: number; + + // Load specific call number by ID. + volId: number; + + // Load specific copy by ID. + copyId: number; + volsToDelete: IdlObject[] = []; copiesToDelete: IdlObject[] = []; -- 2.11.0