[MTV-1788] Failed to create OSP provider with authentication type - token and username #1478
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.
📝 Links
https://issues.redhat.com/browse/MTV-1788
📝 Description
The incorrect Field ID was being used for the "Username" field, resulting in the wrong set of fields to validate (since these are conditionally set based on the "authentication type" radio selection).
The correct Field ID being used solved the problem, but to help prevent this from happening in the future, an enum was created as a source of truth for those Field IDs used across OpenStack provider create form sections.
We could also do this for other Provider forms that are not OpenStack, but this would be out of scope for this bug, and ideally done as a tech debt follow-up if wanted.
🎥 Demo
Before:
https://github.com/user-attachments/assets/2a6caac2-826f-4600-aa0a-a85731381563
After:
https://github.com/user-attachments/assets/709872d7-3a2a-4933-b55b-3299d65c6514