row actions kanban

This commit is contained in:
Yuri Kuznetsov
2023-11-05 12:42:03 +02:00
parent 4b9321eda8
commit eec173e476
4 changed files with 11 additions and 3 deletions
+3
View File
@@ -94,6 +94,9 @@ class KanbanRecordItem extends View {
model: this.model,
acl: acl,
statusFieldIsEditable: this.options.statusFieldIsEditable,
rowActionHandlers: this.options.rowActionHandlers || {},
additionalActionList: this.options.additionalRowActionList,
scope: this.options.scope,
});
}
}
+5
View File
@@ -283,6 +283,8 @@ class KanbanRecordView extends ListRecordView {
this.seedCollection.orderBy = this.collection.defaultOrderBy;
this.seedCollection.order = this.collection.defaultOrder;
this.setupRowActionDefs();
this.listenTo(this.collection, 'sync', () => {
if (this.hasView('modal') && this.getView('modal').isRendered()) {
return;
@@ -835,8 +837,11 @@ class KanbanRecordView extends ListRecordView {
itemLayout: this.listLayout,
rowActionsDisabled: this.rowActionsDisabled,
rowActionsView: this.rowActionsView,
rowActionHandlers: this._rowActionHandlers || {},
setViewBeforeCallback: this.options.skipBuildRows && !this.isRendered(),
statusFieldIsEditable: this.statusFieldIsEditable,
additionalRowActionList: this._additionalRowActionList,
scope: this.scope,
}, callback);
}
+2 -2
View File
@@ -1984,8 +1984,6 @@ class ListRecordView extends View {
this.layoutName += 'Portal';
}
this._rowActionHandlers = {};
this.setupRowActionDefs();
this.wait(
@@ -3289,6 +3287,8 @@ class ListRecordView extends View {
}
setupRowActionDefs() {
this._rowActionHandlers = {};
const list = this.options.additionalRowActionList;
if (!list) {
@@ -37,7 +37,7 @@ class DefaultRowActionsView extends View {
setup() {
this.options.acl = this.options.acl || {};
this.scope = this.options.scope;
this.scope = this.options.scope || this.model.entityType;
/** @type {Object.<string, {isAvailable: function(module:model, string)}>} */
this.handlers = this.options.rowActionHandlers || {};