<class id="vibtf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_bib_trash_fields" oils_persist:tablename="vandelay.import_bib_trash_fields" reporter:label="Import/Overlay Fields for Removal">
<fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_bib_trash_fields_id_seq">
- <field reporter:label="Field ID" name="id" reporter:datatype="id"/>
+ <field reporter:label="Field ID" name="id" reporter:datatype="id" reporter:selector="field"/>
<field reporter:label="Group" name="grp" reporter:datatype="link" config_field="true"/>
<field reporter:label="Field" name="field" reporter:datatype="text"/>
</fields>
reporter:label="Import/Overlay Field Groups for Removal">
<fields oils_persist:primary="id"
oils_persist:sequence="vandelay.import_bib_trash_group_id_seq">
- <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
+ <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
<field reporter:label="Owner" name="owner" reporter:datatype="link"/>
<field reporter:label="Label" name="label" reporter:datatype="text"/>
<field reporter:label="Always Apply" name="always_apply" reporter:datatype="bool"/>
<link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
<link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
<link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
- <link field="heading" reltype="has_a" key="id" map="" class="ahf"/>
+ <link field="heading_field" reltype="has_a" key="id" map="" class="ahf"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<actions>
<class id="ahf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::heading_field" oils_persist:tablename="authority.heading_field" reporter:label="Authority Heading Fields">
<fields oils_persist:primary="id" oils_persist:sequence="authority.heading_fields_id_seq">
- <field name="id" reporter:datatype="id" />
+ <field name="id" reporter:datatype="id" reporter:selector="label" />
<field name="heading_type" reporter:datatype="text" reporter:label="Heading Type" />
<field name="heading_purpose" reporter:datatype="text" reporter:label="Heading Purpose" />
<field name="label" reporter:datatype="text" reporter:label="Heading Field Label" />
<ng-template #createErrStrTmpl i18n>Failed to create new {{idlClassDef.label}}</ng-template>
<eg-string #createErrString [template]="createErrStrTmpl"></eg-string>
-<ng-container *ngIf="orgField">
- <eg-org-family-select
- [limitPerms]="viewPerms"
- [selectedOrgId]="contextOrg.id()"
- [(ngModel)]="searchOrgs"
- (ngModelChange)="grid.reload()">
- </eg-org-family-select>
+<ng-container *ngIf="orgField || gridFilters">
+ <div class="row">
+ <div class="col-lg-6">
+ <ng-container *ngIf="orgField">
+ <eg-org-family-select
+ [limitPerms]="viewPerms"
+ [selectedOrgId]="contextOrg.id()"
+ [(ngModel)]="searchOrgs"
+ (ngModelChange)="grid.reload()">
+ </eg-org-family-select>
+ </ng-container>
+ </div>
+ <div class="col-lg-6 d-flex">
+ <div class="flex-1"></div><!-- push right -->
+ <ng-container *ngIf="gridFilters">
+ <span i18n>Filters Applied: {{gridFilters | json}}</span>
+ <a class="pl-2 font-italic"
+ [attr.href]="clearGridFiltersUrl()" i18n>Clear Filters</a>
+ </ng-container>
+ </div>
+ </div>
<hr/>
</ng-container>
} catch (E) {
console.error('Invalid grid filters provided: ', filters);
}
+
+ // Use the grid filters as the basis for our default
+ // new record (passed to fm-editor).
+ if (!this.defaultNewRecord) {
+ const rec = this.idl.create(this.idlClass);
+ Object.keys(this.gridFilters).forEach(field => {
+ // When filtering on the primary key of the current
+ // object type, avoid using it in the default new object.
+ if (rec[field] && this.pkeyField !== field) {
+ rec[field](this.gridFilters[field]);
+ }
+ });
+ this.defaultNewRecord = rec;
+ }
}
// Limit the view org selector to orgs where the user has
idlField: col.name
});
}
+
+ clearGridFiltersUrl(): string {
+ const parts = this.idlClassDef.table.split(/\./);
+ const url = this.configLinkBasePath + '/' + parts[0] + '/' + parts[1];
+ return this.ngLocation.prepareExternalUrl(url);
+ }
}