Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1611 Filter getPropertyValues() based on the selected tab #1612

Closed

Conversation

nmgokhale
Copy link
Member

Fixes #1611

Added a new config option getActiveTabControls for getPropertyValues() method in properties-controller.

Developer's Certificate of Origin 1.1

   By making a contribution to this project, I certify that:

   (a) The contribution was created in whole or in part by me and I
       have the right to submit it under the Apache License 2.0; or

   (b) The contribution is based upon previous work that, to the best
       of my knowledge, is covered under an appropriate open source
       license and I have the right under that license to submit that
       work with modifications, whether created in whole or in part
       by me, under the same open source license (unless I am
       permitted to submit under a different license), as indicated
       in the file; or

   (c) The contribution was provided directly to me by some other
       person who certified (a), (b) or (c) and I have not modified
       it.

   (d) I understand and agree that this project and the contribution
       are public and that a record of the contribution (including all
       personal information I submit with it, including my sign-off) is
       maintained indefinitely and may be redistributed consistent with
       this project or the open source license(s) involved.

@nmgokhale nmgokhale self-assigned this Oct 30, 2023
@nmgokhale nmgokhale force-pushed the get-properties-in-selected-tab branch from 71555f5 to cf96cff Compare November 6, 2023 18:44
// All property values
let propertyValues = this.propertiesStore.getPropertyValues();

if (options && options.getActiveTabControls) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably rename this to activeTabValues instead. getActiveTabControls makes me think this is a method.

}

// Recursively get all properties under given uiGroup
getGroupProperties(uiGroup) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you looked at this.panelTree? I think this already has a tree of all the panels and controls within a tree. Could we use that instead of having to parse it again?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthoward366 this.panelTree works for most cases. But when "type": "subTabs",, the group doesn't show up under this.panelTree.

Example in tab_paramDef.json, Primary3 group has "type": "subTabs",. This group isn't listed under panelTree - https://github.com/elyra-ai/canvas/blob/main/canvas_modules/harness/test_resources/parameterDefs/tab_paramDef.json#L577

Screenshot 2023-11-09 at 6 14 15 AM

Copy link
Member

@matthoward366 matthoward366 Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be? Maybe the code for the panelTree parsing isn't handling this correctly? Seems like ui-groups-parser should doing what you're trying to do here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other question here is should document the method in the controller for getting the active tab then the consuming application should be able to do this to determine the parameters within that group.

@nmgokhale nmgokhale force-pushed the get-properties-in-selected-tab branch from cf96cff to 7937d68 Compare November 9, 2023 14:40
@nmgokhale
Copy link
Member Author

After discussion with DataStage team, they just need top level active tab's group id. Closing this PR. I will create a new PR for returning top level active tab group id.

@nmgokhale nmgokhale closed this Nov 27, 2023
@nmgokhale nmgokhale deleted the get-properties-in-selected-tab branch December 20, 2023 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filter getPropertyValues() based on the selected tab
2 participants