mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-30 16:06:07 +00:00
list detail layout realType usage
This commit is contained in:
@@ -84,6 +84,7 @@ class LayoutBaseView extends View {
|
||||
this.events = _.clone(this.events);
|
||||
this.scope = this.options.scope;
|
||||
this.type = this.options.type;
|
||||
this.realType = this.options.realType;
|
||||
this.setId = this.options.setId;
|
||||
this.em = this.options.em;
|
||||
|
||||
|
||||
@@ -286,7 +286,17 @@ define('views/admin/layouts/detail', ['views/admin/layouts/grid'], function (Dep
|
||||
|
||||
var layoutList = model.getFieldParam(name, 'layoutAvailabilityList');
|
||||
|
||||
if (layoutList && !layoutList.includes(this.type)) {
|
||||
let realType = this.realType;
|
||||
|
||||
if (realType === 'detailSmall') {
|
||||
realType = 'detail';
|
||||
}
|
||||
|
||||
if (
|
||||
layoutList &&
|
||||
!layoutList.includes(this.type) &&
|
||||
!layoutList.includes(realType)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -272,6 +272,7 @@ class LayoutIndexView extends View {
|
||||
fullSelector: '#layout-content',
|
||||
scope: scope,
|
||||
type: type,
|
||||
realType: typeReal,
|
||||
setId: this.setId,
|
||||
em: this.em,
|
||||
}, view => {
|
||||
|
||||
@@ -259,10 +259,21 @@ define('views/admin/layouts/list', ['views/admin/layouts/rows'], function (Dep)
|
||||
return false;
|
||||
}
|
||||
|
||||
/** @type {string[]|null} */
|
||||
const layoutList = model.getFieldParam(name, 'layoutAvailabilityList');
|
||||
|
||||
if (layoutList && !~layoutList.indexOf(this.type)) {
|
||||
return;
|
||||
let realType = this.realType;
|
||||
|
||||
if (realType === 'listSmall') {
|
||||
realType = 'list';
|
||||
}
|
||||
|
||||
if (
|
||||
layoutList &&
|
||||
!layoutList.includes(this.type) &&
|
||||
!layoutList.includes(realType)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !model.getFieldParam(name, 'disabled') &&
|
||||
|
||||
Reference in New Issue
Block a user