diff --git a/application/Espo/Resources/i18n/en_US/FieldManager.json b/application/Espo/Resources/i18n/en_US/FieldManager.json index 79a2f1ecbd..8f2302bebf 100644 --- a/application/Espo/Resources/i18n/en_US/FieldManager.json +++ b/application/Espo/Resources/i18n/en_US/FieldManager.json @@ -164,6 +164,7 @@ "linkMultiple": "A set of records related through Has-Many (many-to-many or one-to-many) relationship. Not all relationships have their link-multiple fields. Only those do, where Link-Multiple parameter(s) is enabled." }, "messages": { + "fieldCreatedAddToLayouts": "Field has been created. Now, you can add it to [layouts]({link})", "confirmRemove": "Are you sure you want to remove the *{field}* field?\n\nField removal does not remove data from the database. Data from the database will be removed if you run hard rebuild.", "fieldNameIsNotAllowed": "Field name '{field}' is not allowed.", "fieldAlreadyExists": "Field '{field}' already exists in '{entityType}'.", diff --git a/client/src/views/admin/field-manager/index.js b/client/src/views/admin/field-manager/index.js index 04f2d24f7f..5b3f1ac512 100644 --- a/client/src/views/admin/field-manager/index.js +++ b/client/src/views/admin/field-manager/index.js @@ -179,7 +179,7 @@ class IndexFieldManagerView extends View { this.type = type; this.getRouter() - .navigate(`#Admin/fieldManager/scope=${scope}&type=${type}&create=true`, {trigger: false}); + .navigate('#Admin/fieldManager/scope=' + scope + '&type=' + type + '&create=true', {trigger: false}); Espo.Ui.notify(' ... '); @@ -196,7 +196,18 @@ class IndexFieldManagerView extends View { view.once('after:save', () => { this.openScope(this.scope); - Espo.Ui.success(this.translate('Created')); + if (!this.getMetadata().get(`scopes.${this.scope}.layouts`)) { + Espo.Ui.success(this.translate('Created'), {suppress: true}); + + return; + } + + const message = this.translate('fieldCreatedAddToLayouts', 'messages', 'FieldManager') + .replace('{link}', `#Admin/layouts/scope=${this.scope}&em=true`); + + setTimeout(() => { + Espo.Ui.notify(message, 'success', undefined, {closeButton: true}); + }, 100); }); }); } diff --git a/client/src/views/admin/layouts/index.js b/client/src/views/admin/layouts/index.js index fd9060f655..d4fd441622 100644 --- a/client/src/views/admin/layouts/index.js +++ b/client/src/views/admin/layouts/index.js @@ -145,6 +145,9 @@ class LayoutIndexView extends View { } afterRender() { + // To ensure notify about added field is closed. When followed to here from the field manager. + Espo.Ui.notify(); + this.controlActiveButton(); }