From: Bill Erickson Date: Fri, 25 May 2018 20:00:45 +0000 (-0400) Subject: LP#1626157 hold weight / copy status config UI's; fm form fixes X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6f40a7f3066c7c3b034f2d9efcf7ab91b19c6719;p=working%2FEvergreen.git LP#1626157 hold weight / copy status config UI's; fm form fixes Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/core/idl.service.ts b/Open-ILS/src/eg2/src/app/core/idl.service.ts index 33625933d0..82f0ab73de 100644 --- a/Open-ILS/src/eg2/src/app/core/idl.service.ts +++ b/Open-ILS/src/eg2/src/app/core/idl.service.ts @@ -64,6 +64,10 @@ export class EgIdlService { } return this.a[idx]; }; + + if (!field.label) { + field.label = field.name; + } }); return x; diff --git a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts index e80d9f02b8..84a347ba8e 100644 --- a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts +++ b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts @@ -28,7 +28,9 @@ interface CustomFieldContext { @Component({ selector: 'eg-fm-record-editor', - templateUrl: './fm-editor.component.html' + templateUrl: './fm-editor.component.html', + // fix funky checkbox alignment. + styles: ['input[type="checkbox"] {margin-left: 0px}'] }) export class FmRecordEditorComponent extends EgDialogComponent implements OnInit { @@ -219,8 +221,7 @@ export class FmRecordEditorComponent private getFieldList(): Promise { this.fields = this.idlDef.fields.filter(f => - f.virtual !== 'true' && - !this.hiddenFieldsList.includes(f.name) + !f.virtual && !this.hiddenFieldsList.includes(f.name) ); const promises = []; diff --git a/Open-ILS/src/eg2/src/app/share/util/format.service.ts b/Open-ILS/src/eg2/src/app/share/util/format.service.ts index 7abe6568eb..ee9b8fc89a 100644 --- a/Open-ILS/src/eg2/src/app/share/util/format.service.ts +++ b/Open-ILS/src/eg2/src/app/share/util/format.service.ts @@ -3,6 +3,10 @@ import {DatePipe, CurrencyPipe} from '@angular/common'; import {EgIdlService, EgIdlObject} from '@eg/core/idl.service'; import {EgOrgService} from '@eg/core/org.service'; +/** + * Format IDL vield values for display. + */ + declare var OpenSRF; export interface EgFormatParams { @@ -71,6 +75,13 @@ export class EgFormatService { case 'money': return this.currencyPipe.transform(value); + case 'bool': + // Slightly better than a bare 't' or 'f'. + // Should probably add a global true/false string. + return Boolean( + value === 't' || value === 1 || value === '1' + ).toString(); + default: return value + ''; } diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/admin-server-splash.component.html b/Open-ILS/src/eg2/src/app/staff/admin/server/admin-server-splash.component.html index 8de396cd8f..2bd8411c22 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/admin-server-splash.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/admin-server-splash.component.html @@ -38,7 +38,7 @@ + routerLink="/staff/admin/server/config/copy_status"> + routerLink="/staff/admin/server/config/hold_matrix_weights"> + + + + ` +}) + +export class CopyStatusComponent {} + + diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/config/hold_matrix_weights.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/config/hold_matrix_weights.ts new file mode 100644 index 0000000000..bee077f104 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/config/hold_matrix_weights.ts @@ -0,0 +1,14 @@ +import {Component, OnInit} from '@angular/core'; + +@Component({ + template: ` + + + + + ` +}) + +export class HoldMatrixWeightsComponent {} + + diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/config/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/config/routing.module.ts index 64dc8b689b..3b1aaf6d5e 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/config/routing.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/config/routing.module.ts @@ -3,16 +3,24 @@ import {RouterModule, Routes} from '@angular/router'; import {BillingTypeComponent} from './billing_type.component'; import {HardDueDateComponent} from './hard_due_date.component'; import {SmsCarrierComponent} from './sms_carrier.component'; +import {HoldMatrixWeightsComponent} from './hold_matrix_weights'; +import {CopyStatusComponent} from './copy_status'; const routes: Routes = [{ path: 'billing_type', component: BillingTypeComponent }, { + path: 'copy_status', + component: CopyStatusComponent +}, { path: 'hard_due_date', component: HardDueDateComponent }, { path: 'sms_carrier', component: SmsCarrierComponent +}, { + path: 'hold_matrix_weights', + component: HoldMatrixWeightsComponent }]; @NgModule({ diff --git a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts index 0d146d3fbc..4d1cd29b13 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts @@ -34,6 +34,9 @@ export class EgAdminPageComponent implements OnInit { // that requires no special handling, filtering, etc. @Input() dataSource: EgGridDataSource; + // Size of create/edito dialog. Uses large by default. + @Input() dialogSize: 'sm' | 'lg' = 'lg'; + @ViewChild('grid') grid: EgGridComponent; @ViewChild('editDialog') editDialog: FmRecordEditorComponent; @ViewChild('successString') successString: EgStringComponent; @@ -67,7 +70,7 @@ export class EgAdminPageComponent implements OnInit { (idlThing: EgIdlObject) => { this.editDialog.mode = 'update'; this.editDialog.recId = idlThing[this.pkeyField](); - this.editDialog.open().then( + this.editDialog.open({size: this.dialogSize}).then( ok => { this.successString.current() .then(str => this.toast.success(str)); @@ -80,7 +83,7 @@ export class EgAdminPageComponent implements OnInit { this.createNew = () => { this.editDialog.mode = 'create'; - this.editDialog.open().then( + this.editDialog.open({size: this.dialogSize}).then( ok => { this.createString.current() .then(str => this.toast.success(str)); diff --git a/Open-ILS/src/eg2/src/app/staff/share/link-table/link-table.component.html b/Open-ILS/src/eg2/src/app/staff/share/link-table/link-table.component.html index 8001f464c3..0d82279307 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/link-table/link-table.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/link-table/link-table.component.html @@ -3,11 +3,20 @@ *ngFor="let row of rowBuckets; let rowIdx = index">