Skip to content
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

Decouple keyword time range validation from keyword time range preview in time range picker. 6.0 #19155

Merged
merged 1 commit into from May 13, 2024

Conversation

linuspahl
Copy link
Contributor

Please note: This is a backport of #18879 for 6.0

Description

Motivation and Context

With this PR we are separating the time range validation from time range preview in time keyword tab of the range picker.

This approach has multiple advantages

  • We are no longer using the validate prop of the keyword formik field and have all the validation in the form validate function
  • We no longer need to maintain the validatingKeyword state to disable the submit button while the keyword is being validated
  • The keyword preview and validation logic is a lot simpler and less error-prone

The main disadvantage:

  • we are currently doing two requests to test the keyword time range in the date time picker, on change. One for the validation and one for the preview.

This restructuring is fixing three bugs:

  • the problem described in Search bar: Keyword time range time zone not set #18809. We are now always including the user time zone when defining a keyword time range.
  • before it often happened that the submit button stayed disabled after switching between the keyword tab and the other tabs
  • before this change the keyword time range preview was empty when opening the keyword tab while it contained the default keyword time range.

Fixes #18809

@linuspahl linuspahl added this to the 6.0.1 milestone May 6, 2024
…w in time range picker. (#18879)

* Consider user time zone for initial keyword time range.

* Make sure to not disable submit button when chanign tabs.

* Decouple keyword time range validation from keyword time range preview in time range picker.

* Adding changelog.

* Fixing test
@linuspahl linuspahl force-pushed the fix/initial-keyword-time-range-6.0 branch from 83c8317 to 2e93782 Compare May 8, 2024 11:01
@linuspahl linuspahl marked this pull request as ready for review May 8, 2024 11:02
@dennisoelkers dennisoelkers merged commit 31a2d5f into 6.0 May 13, 2024
6 checks passed
@dennisoelkers dennisoelkers deleted the fix/initial-keyword-time-range-6.0 branch May 13, 2024 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants