This commit is contained in:
Yuri Kuznetsov
2024-02-27 10:18:40 +02:00
parent e451126af7
commit d7804bfa79
2 changed files with 33 additions and 38 deletions
+6 -12
View File
@@ -50,21 +50,15 @@ class NoteStreamView extends View {
*/
messageData = null
/**
* @protected
*/
/** @protected */
isEditable = false
/**
* @protected
*/
/** @protected */
isRemovable = false
/**
* @protected
*/
/** @protected */
isSystemAvatar = false
rowActionsView = 'views/stream/record/row-actions/default'
data() {
return {
isUserStream: this.isUserStream,
@@ -115,7 +109,7 @@ class NoteStreamView extends View {
};
if (!this.options.noEdit && (this.isEditable || this.isRemovable)) {
this.createView('right', 'views/stream/row-actions/default', {
this.createView('right', this.rowActionsView, {
selector: '.right-container',
acl: this.options.acl,
model: this.model,
@@ -26,34 +26,35 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/stream/row-actions/default', ['views/record/row-actions/edit-and-remove'], function (Dep) {
import DefaultRowActionsView from 'views/record/row-actions/default';
return Dep.extend({
class StreamDefaultNoteRowActionsView extends DefaultRowActionsView {
getActionList: function () {
var list = [];
getActionList() {
const list = [];
if (this.options.acl.edit && this.options.isEditable) {
list.push({
action: 'quickEdit',
label: 'Edit',
data: {
id: this.model.id,
},
});
}
if (this.options.acl.edit && this.options.isEditable) {
list.push({
action: 'quickEdit',
label: 'Edit',
data: {
id: this.model.id,
},
});
}
if (this.options.acl.edit && this.options.isRemovable) {
list.push({
action: 'quickRemove',
label: 'Remove',
data: {
id: this.model.id,
},
});
}
if (this.options.acl.edit && this.options.isRemovable) {
list.push({
action: 'quickRemove',
label: 'Remove',
data: {
id: this.model.id,
},
});
}
return list;
},
});
});
return list;
}
}
export default StreamDefaultNoteRowActionsView;