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>
--- /dev/null
+
+<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>
+
--- /dev/null
+import {Component, OnInit, ViewChild, TemplateRef} from '@angular/core';
+
+@Component({
+ templateUrl: './address-alert.component.html'
+})
+
+export class AddressAlertComponent {
+
+ @ViewChild('helpTemplate') helpTemplate: TemplateRef<any>;
+
+ constructor() {}
+}
+
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,
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',
component: BasicAdminPageComponent,
data: [{schema: 'config', table: 'hold_matrix_matchpoint', disableOrgFilter: true}]
}, {
+ path: 'actor/address_alert',
+ component: AddressAlertComponent
+}, {
path: ':schema/:table',
component: BasicAdminPageComponent
}];
<!-- 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"
// 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;