Fix initial value set on TimezoneDropdown
What does this MR do and why?
Show the empty timezone dropdown if the user has already preselected timezone that doesn't correspond to the one in the list.
Why? We have subset of users that have store name (Belin
) of the timezone instead of the identifier (Europe/Berlin
). Previous dropdown was showing no selection in this case but the current one crushes. This MR fixes this regression and replicates previous behavior.
Related to #375360 (closed)
Screenshots or screen recordings
Bug | Bug fixed | Normal behavior |
---|---|---|
How to set up and validate locally
- Open the
http://localhost:3000/-/profile
page - Update the TimeZone dropdown and save the form
- Make sure that the value is properly updated after safe
To test exactly bug fix: set Berlin
as an initial value on a show.html.haml#L59
.js-timezone-dropdown{ data: { timezone_data: timezone_data.to_json, initial_value: 'Berlin' } }
That would simulate incorrect value that doesn't exist in the timezones list.
We should render an empty dropdown in this case.
To check deploy freeze update:
- Open a project, Settings -> CI/CD -> Deploy freeze
- Add a new deploy freeze
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.