From 5ddb61755d608f05ea96181e079eb233a594f568 Mon Sep 17 00:00:00 2001 From: Carita Date: Fri, 9 Aug 2024 10:39:23 -0700 Subject: [PATCH] #2088 Title actions should not be displayed after form (#2098) Signed-off-by: Carita Ou --- .../src/common-properties/form/Form.js | 14 +++++++++----- .../src/common-properties/properties-controller.js | 3 ++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/canvas_modules/common-canvas/src/common-properties/form/Form.js b/canvas_modules/common-canvas/src/common-properties/form/Form.js index d1e1db1fcd..8ca232296b 100644 --- a/canvas_modules/common-canvas/src/common-properties/form/Form.js +++ b/canvas_modules/common-canvas/src/common-properties/form/Form.js @@ -24,7 +24,7 @@ import { Size } from "../constants/form-constants"; import { CONTAINER_TYPE } from "../constants/constants"; export default class Form { - constructor(componentId, label, labelEditable, help, editorSize, pixelWidth, uiItems, buttons, data, conditions, resources, icon, heading, title) { + constructor(componentId, label, labelEditable, help, editorSize, pixelWidth, uiItems, buttons, data, conditions, resources, icon, heading, title, titleUiItems) { this.componentId = componentId; this.label = label; this.labelEditable = labelEditable; @@ -41,6 +41,9 @@ export default class Form { if (title) { this.title = title; } + if (titleUiItems?.length > 0) { + this.titleUiItems = titleUiItems; + } } /** @@ -61,9 +64,9 @@ export default class Form { tabs.push(makePrimaryTab(propDef, group, l10nProvider, containerType)); } } - let titleActions = []; + let titleUiItems = []; if (propDef.titleMetadata && propDef.actionMetadata) { - titleActions = makeActions(null, propDef.actionMetadata, propDef.titleMetadata.Title, null, l10nProvider); + titleUiItems = makeActions(null, propDef.actionMetadata, propDef.titleMetadata.Title, null, l10nProvider); } const currentParameters = propertyOf(paramDef)("current_parameters"); @@ -80,14 +83,15 @@ export default class Form { propDef.help, propDef.editorSizeHint(editorSizeDefault), propDef.pixelWidth, - [UIItem.makePrimaryTabs(tabs)].concat(titleActions), + [UIItem.makePrimaryTabs(tabs)], _defaultButtons(), data, translateMessages(conditions, l10nProvider), resources, propDef.icon, l10nProvider.l10nResource(propDef.heading), - propDef.titleMetadata + propDef.titleMetadata, + titleUiItems ); } return null; diff --git a/canvas_modules/common-canvas/src/common-properties/properties-controller.js b/canvas_modules/common-canvas/src/common-properties/properties-controller.js index 5573bae465..ac5fd004e6 100644 --- a/canvas_modules/common-canvas/src/common-properties/properties-controller.js +++ b/canvas_modules/common-canvas/src/common-properties/properties-controller.js @@ -170,7 +170,8 @@ export default class PropertiesController { this._parseUiConditions(); // should be done before running any validations const controls = []; - UiConditionsParser.parseControls(controls, this.actions, this.form); + UiConditionsParser.parseControls(controls, this.actions, this.form); // parse form uiItems + UiConditionsParser.parseControls(null, this.actions, { uiItems: this.form.titleUiItems }); // parse title_info uiItems this.saveControls(controls); // saves controls without the subcontrols this._parseSummaryControls(controls); this.parsePanelTree();