Add default process requirements screen, fix validation code #3974
+171
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've added a new screen to capture default process resource requirements. Nothing prints to the final config file just yet but the data is captured within the
TEMPLATE_CONFIGobject.In testing I found that the input field validation wasn't working correctly. I tracked it down to how the pydantic context object was being used. When editing a text input field, the
utils.ValidateConfigclass creates a brand newConfigsCreateConfigobject with just that field's data, usingutils.init_context()to set the value of the variable_init_context_var:That context variable used to then conditionally assess the validity of the field:
The problem is that
init_context()resets the value of_init_context_varafter it has been used, so when the user clicks a button to progress to the next screen, it will progress even if some fields are invalid. Because of this, I think this has gone unnoticed, since the fields still highlight red and display the error message, but only one or two of these actually stopped the progression through the app.I've updated how the config gets updated when the user clicks 'Next' on the basic details screen so that we wrap the creation of the
ConfigsCreateConfigobject within awith init_context()call, similar to above:I'm not sure if this is the best way to approach this, so I thought I'd open this small PR to discuss.
I also updated a few of the
@field_validatormethods to properly reflect which fields are hidden and shown within the app.PR checklist
CHANGELOG.mdis updateddocsis updated