Trigger shared runner credit card validation alert on click, make it always dismissable
What does this MR do and why?
For #339949 (closed)
This MR changes the flow of the alert that blocks a user from enabling shared runners for a project if they haven't done credit card validation: it makes the toggle visible from the start, then shows the same dismissable alert each time enabling the toggle fails for that reason.
This change is behind the ci_require_credit_card_on_free_plan feature flag, so it doesn't require changelog/documentation.
Screenshots or screen recordings
| scenario | before | with this MR |
|---|---|---|
| try to enable shared runners without credit card validation | toggle is initially hidden by dismissable alert, then clicking the toggle triggers a non-dismissable alert Screen_Recording_2022-01-31_at_14.13.32 | toggle is initially shown, same dismissable alert is triggered each time toggle is clicked Screen_Recording_2022-01-31_at_12.47.03 |
How to set up and validate locally
git checkout 339949-action-based-dismissable-credit-card-validation-alertecho "Feature.enable(:ci_require_credit_card_on_free_plan)" | rails c- in
ee/app/models/ee/user.rb, makerequires_credit_card?returntruefor testing purposes:
def requires_credit_card?(project)
true
end
- navigate to
Settings=>CI/CDfor a project and expand theRunnerssection - click the
Enable shared runners for this projecttoggle - the alert should appear - dismiss the alert and try again - the same alert should appear each time
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Miranda Fluharty