Skip to content

Commit

Permalink
elyra-ai#1629 Added getTopLevelActiveGroupId() method in properties c…
Browse files Browse the repository at this point in the history
…ontroller

Signed-off-by: Neha Gokhale <[email protected]>
  • Loading branch information
nmgokhale committed Nov 27, 2023
1 parent 2b64d6a commit 7f13cb9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2294,3 +2294,21 @@ describe("Properties Controller setWideFlyoutPrimaryButtonDisabled", () => {
expect(controller.getWideFlyoutPrimaryButtonDisabled(summaryPanelId)).to.be.false;
});
});

describe("Properties Controller getTopLevelActiveGroupId", () => {
it("should get the top level active group id in properties controller", () => {
reset();
const renderedObject = testUtils.flyoutEditorForm(checkboxsetParamDef);
controller = renderedObject.controller;
const wrapper = renderedObject.wrapper;
let topLevelActiveGroupId = controller.getTopLevelActiveGroupId();
expect(topLevelActiveGroupId).to.equal("checkboxset-values");

// Select Conditions accordion
const conditionsCategory = wrapper.find("div.properties-category-container").at(1);
conditionsCategory.find("button.properties-category-title").simulate("click");
topLevelActiveGroupId = controller.getTopLevelActiveGroupId();
expect(topLevelActiveGroupId).to.equal("checkboxset-conditions");

});
});
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ export default class PropertiesController {
return get(this.propertiesConfig, "locale", DEFAULT_LOCALE);
}

// Return the id of top-level active tab or accordion
getTopLevelActiveGroupId() {
return this.propertiesStore.getActiveTab();
}

isTearsheetContainer() {
return this.propertiesConfig.containerType === "Tearsheet";
}
Expand Down

0 comments on commit 7f13cb9

Please sign in to comment.