email account filters

This commit is contained in:
Yuri Kuznetsov
2024-03-30 10:07:38 +02:00
parent 5e1c12f4b1
commit df9633503b
3 changed files with 44 additions and 26 deletions
@@ -0,0 +1,3 @@
[
"assignedUser"
]
@@ -9,7 +9,6 @@
"list": "views/email-account/list"
},
"inlineEditDisabled": true,
"searchPanelDisabled": true,
"formDependency": {
"storeSentEmails": {
"map": {
+41 -25
View File
@@ -26,35 +26,51 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/email-account/list', ['views/list'], function (Dep) {
import ListView from 'views/list';
return Dep.extend({
class EmailAccountListView extends ListView {
keepCurrentRootUrl: true,
keepCurrentRootUrl = true
setup: function () {
Dep.prototype.setup.call(this);
setup() {
this.options.params = this.options.params || {};
const params = this.options.params || {};
this.options.params = this.options.params || {};
this.userId = params.userId;
var params = this.options.params || {};
if (params.userId) {
this.collection.where = [{
type: 'equals',
field: 'assignedUserId',
value: params.userId
}];
}
},
super.setup();
getCreateAttributes: function () {
var attributes = {};
if (this.options.params.userId) {
attributes.assignedUserId = this.options.params.userId;
attributes.assignedUserName = this.options.params.userName || this.options.params.userId;
}
return attributes;
},
if (this.userId) {
this.collection.where = [{
type: 'equals',
field: 'assignedUserId',
value: params.userId,
}];
}
}
});
});
setupSearchPanel() {
if (this.userId || !this.getUser().isAdmin()) {
this.searchPanel = false;
this.searchManager.reset();
return;
}
super.setupSearchPanel();
}
getCreateAttributes() {
const attributes = {};
if (this.options.params.userId) {
attributes.assignedUserId = this.options.params.userId;
attributes.assignedUserName = this.options.params.userName || this.options.params.userId;
}
return attributes;
}
}
export default EmailAccountListView;