<eg-link-table-link i18n-label label="Permission Tree Display Entries"
url="/eg/staff/admin/local/permission/grp_tree_display_entry"></eg-link-table-link>
<eg-link-table-link i18n-label label="Search Filter Groups"
- url="/eg/staff/admin/local/actor/search_filter_group"></eg-link-table-link>
+ routerLink="/staff/admin/local/actor/search_filter_group"></eg-link-table-link>
<eg-link-table-link i18n-label label="Shelving Location Groups"
url="/eg/staff/admin/local/asset/copy_location_group"></eg-link-table-link>
<eg-link-table-link i18n-label label="Shelving Location Order"
path: 'container/carousel',
component: AdminCarouselComponent
}, {
+ path: 'actor/search_filter_group',
+ loadChildren: '@eg/staff/admin/local/search-filter/search-filter-group.module#SearchFilterGroupModule'
+}, {
path: 'config/standing_penalty',
component: StandingPenaltyComponent
}, {
--- /dev/null
+<eg-title i18n-prefix prefix="Search Filter Group Entries Configuration"></eg-title>
+<eg-staff-banner bannerText="Search Filter Group" i18n-bannerText>
+</eg-staff-banner>
+
+<div class="col-lg-6 offset-lg-3">
+ <eg-fm-record-editor displayMode="inline" hiddenFieldsList="id,create_date"
+ idlClass="asfg" mode="update" recordId="{{this.currentId}}">
+ </eg-fm-record-editor>
+</div>
+
+<eg-staff-banner bannerText="Search Filter Group Entries Configuration" i18n-bannerText>
+</eg-staff-banner>
+<eg-admin-page idlClass="asfge" disableOrgFilter="true"
+ [dataSource]="dataSource">
+</eg-admin-page>
+<!-- [defaultNewRecord]="defaultNewRecord" -->
--- /dev/null
+import {Component, Input} from '@angular/core';
+import {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: './search-filter-group-entries.component.html'
+ })
+
+ export class SearchFilterGroupEntriesComponent {
+
+ @Input() idlClass = 'asfge';
+ @Input() sortField: string;
+ @Input() dataSource: GridDataSource;
+ @Input() dialogSize: 'sm' | 'lg' = 'lg';
+
+ // This is the ID of the search filter group being edited currently
+ currentId: number;
+ defaultNewRecord: IdlObject;
+
+ 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('asfge');
+ this.defaultNewRecord.grp(this.currentId);
+ this.dataSource = new GridDataSource();
+ this.dataSource.getRows = (pager: Pager, sort: any[]) => {
+ const searchOps = {
+ offset: pager.offset,
+ limit: pager.limit,
+ order_by: {},
+ flesh: 1,
+ flesh_fields: {asfge: ["query"]}
+ };
+ return this.pcrud.search(this.idlClass, {grp: this.currentId}, searchOps);
+ };
+ }
+ }
\ No newline at end of file
--- /dev/null
+import {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
+import {SearchFilterGroupComponent} from './search-filter-group.component';
+import {SearchFilterGroupEntriesComponent} from './search-filter-group-entries.component';
+
+const routes: Routes = [{
+ path: ':id',
+ component: SearchFilterGroupEntriesComponent
+ }, {
+ path: '',
+ component: SearchFilterGroupComponent
+}];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+
+export class SearchFilterGroupRoutingModule {}
--- /dev/null
+<eg-title i18n-prefix prefix="Search Filter Group Administration"></eg-title>
+<eg-staff-banner bannerText="Search Filter Group Configuration" i18n-bannerText>
+</eg-staff-banner>
+
+<eg-string #createString i18n-text text="New Search Filter Group Added"></eg-string>
+<eg-string #createErrString i18n-text text="Failed to Create New Search Filter Group">
+</eg-string>
+<eg-string #deleteFailedString i18n-text text="Delete of Search Filter Group failed or
+ was not allowed">
+</eg-string>
+<eg-string #deleteSuccessString i18n-text text="Delete of Search Filter Group succeeded">
+</eg-string>
+
+<eg-grid #grid idlClass="asfg" [dataSource]="gridDataSource"
+[sortable]="true" persistKey="{{persistKey}}">
+<eg-grid-column label="ID" path="id" name="id" datatype="id" [hidden]="true"></eg-grid-column>
+ <eg-grid-toolbar-button
+ label="New Search Filter 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
+ (onClick)="deleteSelected($event)">
+ </eg-grid-toolbar-action>
+</eg-grid>
+
+<eg-fm-record-editor #editDialog idlClass="asfg">
+</eg-fm-record-editor>
\ No newline at end of file
--- /dev/null
+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 {StringComponent} from '@eg/share/string/string.component';
+import { AdminPageComponent } from '../../../share/admin-page/admin-page.component';
+
+ @Component({
+ templateUrl: './search-filter-group.component.html'
+ })
+
+ export class SearchFilterGroupComponent extends AdminPageComponent {
+
+ @Input() idlClass: string = "asfg";
+ @Input() sortField: string;
+ @Input() gridDataSource: GridDataSource;
+ @Input() dialogSize: 'sm' | 'lg' = 'lg';
+
+ @ViewChild('grid') grid: GridComponent;
+ @ViewChild('createString') createString: StringComponent;
+ @ViewChild('createErrString') createErrString: StringComponent;
+ @ViewChild('deleteFailedString') deleteFailedString: StringComponent;
+ @ViewChild('deleteSuccessString') deleteSuccessString: StringComponent;
+
+ 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() {
+ this.gridDataSource = new GridDataSource();
+ this.gridDataSource.getRows = (pager: Pager, sort: any[]) => {
+ const searchOps = {
+ offset: pager.offset,
+ limit: pager.limit,
+ order_by: {}
+ };
+ return this.pcrud.retrieveAll("asfg", searchOps);
+ };
+ this.grid.onRowActivate.subscribe(
+ (idlThing: IdlObject) => {
+ let idToEdit = idlThing.a[0];
+ this.navigateToEditPage(idToEdit);
+ }
+ );
+ }
+
+ createNew = () => {
+ this.editDialog.mode = 'create';
+ this.editDialog.recordId = null;
+ this.editDialog.record = null;
+ this.editDialog.hiddenFieldsList=["id","create_date"]
+ this.editDialog.open({size: this.dialogSize}).subscribe(
+ ok => {
+ this.createString.current()
+ .then(str => this.toast.success(str));
+ this.grid.reload();
+ },
+ rejection => {
+ if (!rejection.dismissed) {
+ this.createErrString.current()
+ .then(str => this.toast.danger(str));
+ }
+ }
+ );
+ };
+
+ editSelected = (sfGroups: IdlObject[]) => {
+ let idToEdit = sfGroups[0].a[0];
+ this.navigateToEditPage(idToEdit);
+ }
+
+ navigateToEditPage(id: any) {
+ this.router.navigate(["/staff/admin/local/actor/search_filter_group/" + id]);
+ }
+
+ showEditDialog(idlThing: IdlObject): Promise<any> {
+ return;
+ }
+
+ }
\ No newline at end of file
--- /dev/null
+import {NgModule} from '@angular/core';
+import {AdminCommonModule} from '@eg/staff/admin/common.module';
+import {TreeModule} from '@eg/share/tree/tree.module';
+import {SearchFilterGroupComponent} from './search-filter-group.component';
+import {SearchFilterGroupEntriesComponent} from './search-filter-group-entries.component';
+import {SearchFilterGroupRoutingModule} from './search-filter-group-routing.module';
+
+@NgModule({
+ declarations: [
+ SearchFilterGroupComponent,
+ SearchFilterGroupEntriesComponent
+ ],
+ imports: [
+ AdminCommonModule,
+ SearchFilterGroupRoutingModule,
+ TreeModule
+ ],
+ exports: [
+ ],
+ providers: [
+ ]
+})
+
+export class SearchFilterGroupModule {
+}
\ No newline at end of file