relationship panel mandatory attribute list param

This commit is contained in:
Yuri Kuznetsov
2025-01-09 10:26:07 +02:00
parent d76b371a48
commit 4fb30b0b7b
2 changed files with 18 additions and 5 deletions

View File

@@ -2,7 +2,7 @@
* This file is part of EspoCRM.
*
* EspoCRM Open Source CRM application.
* Copyright (C) 2014-2025 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
* Copyright (C) 2014-2024 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko
* Website: https://www.espocrm.com
*
* This program is free software: you can redistribute it and/or modify
@@ -273,10 +273,10 @@ class RelationshipPanelView extends BottomPanelView {
if (layout) {
if (typeof layout === 'string') {
layoutName = layout;
layoutName = layout;
} else {
layoutName = 'listRelationshipCustom';
listLayout = layout;
layoutName = 'listRelationshipCustom';
listLayout = layout;
}
}
@@ -368,8 +368,16 @@ class RelationshipPanelView extends BottomPanelView {
displayTotalCount: false,
additionalRowActionList: this.defs.rowActionList,
}, view => {
view.getSelectAttributeList((selectAttributeList) => {
view.getSelectAttributeList(selectAttributeList => {
if (selectAttributeList) {
if (this.defs.mandatoryAttributeList) {
selectAttributeList = [...selectAttributeList, ...this.defs.mandatoryAttributeList];
selectAttributeList = selectAttributeList
.filter((it, i) => selectAttributeList.indexOf(it) === i);
}
collection.data.select = selectAttributeList.join(',');
}

View File

@@ -454,6 +454,11 @@
"type": "string"
}
},
"mandatoryAttributeList": {
"description": "Mandatory attributes to be selected in the list. As of v9.0.",
"type": "array",
"items": {"type": "string"}
},
"orderBy": {
"description": "An order-by field.",
"type": "string"