From 594a111bc30ba7d01ceece850652b96e5b989dec Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 26 Apr 2018 11:46:09 +0300 Subject: [PATCH] fix import panels --- client/src/views/import/record/detail.js | 1 - client/src/views/import/record/panels/duplicates.js | 6 +++++- client/src/views/import/record/panels/imported.js | 8 ++++---- client/src/views/import/record/panels/updated.js | 10 +++++++--- client/src/views/record/panels/relationship.js | 4 ++-- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/client/src/views/import/record/detail.js b/client/src/views/import/record/detail.js index 4d60f70a6d..e08865b8d6 100644 --- a/client/src/views/import/record/detail.js +++ b/client/src/views/import/record/detail.js @@ -80,4 +80,3 @@ Espo.define('views/import/record/detail', 'views/record/detail', function (Dep) }); }); - diff --git a/client/src/views/import/record/panels/duplicates.js b/client/src/views/import/record/panels/duplicates.js index 8ad14b89f4..e8fb83c942 100644 --- a/client/src/views/import/record/panels/duplicates.js +++ b/client/src/views/import/record/panels/duplicates.js @@ -32,6 +32,11 @@ Espo.define('views/import/record/panels/duplicates', 'views/import/record/panels link: 'duplicates', + setup: function () { + this.title = this.title || this.translate('Duplicates', 'labels', 'Import'); + Dep.prototype.setup.call(this); + }, + actionUnmarkAsDuplicate: function (data) { var id = data.id; var type = data.type; @@ -49,4 +54,3 @@ Espo.define('views/import/record/panels/duplicates', 'views/import/record/panels }); }); - diff --git a/client/src/views/import/record/panels/imported.js b/client/src/views/import/record/panels/imported.js index f76bf71848..a1fa817f82 100644 --- a/client/src/views/import/record/panels/imported.js +++ b/client/src/views/import/record/panels/imported.js @@ -26,21 +26,21 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -Espo.define('Views.Import.Record.Panels.Imported', 'Views.Record.Panels.Relationship', function (Dep) { +Espo.define('views/import/record/panels/imported', 'views/record/panels/relationship', function (Dep) { return Dep.extend({ link: 'imported', - readOlny: true, + readOnly: true, - rowActionsView: 'Record.RowActions.RelationshipNoUnlink', + rowActionsView: 'views/record/row-actions/relationship-no-unlink', setup: function () { this.scope = this.model.get('entityType'); + this.title = this.title || this.translate('Imported', 'labels', 'Import'); Dep.prototype.setup.call(this); } }); }); - diff --git a/client/src/views/import/record/panels/updated.js b/client/src/views/import/record/panels/updated.js index 67026680ce..bfe4a30e7f 100644 --- a/client/src/views/import/record/panels/updated.js +++ b/client/src/views/import/record/panels/updated.js @@ -26,14 +26,18 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -Espo.define('Views.Import.Record.Panels.Updated', 'Views.Import.Record.Panels.Imported', function (Dep) { +Espo.define('views/import/record/panels/updated', 'views/import/record/panels/imported', function (Dep) { return Dep.extend({ link: 'updated', - rowActionsView: 'Record.RowActions.RelationshipViewAndEdit', + rowActionsView: 'views/record/row-actions/relationship-view-and-edit', + + setup: function () { + this.title = this.title || this.translate('Updated', 'labels', 'Import'); + Dep.prototype.setup.call(this); + }, }); }); - diff --git a/client/src/views/record/panels/relationship.js b/client/src/views/record/panels/relationship.js index 55a358ca1e..39f8ea3dd3 100644 --- a/client/src/views/record/panels/relationship.js +++ b/client/src/views/record/panels/relationship.js @@ -54,7 +54,7 @@ Espo.define('views/record/panels/relationship', ['views/record/panels/bottom', ' if (!this.scope && !(this.link in this.model.defs.links)) { throw new Error('Link \'' + this.link + '\' is not defined in model \'' + this.model.name + '\''); } - this.title = this.translate(this.link, 'links', this.model.name); + this.title = this.title || this.translate(this.link, 'links', this.model.name); this.scope = this.scope || this.model.defs.links[this.link].entity; if (!this.getConfig().get('scopeColorsDisabled')) { @@ -66,7 +66,7 @@ Espo.define('views/record/panels/relationship', ['views/record/panels/bottom', ' var url = this.url || this.model.name + '/' + this.model.id + '/' + this.link; - if (!this.readOlny && !this.defs.readOnly) { + if (!this.readOnly && !this.defs.readOnly) { if (!('create' in this.defs)) { this.defs.create = true; }