role ui fix

This commit is contained in:
Yuri Kuznetsov
2022-07-25 11:50:26 +03:00
parent 05e296879f
commit 625ee91bc0
4 changed files with 34 additions and 17 deletions
@@ -26,13 +26,12 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/portal-role/record/detail', 'views/role/record/detail', function (Dep) {
define('views/portal-role/record/detail', ['views/role/record/detail'], function (Dep) {
return Dep.extend({
tableView: 'views/portal-role/record/table',
stickButtonsContainerAllTheWay: true,
});
});
+3 -4
View File
@@ -26,13 +26,12 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/portal-role/record/edit', 'views/role/record/edit', function (Dep) {
define('views/portal-role/record/edit', ['views/role/record/edit'], function (Dep) {
return Dep.extend({
tableView: 'views/portal-role/record/table',
stickButtonsContainerAllTheWay: true,
tableView: 'views/portal-role/record/table',
stickButtonsContainerAllTheWay: true,
});
});
+25 -10
View File
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/portal-role/record/table', 'views/role/record/table', function (Dep) {
define('views/portal-role/record/table', ['views/role/record/table'], function (Dep) {
return Dep.extend({
@@ -42,7 +42,13 @@ define('views/portal-role/record/table', 'views/role/record/table', function (De
'record': ['all', 'own', 'no']
},
levelList: ['all', 'account', 'contact', 'own', 'no'],
levelList: [
'all',
'account',
'contact',
'own',
'no',
],
type: 'aclPortal',
@@ -52,22 +58,31 @@ define('views/portal-role/record/table', 'views/role/record/table', function (De
this.aclTypeMap = {};
this.scopeList = [];
var scopeListAll = Object.keys(this.getMetadata().get('scopes')).sort(function (v1, v2) {
return this.translate(v1, 'scopeNamesPlural').localeCompare(this.translate(v2, 'scopeNamesPlural'));
}.bind(this));
var scopeListAll = Object.keys(this.getMetadata().get('scopes'))
.sort((v1, v2) => {
return this.translate(v1, 'scopeNamesPlural')
.localeCompare(this.translate(v2, 'scopeNamesPlural'));
});
scopeListAll.forEach(scope => {
if (
this.getMetadata().get('scopes.' + scope + '.disabled') ||
this.getMetadata().get('scopes.' + scope + '.disabledPortal')
) {
return;
}
scopeListAll.forEach(function (scope) {
if (this.getMetadata().get('scopes.' + scope + '.disabled') || this.getMetadata().get('scopes.' + scope + '.disabledPortal')) return;
var acl = this.getMetadata().get('scopes.' + scope + '.aclPortal');
if (acl) {
this.scopeList.push(scope);
this.aclTypeMap[scope] = acl;
if (acl === true) {
this.aclTypeMap[scope] = 'record';
}
}
}, this);
}
});
},
});
});
+5 -1
View File
@@ -706,7 +706,11 @@ define('views/role/record/table', ['view'], function (Dep) {
var screenWidthXs = this.getThemeManager().getParam('screenWidthXs');
var $buttonContainer = $('.detail-button-container');
var $table = this.$el.find('table.'+type+'-level');
var $table = this.$el.find('table.' + type + '-level');
if (!$table.length) {
return;
}
if (!$buttonContainer.length) {
return;