From f4b6a18c3a2c7b17139b80680703c3eda5b90ea5 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 17 Aug 2021 11:06:31 -0400 Subject: [PATCH] LP1904036 Angular Patron edit/search repairs * Fix inactive patron search * New patrons are active by default * Ensure new cards are correctly linked to new patrons. Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts | 2 ++ Open-ILS/src/eg2/src/app/staff/share/patron/search.component.ts | 9 ++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts index e0ab319578..64c25313f7 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts @@ -746,6 +746,7 @@ export class EditComponent implements OnInit, AfterViewInit { patron.isnew(true); patron.id(-1); patron.home_ou(this.auth.user().ws_ou()); + patron.active('t'); patron.settings([]); patron.waiver_entries([]); patron.stat_cat_entries([]); @@ -753,6 +754,7 @@ export class EditComponent implements OnInit, AfterViewInit { const card = this.idl.create('ac'); card.isnew(true); card.usr(-1); + card.id(this.autoId--); patron.card(card); patron.cards([card]); diff --git a/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.ts b/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.ts index 9e73b2818c..46c07bc74b 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.ts @@ -222,7 +222,7 @@ export class PatronSearchComponent implements OnInit, AfterViewInit { pSearch.search, pager.limit, sorter, - null, // ? + this.search.inactive, pSearch.orgId, DEFAULT_FLESH, pager.offset @@ -250,10 +250,10 @@ export class PatronSearchComponent implements OnInit, AfterViewInit { const search: PatronSearchFieldSet = {}; Object.keys(this.search).forEach(field => { + if (field === 'inactive') { return; } search[field] = this.mapSearchField(field); - if (search[field]) { - // one filter is not enough - if (field !== 'inactive') { hasSearch = true; } + if (search[field] !== null) { + hasSearch = true; } else { delete search[field]; } @@ -276,7 +276,6 @@ export class PatronSearchComponent implements OnInit, AfterViewInit { switch (field) { case 'name': // name keywords - case 'inactive': delete chunk.group; break; -- 2.11.0