LP1837059 Address alert config help text
authorBill Erickson <berickxx@gmail.com>
Thu, 1 Aug 2019 14:36:06 +0000 (10:36 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 6 Aug 2019 00:56:59 +0000 (20:56 -0400)
Support passing a helpTemplate value to the staff admin page builder.
Create an Address Alert component so it may define and pass its own help
text to the admin page builder.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/staff/admin/local/address-alert.component.html [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/admin/local/address-alert.component.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/admin/local/admin-local.module.ts
Open-ILS/src/eg2/src/app/staff/admin/local/routing.module.ts
Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html
Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts

diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/address-alert.component.html b/Open-ILS/src/eg2/src/app/staff/admin/local/address-alert.component.html
new file mode 100644 (file)
index 0000000..892a465
--- /dev/null
@@ -0,0 +1,17 @@
+
+<ng-template #helpTemplate>
+  <ul>
+    <li>Address Alert fields support regular expressions and are case-insensitive by default.</li>
+    <li>Example wildcard match:  742 Evergr.*n Terrace</li>
+    <li>Example case-sensitive match: (?c)742 Evergr.*n Terrace</li>
+    <li>If the billing or mailing address fields are selected, the 
+      tested address must be a billing or mailing address to match.</li>
+  </ul>
+</ng-template>
+
+<eg-title i18n-prefix prefix="Address Alert Administration"></eg-title>
+<eg-staff-banner bannerText="Address Alert Configuration" i18n-bannerText>
+</eg-staff-banner>
+<eg-admin-page persistKeyPfx="local" idlClass="aal"
+  [helpTemplate]="helpTemplate"></eg-admin-page>
+
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/address-alert.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/local/address-alert.component.ts
new file mode 100644 (file)
index 0000000..56d37d3
--- /dev/null
@@ -0,0 +1,13 @@
+import {Component, OnInit, ViewChild, TemplateRef} from '@angular/core';
+
+@Component({
+    templateUrl: './address-alert.component.html'
+})
+
+export class AddressAlertComponent {
+
+    @ViewChild('helpTemplate') helpTemplate: TemplateRef<any>;
+
+    constructor() {}
+}
+
index a18d3e6..c2b5041 100644 (file)
@@ -4,10 +4,12 @@ import {StaffCommonModule} from '@eg/staff/common.module';
 import {AdminLocalRoutingModule} from './routing.module';
 import {AdminCommonModule} from '@eg/staff/admin/common.module';
 import {AdminLocalSplashComponent} from './admin-local-splash.component';
+import {AddressAlertComponent} from './address-alert.component';
 
 @NgModule({
   declarations: [
-      AdminLocalSplashComponent
+      AdminLocalSplashComponent,
+      AddressAlertComponent
   ],
   imports: [
     AdminCommonModule,
index c46dec9..12030dd 100644 (file)
@@ -2,6 +2,7 @@ import {NgModule} from '@angular/core';
 import {RouterModule, Routes} from '@angular/router';
 import {AdminLocalSplashComponent} from './admin-local-splash.component';
 import {BasicAdminPageComponent} from '@eg/staff/admin/basic-admin-page.component';
+import {AddressAlertComponent} from './address-alert.component';
 
 const routes: Routes = [{
     path: 'splash',
@@ -11,6 +12,9 @@ const routes: Routes = [{
     component: BasicAdminPageComponent,
     data: [{schema: 'config', table: 'hold_matrix_matchpoint', disableOrgFilter: true}]
 }, {
+    path: 'actor/address_alert',
+    component: AddressAlertComponent
+}, {
     path: ':schema/:table',
     component: BasicAdminPageComponent
 }];
index ab6c263..a69dabd 100644 (file)
 <!-- idlObject and fieldName applied programmatically -->
 <eg-translate #translator></eg-translate>
 
+<ng-container *ngIf="helpTemplate">
+  <ng-container *ngTemplateOutlet="helpTemplate"></ng-container>
+</ng-container>
+
 <eg-grid #grid idlClass="{{idlClass}}" [dataSource]="dataSource" 
     [sortable]="true" persistKey="{{persistKey}}" [showLinkSelectors]="true">
   <eg-grid-toolbar-button [disabled]="!canCreate" 
index 88f9525..f920d7b 100644 (file)
@@ -67,6 +67,10 @@ export class AdminPageComponent implements OnInit {
     // Optional comma-separated list of read-only fields
     @Input() readonlyFields: string;
 
+    // Optional template containing help/about text which will
+    // be added to the page, above the grid.
+    @Input() helpTemplate: TemplateRef<any>;
+
     @ViewChild('grid') grid: GridComponent;
     @ViewChild('editDialog') editDialog: FmRecordEditorComponent;
     @ViewChild('successString') successString: StringComponent;