From: Stephanie Leary Date: Thu, 18 May 2023 14:52:52 +0000 (+0000) Subject: WIP X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fcollab%2Fsleary%2Flp1984007-funds-dropdown-warnings-v2;p=working%2FEvergreen.git WIP Signed-off-by: Stephanie Leary --- diff --git a/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.html b/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.html index c15e26e893..81ed24852b 100644 --- a/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.html +++ b/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.html @@ -4,7 +4,7 @@ - {{r.fm.code()}} ({{r.fm.year()}}) ({{getOrgShortname(r.fm.org())}}) + {{r.fm.code()}} ({{r.fm.year()}}) ({{getOrgShortname(r.fm.org())}}) diff --git a/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts b/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts index 971fc725b0..7325c41dfa 100644 --- a/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts +++ b/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts @@ -15,6 +15,9 @@ import {StoreService} from '@eg/core/store.service'; import {IdlService, IdlObject} from '@eg/core/idl.service'; import {PcrudService} from '@eg/core/pcrud.service'; import {OrgService} from '@eg/core/org.service'; +import { AuthService } from '@eg/core/auth.service'; +import { NetService } from '@eg/core/net.service'; +import { PoService } from '@eg/staff/acq/po/po.service'; export interface ComboboxEntry { id: any; @@ -28,7 +31,7 @@ export interface ComboboxEntry { } @Directive({ - selector: 'ng-template[egIdlClass]' + selector: 'ng-template[egIdlClass]' }) export class IdlClassTemplateDirective { @Input() egIdlClass: string; @@ -41,6 +44,42 @@ export class IdlClassTemplateDirective { styles: [` .icons {margin-left:-18px} .material-icons {font-size: 16px;font-weight:bold} + + .dropdown-item .text-bg-danger { + background-color: #f8d7da; + color: #58151c !important; + font-weight: 600; + padding: 0 1rem 0 .25rem; + } + + .dropdown-item .text-bg-danger::before { + content: "\e160"; + font-family: "Material Icons"; + font-weight: normal; + vertical-align: sub; + } + + .dropdown-item.active .text-bg-danger { + background-color: #f1aeb5; + } + + .dropdown-item .text-bg-warning { + background-color: #ffe69c !important; + color: #723809; + font-weight: 600; + padding: 0 1rem 0 .25rem; + } + + .dropdown-item .text-bg-warning::before { + content: "\e002"; + font-family: "Material Icons"; + font-weight: normal; + vertical-align: sub; + } + + .dropdown-item.active .text-bg-warning { + background-color: #ffda6a; + } `], providers: [{ provide: NG_VALUE_ACCESSOR, @@ -225,6 +264,9 @@ export class ComboboxComponent private idl: IdlService, private pcrud: PcrudService, private org: OrgService, + private net: NetService, + private auth: AuthService, + public poService: PoService ) { this.entrylist = []; this.asyncIds = {}; @@ -621,6 +663,21 @@ export class ComboboxComponent this.propagateTouch = fn; } + acqfCheckFundBalance(fundId: number): any { + return this.net.request( + 'open-ils.acq', + 'open-ils.acq.fund.check_balance_percentages', + this.auth.token(), fundId + ).toPromise().then(r => { + if (r[0]) { + return 'danger'; + } else if (r[1]) { + return 'warning'; + } else { + return 'ok'; + } + }); + } } diff --git a/Open-ILS/src/eg2/src/app/staff/acq/po/charges.component.html b/Open-ILS/src/eg2/src/app/staff/acq/po/charges.component.html index c8fbf51bb6..e78a8bf52d 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/po/charges.component.html +++ b/Open-ILS/src/eg2/src/app/staff/acq/po/charges.component.html @@ -30,7 +30,6 @@ Remove - - - - - {{r.label}} - \ No newline at end of file + \ No newline at end of file diff --git a/Open-ILS/src/eg2/src/app/staff/acq/po/charges.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/po/charges.component.ts index 7e14e0843e..a3e3ee4aef 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/po/charges.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/po/charges.component.ts @@ -53,10 +53,12 @@ export class PoChargesComponent implements OnInit, OnDestroy { }); this.owners = this.org.ancestors(this.auth.user().ws_ou(), true); + /* if (this.po().activationEvent) this.classNames.push('text-bg-danger'); if (this.po().activationWarnings.length) this.classNames.push('text-bg-warning'); + /**/ } ngOnDestroy() { diff --git a/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.css b/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.css index e7e8b76ebf..8537b5b9ad 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.css +++ b/Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.css @@ -6,39 +6,3 @@ vertical-align: sub; } -.dropdown-item .text-bg-danger { - background-color: #f8d7da; - color: #58151c !important; - font-weight: 600; - padding: 0 1rem 0 .25rem; -} - -.dropdown-item .text-bg-danger::before { - content: "\e160"; - font-family: "Material Icons"; - font-weight: normal; - vertical-align: sub; -} - -.dropdown-item.active .text-bg-danger { - background-color: #f1aeb5; -} - -.dropdown-item .text-bg-warning { - background-color: #ffe69c !important; - color: #723809; - font-weight: 600; - padding: 0 1rem 0 .25rem; -} - -.dropdown-item .text-bg-warning::before { - content: "\e002"; - font-family: "Material Icons"; - font-weight: normal; - vertical-align: sub; -} - -.dropdown-item.active .text-bg-warning { - background-color: #ffda6a; -} -