[open-ils-commits] [GIT] Evergreen ILS branch master updated. abc50d3a6dceafef96bc4c3972c0dd440c86b4d7
Evergreen Git
git at git.evergreen-ils.org
Fri Feb 21 16:37:04 EST 2020
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via abc50d3a6dceafef96bc4c3972c0dd440c86b4d7 (commit)
via 27c346a64e0a55984b16b1218c204e28de2cec52 (commit)
via 1d4ba0034ab8e7198593c9742842e5bbee80222d (commit)
via 0c62ab0975cbffcf5346ddc328a9f2dfd2fb5f19 (commit)
from 473688892df7ee175d44930c5cea438d44d01992 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit abc50d3a6dceafef96bc4c3972c0dd440c86b4d7
Author: Jane Sandberg <sandbej at linnbenton.edu>
Date: Fri Jan 31 20:47:54 2020 -0800
LP1840287: Add a return to list button for floating group edit page
Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
Signed-off-by: Bill Erickson <berickxx at gmail.com>
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.html b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.html
index 48d8dfedd3..55b02b74b9 100644
--- a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.html
+++ b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.html
@@ -2,6 +2,16 @@
<eg-staff-banner bannerText="Edit Floating Group" i18n-bannerText>
</eg-staff-banner>
+<div class="row">
+ <div class="col text-right">
+ <a class="btn btn-warning ml-3" routerLink="/staff/admin/server/config/floating_group">
+ <span class="material-icons align-middle">keyboard_return</span>
+ <span class="align-middle" i18n>Return to Floating Groups List</span>
+ </a>
+ </div>
+</div>
+
+
<div class="col-lg-6 offset-lg-3">
<eg-fm-record-editor displayMode="inline"
idlClass="cfg" mode="update" recordId="{{this.currentId}}">
commit 27c346a64e0a55984b16b1218c204e28de2cec52
Author: Bill Erickson <berickxx at gmail.com>
Date: Wed Dec 4 15:52:23 2019 -0500
LP1840287 Floating group admin minor code tweaks
* Added grid sorting to both group and group member grids.
* Avoid using the defaultNewRecord in fm-editor directly, by cloning it
as needed, so that subsequent new records (within a single parent
component instance) do not pick up values from the previously created
record.
* Renamed the eg-admin-page @Input() 'hideFields' to 'hideGridFields'
to better explain how the value will be passed along.
* Replace access of fieldmapper innards (thing.a[0]) with field names
(thing.id())
* Remove unused <eg-string /> entries.
* Avoid unnecessary newlines in translatable strings.
* Remove unused @Inputs() and unnecessary functions
* Remove unneccessary TreeModule import
* Removed a redundant <eg-title /> -- <eg-staff-banner /> will set the
title when present.
* Various 'ng lint' repairs.
Signed-off-by: Bill Erickson <berickxx at gmail.com>
Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
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 d95646589a..e809b7d72d 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
@@ -359,8 +359,16 @@ export class FmRecordEditorComponent
//
// Create a new record from the stub record provided by the
// caller or a new from-scratch record
- // Set this._record (not this.record) to avoid loop in initRecord()
- this._record = this.defaultNewRecord || this.record || this.idl.create(this.idlClass);
+ if (!this.record) {
+ // NOTE: Set this._record (not this.record) to avoid
+ // loop in initRecord()
+ if (this.defaultNewRecord) {
+ // Clone to avoid polluting the stub record
+ this._record = this.idl.clone(this.defaultNewRecord);
+ } else {
+ this._record = this.idl.create(this.idlClass);
+ }
+ }
this._recordId = null; // avoid future confusion
return this.getFieldList();
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.html b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.html
index 00fda10854..48d8dfedd3 100644
--- a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.html
+++ b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.html
@@ -8,17 +8,11 @@
</eg-fm-record-editor>
</div>
-<eg-string #createString i18n-text text="New Floating Group Member Added"></eg-string>
-<eg-string #createErrString i18n-text text="Failed to Create New Floating Group Member"></eg-string>
-<eg-string #successString i18n-text text="Floating Group Member Update Succeeded"></eg-string>
-<eg-string #updateFailedString i18n-text text="Floating Group Member Update Failed"></eg-string>
-<eg-string #deleteFailedString i18n-text text="Delete of Floating Group Member failed or was not allowed"></eg-string>
-<eg-string #deleteSuccessString i18n-text text="Delete of Floating Group Member succeeded"></eg-string>
-
<eg-staff-banner bannerText="Edit Floating Group Members" i18n-bannerText>
</eg-staff-banner>
<eg-admin-page idlClass="cfgm" disableOrgFilter="true"
- hideFields="id,floating_group"
+ hideGridFields="id,floating_group"
+ readonlyFields="floating_group"
[dataSource]="dataSource"
[defaultNewRecord]="defaultNewRecord">
-</eg-admin-page>
\ No newline at end of file
+</eg-admin-page>
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.ts
index 805e3e2f0c..e6785e8397 100644
--- a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.ts
@@ -1,19 +1,17 @@
-import {Component, Input} from '@angular/core';
+import {Component, Input, OnInit} from '@angular/core';
import {Router, ActivatedRoute} from '@angular/router';
import {GridDataSource} from '@eg/share/grid/grid';
import {Pager} from '@eg/share/util/pager';
import {PcrudService} from '@eg/core/pcrud.service';
import {IdlObject, IdlService } from '@eg/core/idl.service';
- @Component({
- templateUrl: './edit-floating-group.component.html'
- })
+ at Component({
+ templateUrl: './edit-floating-group.component.html'
+})
- export class EditFloatingGroupComponent {
+export class EditFloatingGroupComponent implements OnInit {
- @Input() sortField: string;
- @Input() dataSource: GridDataSource;
- @Input() dialogSize: 'sm' | 'lg' = 'lg';
+ dataSource: GridDataSource;
// defaultNewRecord is used when creating a new entry to give a default floating_group
defaultNewRecord: IdlObject;
@@ -29,17 +27,25 @@ import {IdlObject, IdlService } from '@eg/core/idl.service';
}
ngOnInit() {
- this.currentId = parseInt(this.route.snapshot.paramMap.get('id'));
+ this.currentId = parseInt(this.route.snapshot.paramMap.get('id'), 10);
this.defaultNewRecord = this.idl.create('cfgm');
this.defaultNewRecord.floating_group(this.currentId);
this.dataSource = new GridDataSource();
+
this.dataSource.getRows = (pager: Pager, sort: any[]) => {
+ const orderBy: any = {};
+ if (sort.length) {
+ orderBy.cfgm = sort[0].name + ' ' + sort[0].dir;
+ }
+
const searchOps = {
offset: pager.offset,
limit: pager.limit,
- order_by: {}
+ order_by: orderBy
};
- return this.pcrud.search("cfgm", {floating_group: this.currentId}, searchOps);
+
+ return this.pcrud.search('cfgm',
+ {floating_group: this.currentId}, searchOps);
};
}
- }
\ No newline at end of file
+}
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.html b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.html
index 1895293ebb..66084e5686 100644
--- a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.html
+++ b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.html
@@ -1,19 +1,17 @@
-<eg-title i18n-prefix prefix="Floating Group Administration"></eg-title>
-<eg-staff-banner bannerText="Floating Group Configuration" i18n-bannerText>
+<eg-staff-banner bannerText="Floating Group Administration" i18n-bannerText>
</eg-staff-banner>
<eg-string #createString i18n-text text="New Floating Group Added"></eg-string>
<eg-string #createErrString i18n-text text="Failed to Create New Floating Group">
- </eg-string>
-<eg-string #deleteFailedString i18n-text text="Delete of Floating Group failed
- or was not allowed"></eg-string>
-<eg-string #deleteSuccessString i18n-text text="Delete of Floating Group
- succeeded"></eg-string>
+</eg-string>
+<eg-string #deleteFailedString i18n-text
+ text="Delete of Floating Group failed or was not allowed"></eg-string>
+<eg-string #deleteSuccessString i18n-text
+ text="Delete of Floating Group succeeded"></eg-string>
-<eg-grid #grid idlClass="cfg" [dataSource]="gridDataSource"
- [sortable]="true">
+<eg-grid #grid idlClass="cfg" [dataSource]="gridDataSource" [sortable]="true">
<eg-grid-toolbar-button
- label="New Floating Group" i18n-label [action]="createNew">
+ label="New Floating Group" i18n-label (onClick)="createNew()">
</eg-grid-toolbar-button>
<eg-grid-toolbar-action label="Edit Selected" i18n-label [action]="editSelected">
</eg-grid-toolbar-action>
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.ts
index fa639ee829..da84179689 100644
--- a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.ts
@@ -1,6 +1,6 @@
import {Pager} from '@eg/share/util/pager';
-import {Component, Input, ViewChild} from '@angular/core';
-import { Router, ActivatedRoute } from '@angular/router';
+import {Component, Input, ViewChild, OnInit} from '@angular/core';
+import {Router, ActivatedRoute} from '@angular/router';
import {IdlService, IdlObject} from '@eg/core/idl.service';
import {GridDataSource} from '@eg/share/grid/grid';
import {GridComponent} from '@eg/share/grid/grid.component';
@@ -9,20 +9,18 @@ import {PcrudService} from '@eg/core/pcrud.service';
import {OrgService} from '@eg/core/org.service';
import {PermService} from '@eg/core/perm.service';
import {AuthService} from '@eg/core/auth.service';
-import { AdminPageComponent } from '../../../share/admin-page/admin-page.component';
+import {AdminPageComponent} from '../../../share/admin-page/admin-page.component';
- @Component({
- templateUrl: './floating-group.component.html'
- })
+ at Component({
+ templateUrl: './floating-group.component.html'
+})
- export class FloatingGroupComponent extends AdminPageComponent {
+export class FloatingGroupComponent extends AdminPageComponent implements OnInit {
idlClass = 'cfg';
- @Input() sortField: string;
- @Input() dialogSize: 'sm' | 'lg' = 'lg';
gridDataSource: GridDataSource = new GridDataSource();
-
+
@ViewChild('grid', {static: true}) grid: GridComponent;
constructor(
@@ -33,7 +31,7 @@ import { AdminPageComponent } from '../../../share/admin-page/admin-page.compone
pcrud: PcrudService,
perm: PermService,
toast: ToastService,
- private router:Router
+ private router: Router
) {
super(route, idl, org, auth, pcrud, perm, toast);
}
@@ -41,27 +39,31 @@ import { AdminPageComponent } from '../../../share/admin-page/admin-page.compone
ngOnInit() {
super.ngOnInit();
this.gridDataSource.getRows = (pager: Pager, sort: any[]) => {
+
+ const orderBy: any = {};
+ if (sort.length) {
+ orderBy.cfg = sort[0].name + ' ' + sort[0].dir;
+ }
+
const searchOps = {
offset: pager.offset,
limit: pager.limit,
- order_by: {}
+ order_by: orderBy
};
- return this.pcrud.retrieveAll("cfg", searchOps);
+
+ return this.pcrud.retrieveAll('cfg', searchOps);
};
+
this.grid.onRowActivate.subscribe(
(idlThing: IdlObject) => {
- let idToEdit = idlThing.a[0];
+ const idToEdit = idlThing.id();
this.navigateToEditPage(idToEdit);
}
);
}
- createNew = () => {
- super.createNew();
- };
-
editSelected = (floatingGroups: IdlObject[]) => {
- let idToEdit = floatingGroups[0].a[0];
+ const idToEdit = floatingGroups[0].id();
this.navigateToEditPage(idToEdit);
}
@@ -70,7 +72,7 @@ import { AdminPageComponent } from '../../../share/admin-page/admin-page.compone
}
navigateToEditPage(id: any) {
- this.router.navigate(["/staff/admin/server/config/floating_group/" + id]);
+ this.router.navigate(['/staff/admin/server/config/floating_group/' + id]);
}
// this was left mostly blank to ensure a modal does not open for edits
@@ -78,4 +80,4 @@ import { AdminPageComponent } from '../../../share/admin-page/admin-page.compone
return;
}
- }
\ No newline at end of file
+ }
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.module.ts
index a52febc342..ff267653df 100644
--- a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.module.ts
+++ b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.module.ts
@@ -1,6 +1,5 @@
import {NgModule} from '@angular/core';
import {AdminCommonModule} from '@eg/staff/admin/common.module';
-import {TreeModule} from '@eg/share/tree/tree.module';
import {FloatingGroupComponent} from './floating-group.component';
import {EditFloatingGroupComponent} from './edit-floating-group.component';
import {FloatingGroupRoutingModule} from './floating-group-routing.module';
@@ -12,8 +11,7 @@ import {FloatingGroupRoutingModule} from './floating-group-routing.module';
],
imports: [
AdminCommonModule,
- FloatingGroupRoutingModule,
- TreeModule
+ FloatingGroupRoutingModule
],
exports: [
],
@@ -22,4 +20,4 @@ import {FloatingGroupRoutingModule} from './floating-group-routing.module';
})
export class FloatingGroupModule {
-}
\ No newline at end of file
+}
diff --git a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html
index 285d9c9fc4..e0ae6c3b03 100644
--- a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html
+++ b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html
@@ -33,7 +33,7 @@
<ng-container *ngTemplateOutlet="helpTemplate"></ng-container>
</ng-container>
-<eg-grid #grid idlClass="{{idlClass}}" [dataSource]="dataSource" hideFields={{hideFields}}
+<eg-grid #grid idlClass="{{idlClass}}" [dataSource]="dataSource" hideFields="{{hideGridFields}}"
[sortable]="true" persistKey="{{persistKey}}">
<eg-grid-toolbar-button [disabled]="!canCreate"
label="New {{idlClassDef.label}}" i18n-label (onClick)="createNew()">
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 db5c9be25c..cb52da7f1d 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
@@ -45,7 +45,7 @@ export class AdminPageComponent implements OnInit {
// comma-separated list of fields to hide.
// This does not imply all other fields should be visible, only that
// the selected fields will be hidden.
- @Input() hideFields: string;
+ @Input() hideGridFields: string;
// If an org unit field is specified, an org unit filter
// is added to the top of the page.
commit 1d4ba0034ab8e7198593c9742842e5bbee80222d
Author: Bill Erickson <berickxx at gmail.com>
Date: Wed Dec 4 15:10:12 2019 -0500
LP1840287 Floating group IDL required fields
Indicate require Floating Group and Floating Group Member fields in the
IDL to support UI form validation.
Signed-off-by: Bill Erickson <berickxx at gmail.com>
Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index 9d537631fe..aefd66e7fc 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -12756,8 +12756,8 @@ SELECT usr,
<class id="cfg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::floating_group" oils_persist:tablename="config.floating_group" reporter:label="Floating Group">
<fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
<field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
- <field reporter:label="Name" name="name" reporter:datatype="text"/>
- <field reporter:label="Manual" name="manual" reporter:datatype="bool"/>
+ <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
+ <field reporter:label="Manual" name="manual" reporter:datatype="bool" oils_obj:required="true"/>
<field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
</fields>
<links>
@@ -12775,11 +12775,11 @@ SELECT usr,
<class id="cfgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::floating_group_member" oils_persist:tablename="config.floating_group_member" reporter:label="Floating Group Members">
<fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
<field reporter:label="ID" name="id" reporter:datatype="id"/>
- <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link"/>
- <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
- <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int"/>
+ <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link" oils_obj:required="true"/>
+ <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
+ <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int" oils_obj:required="true"/>
<field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
- <field reporter:label="Exclude" name="exclude" reporter:datatype="bool"/>
+ <field reporter:label="Exclude" name="exclude" reporter:datatype="bool" oils_obj:required="true"/>
</fields>
<links>
<link field="floating_group" reltype="has_a" key="id" class="cfg"/>
commit 0c62ab0975cbffcf5346ddc328a9f2dfd2fb5f19
Author: Mike Risher <mrisher at catalyte.io>
Date: Fri Sep 13 20:26:47 2019 +0000
lp1840287 Edit Floating Group Members
Add functionality so that when editing a floating group, one
is taken to a page where one can edit a given floating group as
well as all its linked members. New functionality:
- eg-admin-page can hide grid fields
- fm-editor can create a record with fields defaulting to values
Signed-off-by: Mike Risher <mrisher at catalyte.io>
Changes to be committed:
modified: Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts
new file: Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.html
new file: Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.ts
new file: Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group-routing.module.ts
new file: Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.html
new file: Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.ts
new file: Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.module.ts
modified: Open-ILS/src/eg2/src/app/staff/admin/server/routing.module.ts
modified: Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html
modified: Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts
Signed-off-by: Bill Erickson <berickxx at gmail.com>
Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
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 58c400fcf1..d95646589a 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
@@ -100,6 +100,9 @@ export class FmRecordEditorComponent
// behaviour for each field (by field name).
@Input() fieldOptions: {[fieldName: string]: FmFieldOptions} = {};
+ // This is used to set default values when making a new record
+ @Input() defaultNewRecord: IdlObject;
+
// list of fields that should not be displayed
@Input() hiddenFieldsList: string[] = [];
@Input() hiddenFields: string; // comma-separated string version
@@ -357,7 +360,7 @@ export class FmRecordEditorComponent
// Create a new record from the stub record provided by the
// caller or a new from-scratch record
// Set this._record (not this.record) to avoid loop in initRecord()
- this._record = this.record || this.idl.create(this.idlClass);
+ this._record = this.defaultNewRecord || this.record || this.idl.create(this.idlClass);
this._recordId = null; // avoid future confusion
return this.getFieldList();
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.html b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.html
new file mode 100644
index 0000000000..00fda10854
--- /dev/null
+++ b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.html
@@ -0,0 +1,24 @@
+<eg-title i18n-prefix prefix="Edit Floating Group"></eg-title>
+<eg-staff-banner bannerText="Edit Floating Group" i18n-bannerText>
+</eg-staff-banner>
+
+<div class="col-lg-6 offset-lg-3">
+ <eg-fm-record-editor displayMode="inline"
+ idlClass="cfg" mode="update" recordId="{{this.currentId}}">
+ </eg-fm-record-editor>
+</div>
+
+<eg-string #createString i18n-text text="New Floating Group Member Added"></eg-string>
+<eg-string #createErrString i18n-text text="Failed to Create New Floating Group Member"></eg-string>
+<eg-string #successString i18n-text text="Floating Group Member Update Succeeded"></eg-string>
+<eg-string #updateFailedString i18n-text text="Floating Group Member Update Failed"></eg-string>
+<eg-string #deleteFailedString i18n-text text="Delete of Floating Group Member failed or was not allowed"></eg-string>
+<eg-string #deleteSuccessString i18n-text text="Delete of Floating Group Member succeeded"></eg-string>
+
+<eg-staff-banner bannerText="Edit Floating Group Members" i18n-bannerText>
+</eg-staff-banner>
+<eg-admin-page idlClass="cfgm" disableOrgFilter="true"
+ hideFields="id,floating_group"
+ [dataSource]="dataSource"
+ [defaultNewRecord]="defaultNewRecord">
+</eg-admin-page>
\ No newline at end of file
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.ts
new file mode 100644
index 0000000000..805e3e2f0c
--- /dev/null
+++ b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.ts
@@ -0,0 +1,45 @@
+import {Component, Input} from '@angular/core';
+import {Router, ActivatedRoute} from '@angular/router';
+import {GridDataSource} from '@eg/share/grid/grid';
+import {Pager} from '@eg/share/util/pager';
+import {PcrudService} from '@eg/core/pcrud.service';
+import {IdlObject, IdlService } from '@eg/core/idl.service';
+
+ @Component({
+ templateUrl: './edit-floating-group.component.html'
+ })
+
+ export class EditFloatingGroupComponent {
+
+ @Input() sortField: string;
+ @Input() dataSource: GridDataSource;
+ @Input() dialogSize: 'sm' | 'lg' = 'lg';
+
+ // defaultNewRecord is used when creating a new entry to give a default floating_group
+ defaultNewRecord: IdlObject;
+
+ // This is the ID of the floating group being edited currently
+ currentId: number;
+
+ constructor(
+ private route: ActivatedRoute,
+ private pcrud: PcrudService,
+ private idl: IdlService,
+ ) {
+ }
+
+ ngOnInit() {
+ this.currentId = parseInt(this.route.snapshot.paramMap.get('id'));
+ this.defaultNewRecord = this.idl.create('cfgm');
+ this.defaultNewRecord.floating_group(this.currentId);
+ this.dataSource = new GridDataSource();
+ this.dataSource.getRows = (pager: Pager, sort: any[]) => {
+ const searchOps = {
+ offset: pager.offset,
+ limit: pager.limit,
+ order_by: {}
+ };
+ return this.pcrud.search("cfgm", {floating_group: this.currentId}, searchOps);
+ };
+ }
+ }
\ No newline at end of file
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group-routing.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group-routing.module.ts
new file mode 100644
index 0000000000..4e368de66f
--- /dev/null
+++ b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group-routing.module.ts
@@ -0,0 +1,19 @@
+import {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
+import {EditFloatingGroupComponent} from './edit-floating-group.component';
+import {FloatingGroupComponent} from './floating-group.component';
+
+const routes: Routes = [{
+ path: ':id',
+ component: EditFloatingGroupComponent
+ }, {
+ path: '',
+ component: FloatingGroupComponent
+}];
+
+ at NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+
+export class FloatingGroupRoutingModule {}
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.html b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.html
new file mode 100644
index 0000000000..1895293ebb
--- /dev/null
+++ b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.html
@@ -0,0 +1,24 @@
+<eg-title i18n-prefix prefix="Floating Group Administration"></eg-title>
+<eg-staff-banner bannerText="Floating Group Configuration" i18n-bannerText>
+</eg-staff-banner>
+
+<eg-string #createString i18n-text text="New Floating Group Added"></eg-string>
+<eg-string #createErrString i18n-text text="Failed to Create New Floating Group">
+ </eg-string>
+<eg-string #deleteFailedString i18n-text text="Delete of Floating Group failed
+ or was not allowed"></eg-string>
+<eg-string #deleteSuccessString i18n-text text="Delete of Floating Group
+ succeeded"></eg-string>
+
+<eg-grid #grid idlClass="cfg" [dataSource]="gridDataSource"
+ [sortable]="true">
+ <eg-grid-toolbar-button
+ label="New Floating Group" i18n-label [action]="createNew">
+ </eg-grid-toolbar-button>
+ <eg-grid-toolbar-action label="Edit Selected" i18n-label [action]="editSelected">
+ </eg-grid-toolbar-action>
+ <eg-grid-toolbar-action label="Delete Selected" i18n-label
+ [action]="deleteSelected"></eg-grid-toolbar-action>
+</eg-grid>
+<eg-fm-record-editor #editDialog idlClass="cfg">
+</eg-fm-record-editor>
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.ts
new file mode 100644
index 0000000000..fa639ee829
--- /dev/null
+++ b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.ts
@@ -0,0 +1,81 @@
+import {Pager} from '@eg/share/util/pager';
+import {Component, Input, ViewChild} from '@angular/core';
+import { Router, ActivatedRoute } from '@angular/router';
+import {IdlService, IdlObject} from '@eg/core/idl.service';
+import {GridDataSource} from '@eg/share/grid/grid';
+import {GridComponent} from '@eg/share/grid/grid.component';
+import {ToastService} from '@eg/share/toast/toast.service';
+import {PcrudService} from '@eg/core/pcrud.service';
+import {OrgService} from '@eg/core/org.service';
+import {PermService} from '@eg/core/perm.service';
+import {AuthService} from '@eg/core/auth.service';
+import { AdminPageComponent } from '../../../share/admin-page/admin-page.component';
+
+ @Component({
+ templateUrl: './floating-group.component.html'
+ })
+
+ export class FloatingGroupComponent extends AdminPageComponent {
+
+ idlClass = 'cfg';
+ @Input() sortField: string;
+ @Input() dialogSize: 'sm' | 'lg' = 'lg';
+
+ gridDataSource: GridDataSource = new GridDataSource();
+
+ @ViewChild('grid', {static: true}) grid: GridComponent;
+
+ constructor(
+ route: ActivatedRoute,
+ idl: IdlService,
+ org: OrgService,
+ auth: AuthService,
+ pcrud: PcrudService,
+ perm: PermService,
+ toast: ToastService,
+ private router:Router
+ ) {
+ super(route, idl, org, auth, pcrud, perm, toast);
+ }
+
+ ngOnInit() {
+ super.ngOnInit();
+ this.gridDataSource.getRows = (pager: Pager, sort: any[]) => {
+ const searchOps = {
+ offset: pager.offset,
+ limit: pager.limit,
+ order_by: {}
+ };
+ return this.pcrud.retrieveAll("cfg", searchOps);
+ };
+ this.grid.onRowActivate.subscribe(
+ (idlThing: IdlObject) => {
+ let idToEdit = idlThing.a[0];
+ this.navigateToEditPage(idToEdit);
+ }
+ );
+ }
+
+ createNew = () => {
+ super.createNew();
+ };
+
+ editSelected = (floatingGroups: IdlObject[]) => {
+ let idToEdit = floatingGroups[0].a[0];
+ this.navigateToEditPage(idToEdit);
+ }
+
+ deleteSelected = (floatingGroups: IdlObject[]) => {
+ super.deleteSelected(floatingGroups);
+ }
+
+ navigateToEditPage(id: any) {
+ this.router.navigate(["/staff/admin/server/config/floating_group/" + id]);
+ }
+
+ // this was left mostly blank to ensure a modal does not open for edits
+ showEditDialog(idlThing: IdlObject): Promise<any> {
+ return;
+ }
+
+ }
\ No newline at end of file
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.module.ts
new file mode 100644
index 0000000000..a52febc342
--- /dev/null
+++ b/Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.module.ts
@@ -0,0 +1,25 @@
+import {NgModule} from '@angular/core';
+import {AdminCommonModule} from '@eg/staff/admin/common.module';
+import {TreeModule} from '@eg/share/tree/tree.module';
+import {FloatingGroupComponent} from './floating-group.component';
+import {EditFloatingGroupComponent} from './edit-floating-group.component';
+import {FloatingGroupRoutingModule} from './floating-group-routing.module';
+
+ at NgModule({
+ declarations: [
+ FloatingGroupComponent,
+ EditFloatingGroupComponent
+ ],
+ imports: [
+ AdminCommonModule,
+ FloatingGroupRoutingModule,
+ TreeModule
+ ],
+ exports: [
+ ],
+ providers: [
+ ]
+})
+
+export class FloatingGroupModule {
+}
\ No newline at end of file
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/routing.module.ts
index 6ce93653e4..55d9aa357f 100644
--- a/Open-ILS/src/eg2/src/app/staff/admin/server/routing.module.ts
+++ b/Open-ILS/src/eg2/src/app/staff/admin/server/routing.module.ts
@@ -13,6 +13,9 @@ const routes: Routes = [{
path: 'actor/org_unit_type',
component: OrgUnitTypeComponent
}, {
+ path: 'config/floating_group',
+ loadChildren: '@eg/staff/admin/server/floating-group/floating-group.module#FloatingGroupModule'
+}, {
path: 'config/print_template',
component: PrintTemplateComponent
}, {
diff --git a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html
index 00bc67a47b..285d9c9fc4 100644
--- a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html
+++ b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html
@@ -33,7 +33,7 @@
<ng-container *ngTemplateOutlet="helpTemplate"></ng-container>
</ng-container>
-<eg-grid #grid idlClass="{{idlClass}}" [dataSource]="dataSource"
+<eg-grid #grid idlClass="{{idlClass}}" [dataSource]="dataSource" hideFields={{hideFields}}
[sortable]="true" persistKey="{{persistKey}}">
<eg-grid-toolbar-button [disabled]="!canCreate"
label="New {{idlClassDef.label}}" i18n-label (onClick)="createNew()">
@@ -48,7 +48,7 @@
</eg-grid>
<eg-fm-record-editor #editDialog idlClass="{{idlClass}}"
- [fieldOptions]="fieldOptions"
+ [fieldOptions]="fieldOptions" [defaultNewRecord]="defaultNewRecord"
[preloadLinkedValues]="true" readonlyFields="{{readonlyFields}}">
</eg-fm-record-editor>
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 76c14cd7f4..db5c9be25c 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
@@ -42,6 +42,11 @@ export class AdminPageComponent implements OnInit {
// Size of create/edito dialog. Uses large by default.
@Input() dialogSize: 'sm' | 'lg' = 'lg';
+ // comma-separated list of fields to hide.
+ // This does not imply all other fields should be visible, only that
+ // the selected fields will be hidden.
+ @Input() hideFields: string;
+
// If an org unit field is specified, an org unit filter
// is added to the top of the page.
@Input() orgField: string;
@@ -75,6 +80,10 @@ export class AdminPageComponent implements OnInit {
// Override field options for create/edit dialog
@Input() fieldOptions: {[field: string]: FmFieldOptions};
+ // Override default values for fm-editor
+ @Input() defaultNewRecord: IdlObject;
+
+
@ViewChild('grid', { static: true }) grid: GridComponent;
@ViewChild('editDialog', { static: true }) editDialog: FmRecordEditorComponent;
@ViewChild('successString', { static: true }) successString: StringComponent;
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/examples/fm_IDL.xml | 12 ++--
.../src/app/share/fm-editor/fm-editor.component.ts | 15 +++-
.../edit-floating-group.component.html | 28 ++++++++
.../edit-floating-group.component.ts | 51 +++++++++++++
.../floating-group-routing.module.ts | 19 +++++
.../floating-group/floating-group.component.html | 22 ++++++
.../floating-group/floating-group.component.ts | 83 ++++++++++++++++++++++
.../server/floating-group/floating-group.module.ts | 23 ++++++
.../src/app/staff/admin/server/routing.module.ts | 3 +
.../share/admin-page/admin-page.component.html | 4 +-
.../staff/share/admin-page/admin-page.component.ts | 9 +++
11 files changed, 259 insertions(+), 10 deletions(-)
create mode 100644 Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.html
create mode 100644 Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/edit-floating-group.component.ts
create mode 100644 Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group-routing.module.ts
create mode 100644 Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.html
create mode 100644 Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.component.ts
create mode 100644 Open-ILS/src/eg2/src/app/staff/admin/server/floating-group/floating-group.module.ts
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list