forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Serverless][DataUsage] UX updates from demo feedback (elastic#201638)
## Summary Follow up of elastic#200911 - [x] Treat date picker values as UTC date/time - [ ] Tooltip for date picker - [x] Align filters (right aligned for all screens and responsive) - [x] Disable `refresh` button if no `metricTypes` or `dataStreams` or invalid date range - [x] Validate selected date/time range before sending requests ![Screenshot 2024-11-25 at 17 25 43](https://github.com/user-attachments/assets/bc61ad73-2c85-4b40-9156-c5ccc87e0d7e) ![Screenshot 2024-11-25 at 17 27 53](https://github.com/user-attachments/assets/3aef26d1-6df2-4315-a939-0807c9da18c7) ![Screenshot 2024-11-26 at 15 45 56](https://github.com/user-attachments/assets/f7e1da72-4559-42e0-bee2-2e53709fd812) ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ...
- Loading branch information
1 parent
f50b93c
commit d0d33aa
Showing
17 changed files
with
241 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { isDateRangeValid } from './utils'; | ||
|
||
describe('isDateRangeValid', () => { | ||
describe('Valid ranges', () => { | ||
it.each([ | ||
['both start and end date is `now`', { start: 'now', end: 'now' }], | ||
['start date is `now-10s` and end date is `now`', { start: 'now-10s', end: 'now' }], | ||
['bounded within the min and max date range', { start: 'now-8d', end: 'now-4s' }], | ||
])('should return true if %s', (_, { start, end }) => { | ||
expect(isDateRangeValid({ start, end })).toBe(true); | ||
}); | ||
}); | ||
|
||
describe('Invalid ranges', () => { | ||
it.each([ | ||
['starts before the min date', { start: 'now-11d', end: 'now-5s' }], | ||
['ends after the max date', { start: 'now-9d', end: 'now+2s' }], | ||
[ | ||
'end date is before the start date even when both are within min and max date range', | ||
{ start: 'now-3s', end: 'now-10s' }, | ||
], | ||
])('should return false if the date range %s', (_, { start, end }) => { | ||
expect(isDateRangeValid({ start, end })).toBe(false); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.