add custom tabs

This commit is contained in:
Yuri Kuznetsov
2024-04-23 17:43:09 +03:00
parent 15b4ce9657
commit 45cdae005a
6 changed files with 31 additions and 2 deletions

View File

@@ -21,6 +21,7 @@
"defaultReminders": "Default Reminders",
"theme": "Theme",
"useCustomTabList": "Custom Tab List",
"addCustomTabs": "Add Custom Tabs",
"tabList": "Tab List",
"emailReplyToAllByDefault": "Email Reply to all by default",
"dashboardLayout": "Dashboard Layout",
@@ -51,6 +52,7 @@
"Reset Dashboard to Default": "Reset Dashboard to Default"
},
"tooltips": {
"addCustomTabs": "If checked, custom tabs will be appended to standard tabs. Otherwise, custom tabs will be used instead of standard tabs.",
"autoFollowEntityTypeList": "Automatically follow ALL new records (created by any user) of the selected entity types. To be able to see information in the stream and receive notifications about all records in the system.",
"doNotFillAssignedUserIfNotRequired": "When create record assigned user won't be filled with own user unless the field is required.",
"followCreatedEntities": "When create new records, they will be automatically followed even if assigned to another user.",

View File

@@ -108,7 +108,11 @@
"rows": [
[
{"name": "useCustomTabList"},
{"name": "tabList"}
{"name": "addCustomTabs"}
],
[
{"name": "tabList"},
false
]
]
},

View File

@@ -66,6 +66,7 @@
"followEntityOnStreamPost": false,
"doNotFillAssignedUserIfNotRequired": false,
"useCustomTabList": false,
"addCustomTabs": false,
"tabList": false,
"emailUseExternalClient": false,
"assignmentNotificationsIgnoreEntityTypeList": false,

View File

@@ -135,6 +135,11 @@
"type": "bool",
"default": false
},
"addCustomTabs": {
"type": "bool",
"default": false,
"tooltip": true
},
"tabList": {
"type": "array",
"view": "views/preferences/fields/tab-list",

View File

@@ -58,6 +58,16 @@ class PreferencesEditRecordView extends EditRecordView {
]
}
},
'addCustomTabs': {
visible: {
conditionGroup: [
{
type: 'isTrue',
attribute: 'useCustomTabList',
}
]
}
},
},
}

View File

@@ -338,10 +338,17 @@ class NavbarSiteView extends View {
}
getTabList() {
let tabList = this.getPreferences().get('useCustomTabList') ?
let tabList = this.getPreferences().get('useCustomTabList') && !this.getPreferences().get('addCustomTabs') ?
this.getPreferences().get('tabList') :
this.getConfig().get('tabList');
if (this.getPreferences().get('addCustomTabs')) {
tabList = [
...tabList,
...(this.getPreferences().get('tabList') || []),
];
}
tabList = Espo.Utils.cloneDeep(tabList || []);
if (this.isSide()) {