This commit is contained in:
Yuri Kuznetsov
2021-12-24 11:19:33 +02:00
parent 9f932462a8
commit 31a2ef63ec
20 changed files with 100 additions and 74 deletions
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/default-kanban', 'views/record/row-actions/default', function (Dep) {
define('views/record/row-actions/default-kanban', 'views/record/row-actions/default', function (Dep) {
return Dep.extend({
@@ -39,6 +39,7 @@ Espo.define('views/record/row-actions/default-kanban', 'views/record/row-actions
},
link: '#' + this.model.name + '/view/' + this.model.id
}];
if (this.options.statusFieldIsEditable) {
list.push({
action: 'moveOver',
@@ -48,6 +49,7 @@ Espo.define('views/record/row-actions/default-kanban', 'views/record/row-actions
}
});
}
if (this.options.acl.edit) {
list.push({
action: 'quickEdit',
@@ -58,6 +60,7 @@ Espo.define('views/record/row-actions/default-kanban', 'views/record/row-actions
link: '#' + this.model.name + '/edit/' + this.model.id
});
}
if (this.options.acl.delete) {
list.push({
action: 'quickRemove',
@@ -68,7 +71,7 @@ Espo.define('views/record/row-actions/default-kanban', 'views/record/row-actions
});
}
return list;
}
});
},
});
});
+22 -14
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/default', 'view', function (Dep) {
define('views/record/row-actions/default', 'view', function (Dep) {
return Dep.extend({
@@ -37,22 +37,27 @@ Espo.define('views/record/row-actions/default', 'view', function (Dep) {
},
afterRender: function () {
var $dd = this.$el.find('button[data-toggle="dropdown"]').parent();
let $dd = this.$el.find('button[data-toggle="dropdown"]').parent();
let isChecked = false;
$dd.on('show.bs.dropdown', () => {
let $el = this.$el.closest('.list-row');
var isChecked = false;
$dd.on('show.bs.dropdown', function () {
var $el = this.$el.closest('.list-row');
isChecked = false;
if ($el.hasClass('active')) {
isChecked = true;
}
$el.addClass('active');
}.bind(this));
$dd.on('hide.bs.dropdown', function () {
});
$dd.on('hide.bs.dropdown', () => {
if (!isChecked) {
this.$el.closest('.list-row').removeClass('active');
}
}.bind(this));
});
},
getActionList: function () {
@@ -62,8 +67,9 @@ Espo.define('views/record/row-actions/default', 'view', function (Dep) {
data: {
id: this.model.id
},
link: '#' + this.model.name + '/view/' + this.model.id
link: '#' + this.model.name + '/view/' + this.model.id,
}];
if (this.options.acl.edit) {
list.push({
action: 'quickEdit',
@@ -71,18 +77,20 @@ Espo.define('views/record/row-actions/default', 'view', function (Dep) {
data: {
id: this.model.id
},
link: '#' + this.model.name + '/edit/' + this.model.id
link: '#' + this.model.name + '/edit/' + this.model.id,
});
}
if (this.options.acl.delete) {
list.push({
action: 'quickRemove',
label: 'Remove',
data: {
id: this.model.id
id: this.model.id,
}
});
}
return list;
},
@@ -90,9 +98,9 @@ Espo.define('views/record/row-actions/default', 'view', function (Dep) {
return {
acl: this.options.acl,
actionList: this.getActionList(),
scope: this.model.name
scope: this.model.name,
};
}
});
},
});
});
@@ -26,12 +26,13 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/edit-and-remove', 'views/record/row-actions/default', function (Dep) {
define('views/record/row-actions/edit-and-remove', 'views/record/row-actions/default', function (Dep) {
return Dep.extend({
getActionList: function () {
var list = [];
if (this.options.acl.edit) {
list.push({
action: 'quickEdit',
@@ -42,6 +43,7 @@ Espo.define('views/record/row-actions/edit-and-remove', 'views/record/row-action
link: '#' + this.model.name + '/edit/' + this.model.id
});
}
if (this.options.acl.delete) {
list.push({
action: 'quickRemove',
@@ -51,9 +53,9 @@ Espo.define('views/record/row-actions/edit-and-remove', 'views/record/row-action
}
});
}
return list;
}
},
});
});
+1 -1
View File
@@ -32,7 +32,7 @@ define('views/record/row-actions/empty', 'views/record/row-actions/default', fun
getActionList: function () {
return [];
}
},
});
});
@@ -26,12 +26,13 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/relationship-edit-and-remove', 'views/record/row-actions/relationship', function (Dep) {
define('views/record/row-actions/relationship-edit-and-remove', 'views/record/row-actions/relationship', function (Dep) {
return Dep.extend({
getActionList: function () {
var list = [];
if (this.options.acl.edit) {
list.push({
action: 'quickEdit',
@@ -41,6 +42,7 @@ Espo.define('views/record/row-actions/relationship-edit-and-remove', 'views/reco
}
});
}
if (this.options.acl.delete) {
list.push({
action: 'quickRemove',
@@ -51,8 +53,7 @@ Espo.define('views/record/row-actions/relationship-edit-and-remove', 'views/reco
});
}
return list;
}
},
});
});
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/relationship-no-remove', 'views/record/row-actions/relationship', function (Dep) {
define('views/record/row-actions/relationship-no-remove', 'views/record/row-actions/relationship', function (Dep) {
return Dep.extend({
@@ -39,6 +39,7 @@ Espo.define('views/record/row-actions/relationship-no-remove', 'views/record/row
},
link: '#' + this.model.name + '/view/' + this.model.id
}];
if (this.options.acl.edit) {
list.push({
action: 'quickEdit',
@@ -58,9 +59,9 @@ Espo.define('views/record/row-actions/relationship-no-remove', 'views/record/row
});
}
}
return list;
}
},
});
});
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/relationship-no-unlink', 'views/record/row-actions/relationship', function (Dep) {
define('views/record/row-actions/relationship-no-unlink', 'views/record/row-actions/relationship', function (Dep) {
return Dep.extend({
@@ -39,6 +39,7 @@ Espo.define('views/record/row-actions/relationship-no-unlink', 'views/record/row
},
link: '#' + this.model.name + '/view/' + this.model.id
}];
if (this.options.acl.edit) {
list = list.concat([
{
@@ -51,6 +52,7 @@ Espo.define('views/record/row-actions/relationship-no-unlink', 'views/record/row
}
]);
}
if (this.options.acl.delete) {
list.push({
action: 'removeRelated',
@@ -60,8 +62,9 @@ Espo.define('views/record/row-actions/relationship-no-unlink', 'views/record/row
}
});
}
return list;
}
},
});
});
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/relationship-remove-only', 'views/record/row-actions/relationship', function (Dep) {
define('views/record/row-actions/relationship-remove-only', 'views/record/row-actions/relationship', function (Dep) {
return Dep.extend({
@@ -42,9 +42,7 @@ Espo.define('views/record/row-actions/relationship-remove-only', 'views/record/r
}
];
}
}
},
});
});
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/relationship-unlink-only', 'views/record/row-actions/relationship', function (Dep) {
define('views/record/row-actions/relationship-unlink-only', 'views/record/row-actions/relationship', function (Dep) {
return Dep.extend({
@@ -42,6 +42,7 @@ Espo.define('views/record/row-actions/relationship-unlink-only', 'views/record/r
}
];
}
}
},
});
});
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/relationship-view-and-edit', 'views/record/row-actions/relationship', function (Dep) {
define('views/record/row-actions/relationship-view-and-edit', 'views/record/row-actions/relationship', function (Dep) {
return Dep.extend({
@@ -39,6 +39,7 @@ Espo.define('views/record/row-actions/relationship-view-and-edit', 'views/record
},
link: '#' + this.model.name + '/view/' + this.model.id
}];
if (this.options.acl.edit) {
list.push({
action: 'quickEdit',
@@ -49,10 +50,10 @@ Espo.define('views/record/row-actions/relationship-view-and-edit', 'views/record
link: '#' + this.model.name + '/edit/' + this.model.id
});
}
return list;
},
});
});
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/relationship-view-and-unlink', 'views/record/row-actions/relationship', function (Dep) {
define('views/record/row-actions/relationship-view-and-unlink', 'views/record/row-actions/relationship', function (Dep) {
return Dep.extend({
@@ -39,6 +39,7 @@ Espo.define('views/record/row-actions/relationship-view-and-unlink', 'views/reco
},
link: '#' + this.model.name + '/view/' + this.model.id
}];
if (this.options.acl.edit && !this.options.unlinkDisabled) {
list.push({
action: 'unlinkRelated',
@@ -52,5 +53,4 @@ Espo.define('views/record/row-actions/relationship-view-and-unlink', 'views/reco
},
});
});
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/relationship', 'views/record/row-actions/default', function (Dep) {
define('views/record/row-actions/relationship', 'views/record/row-actions/default', function (Dep) {
return Dep.extend({
@@ -39,6 +39,7 @@ Espo.define('views/record/row-actions/relationship', 'views/record/row-actions/d
},
link: '#' + this.model.name + '/view/' + this.model.id
}];
if (this.options.acl.edit) {
list.push({
action: 'quickEdit',
@@ -48,6 +49,7 @@ Espo.define('views/record/row-actions/relationship', 'views/record/row-actions/d
},
link: '#' + this.model.name + '/edit/' + this.model.id
});
if (!this.options.unlinkDisabled) {
list.push({
action: 'unlinkRelated',
@@ -68,9 +70,9 @@ Espo.define('views/record/row-actions/relationship', 'views/record/row-actions/d
}
});
}
return list;
}
},
});
});
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/view-and-edit', 'views/record/row-actions/default', function (Dep) {
define('views/record/row-actions/view-and-edit', 'views/record/row-actions/default', function (Dep) {
return Dep.extend({
@@ -39,6 +39,7 @@ Espo.define('views/record/row-actions/view-and-edit', 'views/record/row-actions/
},
link: '#' + this.model.name + '/view/' + this.model.id
}];
if (this.options.acl.edit) {
list = list.concat([
{
@@ -51,11 +52,9 @@ Espo.define('views/record/row-actions/view-and-edit', 'views/record/row-actions/
}
]);
}
return list;
}
},
});
});
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/view-and-remove', 'views/record/row-actions/default', function (Dep) {
define('views/record/row-actions/view-and-remove', 'views/record/row-actions/default', function (Dep) {
return Dep.extend({
@@ -39,6 +39,7 @@ Espo.define('views/record/row-actions/view-and-remove', 'views/record/row-action
},
link: '#' + this.model.name + '/view/' + this.model.id
}];
if (this.options.acl.delete) {
actionList.push({
action: 'quickRemove',
@@ -49,8 +50,9 @@ Espo.define('views/record/row-actions/view-and-remove', 'views/record/row-action
});
}
return actionList;
}
});
return actionList;
},
});
});
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/view-only', 'views/record/row-actions/default', function (Dep) {
define('views/record/row-actions/view-only', 'views/record/row-actions/default', function (Dep) {
return Dep.extend({
@@ -41,10 +41,7 @@ Espo.define('views/record/row-actions/view-only', 'views/record/row-actions/defa
link: '#' + this.model.name + '/view/' + this.model.id
}
];
}
},
});
});