From 1ddbb89790bf0f23a6568e6bc48c3aaaef7ac7a3 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 6 May 2021 12:13:53 -0400 Subject: [PATCH] LP1904036 Patron summary status colors An attempt to replicate the XUL-era patron status border colors. At present, it only shows the border, not the individual labels. Note in most cases the reason for the status is present elsewhere in the summary. Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg --- .../app/staff/share/patron/summary.component.css | 18 ++++++ .../app/staff/share/patron/summary.component.html | 10 +++- .../app/staff/share/patron/summary.component.ts | 70 ++++++++++++++++++++++ 3 files changed, 96 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/share/patron/summary.component.css b/Open-ILS/src/eg2/src/app/staff/share/patron/summary.component.css index 2c7d847f7d..272c360300 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/patron/summary.component.css +++ b/Open-ILS/src/eg2/src/app/staff/share/patron/summary.component.css @@ -3,4 +3,22 @@ background-color: rgb(248, 248, 248); } +.patron-status-color { border: 2px solid transparent; padding: 3px; padding-left: 5px;} +.patron-status-color.NO_PENALTIES { border-color: lime; } +.patron-status-color.ONE_PENALTY { border-color: #66FFFF; } +.patron-status-color.MULTIPLE_PENALTIES { border-color: #FF6633; } +.patron-status-color.PATRON_HAS_STAFF_ALERT { border-color: blue; } +.patron-status-color.PATRON_HAS_BILLS { border-color: #FFC266; } +.patron-status-color.PATRON_HAS_OVERDUES { border-color: #FFC266; } +.patron-status-color.PATRON_HAS_LOST { border-color: #FFC266; } +.patron-status-color.PATRON_EXCEEDS_CHECKOUT_COUNT { border-color: #C99DFF; } +.patron-status-color.PATRON_EXCEEDS_OVERDUE_COUNT { border-color: #C99DFF; } +.patron-status-color.PATRON_EXCEEDS_FINES { border-color: #C99DFF; } +.patron-status-color.PATRON_HAS_ALERT { border-color: yellow; } +.patron-status-color.PATRON_INACTIVE { border-color: #333333; } +.patron-status-color.PATRON_EXPIRED { border-color: #666666; } +.patron-status-color.PATRON_BARRED { border-color: #CC3300; } +.patron-status-color.PATRON_JUVENILE { border-color: lightblue; } + + diff --git a/Open-ILS/src/eg2/src/app/staff/share/patron/summary.component.html b/Open-ILS/src/eg2/src/app/staff/share/patron/summary.component.html index 5f5251ce84..e127bc260b 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/patron/summary.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/patron/summary.component.html @@ -1,8 +1,8 @@
-
-
+
+

{{p().family_name()}}, {{p().first_given_name()}} @@ -32,6 +32,12 @@

+
+
+ Juvenile Account +
+
+
0) { + return 'PATRON_HAS_BILLS'; + } + + if (this.summary.stats.checkouts.overdue > 0) { + return 'PATRON_HAS_OVERDUES'; + } + + if (patron.notes().length > 0) { + return 'PATRON_HAS_NOTES'; + } + + if (this.summary.stats.checkouts.lost > 0) { + return 'PATRON_HAS_LOST'; + } + + let penalty: string; + let penaltyCount = 0; + + patron.standing_penalties().some(p => { + penaltyCount++; + + if (p.standing_penalty().staff_alert() === 't' || + p.standing_penalty().block_list()) { + penalty = 'PATRON_HAS_STAFF_ALERT'; + return true; + } + + const name = p.standing_penalty(); + + switch (name) { + case 'PATRON_EXCEEDS_CHECKOUT_COUNT': + case 'PATRON_EXCEEDS_OVERDUE_COUNT': + case 'PATRON_EXCEEDS_FINES': + penalty = name; + return true; + } + }); + + if (penalty) { return penalty; } + + if (penaltyCount === 1) { + return 'ONE_PENALTY'; + } else if (penaltyCount > 1) { + return 'MULTIPLE_PENALTIES'; + } + + if (patron.alert_message()) { + return 'PATRON_HAS_ALERT'; + } + + if (patron.juvenile() === 't') { + return 'PATRON_JUVENILE'; + } + + return 'NO_PENALTIES'; + } } -- 2.11.0