fix entity manager edit

This commit is contained in:
Yuri Kuznetsov
2022-04-27 10:14:09 +03:00
parent 4b17896ff1
commit 4e7779ee48
2 changed files with 6 additions and 3 deletions
@@ -391,6 +391,7 @@ define('views/admin/entity-manager/edit', ['view', 'model'], function (Dep, Mode
hasColorField: this.hasColorField,
hasStreamField: this.hasStreamField,
isCustom: this.isCustom,
subjectEntityType: this.scope,
}).then(view => {
this.listenTo(view, 'save', () => this.actionSave());
this.listenTo(view, 'cancel', () => this.actionCancel());
@@ -47,6 +47,8 @@ define('views/admin/entity-manager/record/edit', 'views/record/edit', function (
this.scope = 'EntityManager';
this.subjectEntityType = this.options.subjectEntityType;
if (!this.isCreate) {
this.buttonList = [
{
@@ -165,7 +167,7 @@ define('views/admin/entity-manager/record/edit', 'views/record/edit', function (
let statusField = this.model.get('statusField');
var optionList = this.getMetadata()
.get(['entityDefs', this.scope, 'fields', statusField, 'options']) || [];
.get(['entityDefs', this.subjectEntityType, 'fields', statusField, 'options']) || [];
this.setFieldOptionList('kanbanStatusIgnoreList', optionList);
@@ -186,8 +188,8 @@ define('views/admin/entity-manager/record/edit', 'views/record/edit', function (
var statusField = this.model.get('statusField');
var translation = this.getMetadata()
.get(['entityDefs', this.scope, 'fields', statusField, 'translation']) ||
this.scope + '.options.' + statusField;
.get(['entityDefs', this.subjectEntityType, 'fields', statusField, 'translation']) ||
this.subjectEntityType + '.options.' + statusField;
fieldView.params.translation = translation;
fieldView.setupTranslation();