fix: Disable masked and hidden variable option when editing
What does this MR do and why?
An existing CI/CD variable cannot be changed to masked-and-hidden: the backend rejects it with "Only new variables can be set as masked and hidden." The radio stayed selectable while editing, so saving always failed. This disables the option when editing; the visibility help popover already explains it is new-variable only.
Changelog: fixed Closes #632647
Before / After
Before: When editing an existing variable, the "Masked and hidden" visibility option was still selectable. Choosing it and saving always failed, because the backend only allows that visibility on brand-new variables.
After: The "Masked and hidden" option is disabled while editing an existing variable (the rest of the visibility group stays enabled), so the invalid choice can no longer be made and the save no longer fails.
How to set up and validate locally
- Run the updated spec:
yarn jest spec/frontend/ci/ci_variable_list/components/ci_variable_drawer_spec.js - Or in the UI: open a project's Settings > CI/CD > Variables, edit an existing variable, and confirm the "Masked and hidden" option is disabled.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #632647