From: Mike Risher Date: Fri, 9 Oct 2020 22:42:34 +0000 (+0000) Subject: lp1857911 Statistical Categories UI port X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fmrisher%2Flp1857911-stat-cat-v3;p=working%2FEvergreen.git lp1857911 Statistical Categories UI port This UI allows editing copy statistical categories (stat cats), patron statistical categories, and their entries. They are filtered by location and permissions are needed. A separate page is used when editing, deleting or adding entries. Signed-off-by: Mike Risher Changes to be committed: modified: Open-ILS/examples/fm_IDL.xml modified: Open-ILS/src/eg2/src/app/staff/admin/local/admin-local-splash.component.html modified: Open-ILS/src/eg2/src/app/staff/admin/local/routing.module.ts new file: Open-ILS/src/eg2/src/app/staff/admin/local/stat_cat/stat_cat.component.html new file: Open-ILS/src/eg2/src/app/staff/admin/local/stat_cat/stat_cat.component.ts new file: Open-ILS/src/eg2/src/app/staff/admin/local/stat_cat/stat_cat.module.ts new file: Open-ILS/src/eg2/src/app/staff/admin/local/stat_cat/stat_cat_entries.component.html new file: Open-ILS/src/eg2/src/app/staff/admin/local/stat_cat/stat_cat_entries.component.ts new file: Open-ILS/src/eg2/src/app/staff/admin/local/stat_cat/stat_cat_routing.module.ts Signed-off-by: Mike Risher --- diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/local/routing.module.ts index f2118a2c88..8562afff8b 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/routing.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/routing.module.ts @@ -17,7 +17,7 @@ const routes: Routes = [{ }, { path: 'actor/address_alert', component: AddressAlertComponent -}, { +}, { path: 'asset/stat_cat_editor', loadChildren: () => import('./stat_cat/stat_cat.module').then(m => m.StatCatModule) diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/stat_cat/stat_cat.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/local/stat_cat/stat_cat.component.ts index 037497df07..055cc9c093 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/stat_cat/stat_cat.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/stat_cat/stat_cat.component.ts @@ -89,9 +89,9 @@ export class StatCatComponent implements OnInit { this.setCurrentPerms(); if (this.route.snapshot.paramMap.get('tab') === 'patron') { - this.onTabChange({nextId: "'patron'"}) - } else { // if null or copy - this.onTabChange({nextId: "'copy'"}) + this.onTabChange({nextId: '\'patron\''}); + } else { // if null or 'copy' + this.onTabChange({nextId: '\'copy\''}); } }); } @@ -117,7 +117,7 @@ export class StatCatComponent implements OnInit { onTabChange(event: any) { this.currentTab = event.nextId; - if (this.currentTab === "'patron'") { + if (this.currentTab === '\'patron\'') { this.routeToTab('patron'); this.orgOnChange(this.selectedPatronOrg, 'patron'); } else { @@ -220,20 +220,20 @@ export class StatCatComponent implements OnInit { .then(str => this.toast.danger(str)); return; } - + // check to see if copy stat cat is in use if (idlString === 'asc') { - this.checkThenDelete(idlThings, idlString) + this.checkThenDelete(idlThings, idlString); } else { this.doDelete(idlThings, idlString); } } checkThenDelete = (idlThings, idlString) => { - let promises: any[] = []; + const promises: any[] = []; idlThings.forEach(idlThing => { // check one at a time to see if it's used const id = idlThing.id(); - let promise : any = new Promise((resolve, reject) => { + const promise: any = new Promise((resolve, reject) => { this.pcrud.search('ascecm', {stat_cat: id}, {limit: 1}) .toPromise().then( rec => { @@ -245,13 +245,13 @@ export class StatCatComponent implements OnInit { resolve(true); } }); - }) + }); promises.push(promise); }); - let result = Promise.all(promises); + const result = Promise.all(promises); result.then(responses => { if (!responses.includes(false)) { // only delete if none in use - this.doDelete(idlThings, idlString); + this.doDelete(idlThings, idlString); } }); } @@ -304,7 +304,7 @@ export class StatCatComponent implements OnInit { newIdlObject.owner(this.selectedPatronOrg); } else { currentGrid = this.copyGrid; - + currentDialog = this.copyDialog; newIdlObject = this.idl.clone(this.newAsc); newIdlObject.owner(this.selectedCopyOrg);