From: Bill Erickson Date: Tue, 16 Mar 2021 14:36:40 +0000 (-0400) Subject: LP1904036 Patron stat cats X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6a8d8dd3dcf017dc59562b422cef754f29e665d6;p=evergreen%2Fmasslnc.git LP1904036 Patron stat cats Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.html b/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.html index d5f2faf105..d13a72ff21 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.html +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.html @@ -116,11 +116,11 @@
Alerts and Messages - Notes - Triggered Events / Notifications - Message Center Statistical Categories @@ -128,7 +128,7 @@ ngbDropdownItem i18n>Surveys Group Member Details - User Permission Editor Test Password @@ -145,8 +145,7 @@ target="_top" ngbDropdownItem i18n>Booking: Pick Up Reservations + target="_top" ngbDropdownItem i18n> Completely Purge Account @@ -164,6 +163,10 @@
+
+ + +
diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.module.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.module.ts index bc4292a4d9..fe5f556e65 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.module.ts @@ -24,6 +24,7 @@ import {BillsComponent} from './bills.component'; import {BillStatementComponent} from './bill-statement.component'; import {TestPatronPasswordComponent} from './test-password.component'; import {PatronSurveyResponsesComponent} from './surveys.component'; +import {PatronStatCatsComponent} from './statcats.component'; @NgModule({ declarations: [ @@ -39,7 +40,8 @@ import {PatronSurveyResponsesComponent} from './surveys.component'; BillsComponent, BillStatementComponent, TestPatronPasswordComponent, - PatronSurveyResponsesComponent + PatronSurveyResponsesComponent, + PatronStatCatsComponent ], imports: [ StaffCommonModule, diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.service.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.service.ts index c9665be0f1..847b1e6cc0 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/patron.service.ts @@ -33,7 +33,6 @@ const PATRON_FLESH_FIELDS = [ 'addresses', 'billing_address', 'mailing_address', - 'stat_cat_entries', 'waiver_entries', 'usr_activity', 'notes', diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/statcats.component.html b/Open-ILS/src/eg2/src/app/staff/circ/patron/statcats.component.html new file mode 100644 index 0000000000..d359718fa1 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/statcats.component.html @@ -0,0 +1,16 @@ + + + + diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/statcats.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/statcats.component.ts new file mode 100644 index 0000000000..d6e777d67e --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/statcats.component.ts @@ -0,0 +1,53 @@ +import {Component, Input, OnInit, AfterViewInit, ViewChild} from '@angular/core'; +import {Router, ActivatedRoute, ParamMap} from '@angular/router'; +import {from, empty, range} from 'rxjs'; +import {concatMap, tap, takeLast} from 'rxjs/operators'; +import {NgbNav, NgbNavChangeEvent} from '@ng-bootstrap/ng-bootstrap'; +import {IdlObject} from '@eg/core/idl.service'; +import {EventService} from '@eg/core/event.service'; +import {OrgService} from '@eg/core/org.service'; +import {NetService} from '@eg/core/net.service'; +import {PcrudService, PcrudContext} from '@eg/core/pcrud.service'; +import {AuthService} from '@eg/core/auth.service'; +import {PatronService} from '@eg/staff/share/patron/patron.service'; +import {PatronContextService} from './patron.service'; + +@Component({ + templateUrl: 'statcats.component.html', + selector: 'eg-patron-statcats' +}) +export class PatronStatCatsComponent implements OnInit { + + @Input() patronId: number; + catMaps: IdlObject[] = []; + + constructor( + private router: Router, + private evt: EventService, + private net: NetService, + private auth: AuthService, + private org: OrgService, + private pcrud: PcrudService, + private patronService: PatronService, + private context: PatronContextService + ) {} + + ngOnInit() { + + this.net.request( + 'open-ils.actor', + 'open-ils.actor.user.fleshed.retrieve', + this.auth.token(), this.patronId, ['stat_cat_entries']).toPromise() + .then(user => { + const catIds = user.stat_cat_entries().map(e => e.stat_cat()); + this.pcrud.search('actsc', {id: catIds}) + .subscribe(cat => { + const map = user.stat_cat_entries() + .filter(e => e.stat_cat() === cat.id())[0]; + map.stat_cat(cat); + cat.owner(this.org.get(cat.owner())); + this.catMaps.push(map); + }); + }); + } +} diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/surveys.component.html b/Open-ILS/src/eg2/src/app/staff/circ/patron/surveys.component.html index 3515bdbda1..a1398792de 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/surveys.component.html +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/surveys.component.html @@ -1,5 +1,5 @@ -
+
{{survey.survey.name()}}
  • diff --git a/Open-ILS/src/eg2/src/styles.css b/Open-ILS/src/eg2/src/styles.css index 71e73821f9..8d2ad654a0 100644 --- a/Open-ILS/src/eg2/src/styles.css +++ b/Open-ILS/src/eg2/src/styles.css @@ -94,6 +94,13 @@ a { cursor: not-allowed; } +/* copies color/border/elements from above sans position elements */ +.well-like { + background-color: #f5f5f5; + border-radius: 5px; + box-shadow: inset 0 1px 1px rgba(0,0,0,.05); +} + /* usefuf for mat-icon buttons without any background or borders */ .material-icon-button { /* Transparent background */ @@ -223,7 +230,6 @@ a { border-bottom: 1px solid rgba(0,0,0,.125); } - /** * Only display the print container when printing */