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.
[Dataset quality] Toggle for showing/hidding inactive datasets and fu…
…ll dataset names (elastic#176162) Relates to elastic#170242. ### Changes - Dedicated component for switch with description was created (`DescriptiveSwitch`). - Two new events where added to the machine: - `TOGGLE_INACTIVE_DATASETS`: Used to toggle `Show inactive datasets` switch. - `TOGGLE_FULL_DATASET_NAMES`: Used to toggle `Show full dataset names` switch. - Some minor changes around typings, to reuse the existing ones instead of duplicating states in around controller public state. - DatasetQualityUrlSchema was also updated so the consumer could hold the properties around the switches. - Fixed a small issue when merging degradedDocStats into dataStreamStats, I was using `DataStreamStat.name` where I should be using `DataStreamStat.rawName` from matching datastreams. #### App statechart <img width="1099" alt="image" src="https://github.com/elastic/kibana/assets/1313018/7f0308c6-f8f5-4050-9498-e566370372f2"> #### Demo https://github.com/elastic/kibana/assets/1313018/971efb30-2562-4409-8973-25b4972e6793 #### Note for reviewers - Timefilter selector will be included in a follow up PR. - `timeRange` was added to the state to have the same `from`/`to`, that was used for querying data, when filtering inactive datasets.
- Loading branch information
Showing
14 changed files
with
340 additions
and
63 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
35 changes: 35 additions & 0 deletions
35
x-pack/plugins/dataset_quality/public/components/common/descriptive_switch.tsx
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,35 @@ | ||
/* | ||
* 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 { EuiFlexGroup, EuiIcon, EuiSwitch, EuiText, EuiToolTip } from '@elastic/eui'; | ||
import React from 'react'; | ||
|
||
interface DescriptiveSwitchProps { | ||
label: string; | ||
checked: boolean; | ||
tooltipText: string; | ||
onToggle: () => void; | ||
} | ||
|
||
export const DescriptiveSwitch = ({ | ||
label, | ||
checked, | ||
tooltipText, | ||
onToggle, | ||
}: DescriptiveSwitchProps) => { | ||
return ( | ||
<EuiFlexGroup gutterSize="xs" css={{ flexGrow: 'unset' }} alignItems="center"> | ||
<EuiSwitch compressed label={label} checked={checked} onChange={onToggle} showLabel={false} /> | ||
<EuiFlexGroup gutterSize="xs" alignItems="center"> | ||
<EuiText size="xs">{label}</EuiText> | ||
<EuiToolTip position="bottom" content={tooltipText}> | ||
<EuiIcon tabIndex={0} type="questionInCircle" size="s" /> | ||
</EuiToolTip> | ||
</EuiFlexGroup> | ||
</EuiFlexGroup> | ||
); | ||
}; |
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.