From cc3d89c9487d372c126b0a521d39fcd1d133af98 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 3 Jul 2020 10:42:34 -0400 Subject: [PATCH] LPXXX Angular Volcopy statcat filter Signed-off-by: Bill Erickson --- .../app/staff/cat/volcopy/config.component.html | 27 ++++++++++++++++++++-- .../staff/cat/volcopy/copy-attrs.component.html | 12 ++++++++++ .../app/staff/cat/volcopy/copy-attrs.component.ts | 14 ++++++++++- 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/config.component.html b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/config.component.html index d3793abb46..32d791246a 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/config.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/config.component.html @@ -131,14 +131,27 @@
  • +
  • +
    + + + +
    +
  • @@ -482,6 +495,16 @@
  • + +
    +
  • +
  • +
    +
    +
    +
    Add Item Tags
    +
    + + +
    +
    +
    diff --git a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts index 818edef694..98cc60c059 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/volcopy/copy-attrs.component.ts @@ -47,6 +47,8 @@ export class CopyAttrsComponent implements OnInit, AfterViewInit { loanDurationLabelMap: {[level: number]: string} = {}; fineLevelLabelMap: {[level: number]: string} = {}; + statCatFilter: number; + @ViewChild('loanDurationShort', {static: false}) loanDurationShort: StringComponent; @ViewChild('loanDurationNormal', {static: false}) @@ -95,6 +97,7 @@ export class CopyAttrsComponent implements OnInit, AfterViewInit { ) { } ngOnInit() { + this.statCatFilter = this.volcopy.defaults.values.statcat_filter; } ngAfterViewInit() { @@ -115,7 +118,16 @@ export class CopyAttrsComponent implements OnInit, AfterViewInit { } statCats(): IdlObject[] { - return this.volcopy.commonData.acp_stat_cat; + if (this.statCatFilter) { + const orgs = this.org.descendants(this.statCatFilter, true); + + return this.volcopy.commonData.acp_stat_cat.filter( + sc => orgs.includes(sc.owner())) + + } else { + + return this.volcopy.commonData.acp_stat_cat; + } } -- 2.11.0