-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[ResponseOps][Maintenance Window] Timezone field disappears when specific timezone is selected #241574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[ResponseOps][Maintenance Window] Timezone field disappears when specific timezone is selected #241574
Conversation
|
Pinging @elastic/response-ops (Team:ResponseOps) |
...lerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.test.tsx
Outdated
Show resolved
Hide resolved
| const [defaultEndDateValue] = useState<string>(moment().add(30, 'minutes').toISOString()); | ||
| const [isModalVisible, setIsModalVisible] = useState(false); | ||
| const { defaultTimezone, isBrowser } = useDefaultTimezone(); | ||
| const { defaultTimezone } = useDefaultTimezone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isBrowser comes from a function that is declared in this file and only used here. If that result key is not necessary anymore, we should remove it from the original function, too.
Also, I don't fully understand what isBrowser did in this file. 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed isBrowser from the hook. I think the original intent was to display the timezone only if it's automatically determined from the user's browser. This is the original PR that introduced the timezone field
| } | ||
|
|
||
| const useDefaultTimezone = () => { | ||
| const kibanaTz: string = useUiSetting('dateFormat:tz'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a test for when kibanaTz is undefined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, added the test
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
|
Closes #229132
Summary
timezonefield, ensuring it is always visible on both create and edit Maintenance Window pages, as a timezone is always configured (either Browser or a specific one)