This commit is contained in:
Yuri Kuznetsov
2025-02-21 16:22:06 +02:00
parent dc527c2cf6
commit 1bcb8349de
2 changed files with 22 additions and 40 deletions
+11 -20
View File
@@ -1221,28 +1221,19 @@ class LinkMultipleFieldView extends BaseFieldView {
});
}
actionCreateLink() {
const viewName = this.getMetadata().get(['clientDefs', this.foreignScope, 'modalViews', 'edit']) ||
'views/modals/edit';
/**
* @protected
*/
async actionCreateLink() {
const helper = new RecordModal();
Espo.Ui.notifyWait();
const attributes = await this.getCreateAttributesProvider()();
this.getCreateAttributesProvider()().then(attributes => {
this.createView('dialog', viewName, {
scope: this.foreignScope,
fullFormDisabled: true,
attributes: attributes,
}, view => {
view.render()
.then(() => Espo.Ui.notify(false));
this.listenToOnce(view, 'after:save', model => {
view.close();
this.clearView('dialog');
this.select([model]);
});
});
await helper.showCreate(this, {
entityType: this.foreignScope,
fullFormDisabled: true,
attributes: attributes,
afterSave: model => this.select([model]),
});
}
+11 -20
View File
@@ -1333,28 +1333,19 @@ class LinkFieldView extends BaseFieldView {
return undefined;
}
actionCreateLink() {
const viewName = this.getMetadata().get(['clientDefs', this.foreignScope, 'modalViews', 'edit']) ||
'views/modals/edit';
/**
* @protected
*/
async actionCreateLink() {
const helper = new RecordModal();
Espo.Ui.notifyWait();
const attributes = await this.getCreateAttributesProvider()();
this.getCreateAttributesProvider()().then(attributes => {
this.createView('dialog', viewName, {
scope: this.foreignScope,
fullFormDisabled: true,
attributes: attributes,
}, view => {
view.render()
.then(() => Espo.Ui.notify(false));
this.listenToOnce(view, 'after:save', model => {
view.close();
this.clearView('dialog');
this.select(model);
});
});
await helper.showCreate(this, {
entityType: this.foreignScope,
fullFormDisabled: true,
attributes: attributes,
afterSave: model => this.select(model),
});
}