<eg-string #mintConditionYes i18n-text text="Good"></eg-string>
<eg-string #mintConditionNo i18n-text text="Damaged"></eg-string>
+<eg-string #savedHoldingsTemplates i18n-text text="Saved holdings template(s)"></eg-string>
+<eg-string #deletedHoldingsTemplate i18n-text text="Deleted holdings template"></eg-string>
+
<!-- We ask this question a lot. Here's a handy template -->
<ng-template #yesNoSelect let-field="field">
<eg-combobox domId="{{field}}-input"
import {BatchItemAttrComponent, BatchChangeSelection
} from '@eg/staff/share/holdings/batch-item-attr.component';
import {FileExportService} from '@eg/share/util/file-export.service';
+import {ToastService} from '@eg/share/toast/toast.service';
@Component({
selector: 'eg-copy-attrs',
@ViewChild('mintConditionNo', {static: false})
mintConditionNo: StringComponent;
+ @ViewChild('savedHoldingsTemplates', {static: false})
+ savedHoldingsTemplates: StringComponent;
+ @ViewChild('deletedHoldingsTemplate', {static: false})
+ deletedHoldingsTemplate: StringComponent;
+
@ViewChild('copyAlertsDialog', {static: false})
private copyAlertsDialog: CopyAlertsDialogComponent;
private format: FormatService,
private store: StoreService,
private fileExport: FileExportService,
+ private toast: ToastService,
public volcopy: VolCopyService
) { }
});
this.volcopy.templates[name] = template;
- this.volcopy.saveTemplates();
+ this.volcopy.saveTemplates().then(x => {
+ this.savedHoldingsTemplates.current().then(str => this.toast.success(str));
+ if (entry.freetext) {
+ // once a new template has been added, make it
+ // display like any other in the comobox
+ this.copyTemplateCbox.selected =
+ this.volcopy.templateNames.filter(_ => _.label === name)[0];
+ }
+ });
}
exportTemplate($event) {
const entry: ComboboxEntry = this.copyTemplateCbox.selected;
if (!entry) { return; }
delete this.volcopy.templates[entry.id];
- this.volcopy.saveTemplates();
+ this.volcopy.saveTemplates().then(
+ x => this.deletedHoldingsTemplate.current().then(str => this.toast.success(str))
+ );
this.copyTemplateCbox.selected = null;
}