feat: Conditional parameters (HEXA-1687)#1860
Conversation
bramj
left a comment
There was a problem hiding this comment.
Nice work! This is looking really polished, and thorough with the addition of disable_when and lot's of tests and documentation 👍
The code looks solid to me, nothing really to remark there.
I just have a few issues with edge cases when testing locally:
- When I use
disable_when=False, this doesn't really seem to work. I'd expect the condition to invert with regards to the default. - Default parameter setting: the disabled conditions aren't enforced in the modal it seems (see screenshot)
but when running the pipeline, it works correctly:
Can you double check these?
| disableWhen: true, | ||
| choicesFromFile: null, | ||
| ...overrides, | ||
| }); |
|
@bramj On the EDIT:
|
bramj
left a comment
There was a problem hiding this comment.
The default setting not disabling is intentional. I feel like users should be able to change values even if the value is disabled, as it is just a fixed config
Yes I actually thought about this a bit later, my initial reaction was of surprise, but it makes sense to not do enforce anything for the default values.
Thanks for adding the clarifying sentence, that's great 👍
LGTM! 👏
Related PRs
NOTE: Waiting for new SDK version to merge this one, will stay in Draft until then (need to add new sdk version in requirements first). However, it can be reviewed already.
Add parameters conditional to others
Changes
How/what to test
You can test it if you have the branch version of the sdk in local using a
docker-compose.override.yaml:Also, run the following command from the pip you're using to run the openhexa-app:
pipx install --force --editable ~/dev/bluesquare/openhexa-sdk-pythonExample of disabling params:
Screenshots / screencast