From ef5edca9e87ccdd428ca8fee3550b0a70b9d779f Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 22 Jun 2021 12:19:44 -0400 Subject: [PATCH] LP1929741 Sort funds by year desc, then code Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton Signed-off-by: Jane Sandberg --- Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts | 8 +++++++- .../src/eg2/src/app/staff/acq/lineitem/copy-attrs.component.html | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) 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 243458cc71..b34cf1b3fe 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 @@ -115,6 +115,8 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit, AfterVie // when fetching objects by idlClass. @Input() idlQueryAnd: {[field: string]: any}; + @Input() idlQuerySort: {[cls: string]: string}; + // Display the selected value as text instead of within // the typeahead @Input() readOnly = false; @@ -281,7 +283,11 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit, AfterVie if (this.idlQueryAnd) { Object.assign(args, this.idlQueryAnd); } - extra_args['order_by'][this.idlClass] = field; + if (this.idlQuerySort) { + extra_args['order_by'] = this.idlQuerySort; + } else { + extra_args['order_by'][this.idlClass] = field; + } extra_args['limit'] = 100; if (this.idlIncludeLibraryInLabel) { extra_args['flesh'] = 1; diff --git a/Open-ILS/src/eg2/src/app/staff/acq/lineitem/copy-attrs.component.html b/Open-ILS/src/eg2/src/app/staff/acq/lineitem/copy-attrs.component.html index f2d8952a99..623584b540 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/lineitem/copy-attrs.component.html +++ b/Open-ILS/src/eg2/src/app/staff/acq/lineitem/copy-attrs.component.html @@ -37,6 +37,7 @@ [readOnly]="fieldIsDisabled('fund')" #fundSelector [entries]="fundEntries" [selectedId]="copy.fund()" (onChange)="valueChange('fund', $event)" + [idlQuerySort]="{acqf: 'year DESC, code'}" [idlQueryAnd]="{active: 't'}"> -- 2.11.0