@ViewChild('editDialog') editDialog: FmRecordEditorComponent;
@ViewChild('successString') successString: StringComponent;
@ViewChild('createString') createString: StringComponent;
+ @ViewChild('createErrString') createErrString: StringComponent;
+ @ViewChild('updateFailedString') updateFailedString: StringComponent;
@ViewChild('translator') translator: TranslateComponent;
idlClassDef: any;
// Edit each IDL thing one at a time
const editOneThing = (thing: IdlObject) => {
- if (!thing) return;
+ if (!thing) { return; }
this.showEditDialog(thing).then(
() => editOneThing(idlThings.shift()));
- }
+ };
- editOneThing(idlThings.shift()); };
+ editOneThing(idlThings.shift());
+ };
this.createNew = () => {
this.editDialog.mode = 'create';
.then(str => this.toast.success(str));
this.grid.reload();
},
- err => {}
+ rejection => {
+ if (!rejection.dismissed) {
+ this.createErrString.current()
+ .then(str => this.toast.danger(str));
+ }
+ }
);
};
const search = {};
search[this.orgField] = orgs;
- return this.pcrud.search(this.idlClass, search, searchOps);
+ return this.pcrud.search(
+ this.idlClass, search, searchOps, {fleshSelectors: true});
}
// No org filter -- fetch all rows
- return this.pcrud.retrieveAll(this.idlClass, searchOps);
+ return this.pcrud.retrieveAll(
+ this.idlClass, searchOps, {fleshSelectors: true});
};
}
.then(str => this.toast.success(str));
this.grid.reload();
},
- err => {}
+ rejection => {
+ if (!rejection.dismissed) {
+ this.updateFailedString.current()
+ .then(str => this.toast.danger(str));
+ }
+ }
);
}