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.
[Logs Explorer] Update Dataset selector actions design (elastic#175676)
## 📓 Summary As defined in the [Dataset selector design updates](https://www.figma.com/file/Qa3IdgLicB60qW6eakmn7U/Data-selector?type=design&node-id=3870-238432&mode=design&t=wkKSQKGn0lpNIYWP-4), this small changes move and redesign the position for the "Show all logs" and "Try ESQL buttons". | Before | After | |---|---| | <img width="410" alt="before" src="https://github.com/elastic/kibana/assets/34506779/6a75b864-8766-4e6f-87c3-7d9cd925ea32"> | <img width="413" alt="after" src="https://github.com/elastic/kibana/assets/34506779/8fd6b53d-cd13-492f-bfc2-b1dc07aaeca1"> | --------- Co-authored-by: Marco Antonio Ghiani <[email protected]>
- Loading branch information
Showing
4 changed files
with
87 additions
and
76 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
26 changes: 0 additions & 26 deletions
26
...olution/logs_explorer/public/components/dataset_selector/sub_components/esql_selector.tsx
This file was deleted.
Oops, something went wrong.
44 changes: 0 additions & 44 deletions
44
...tion/logs_explorer/public/components/dataset_selector/sub_components/selector_actions.tsx
This file was deleted.
Oops, something went wrong.
81 changes: 81 additions & 0 deletions
81
...ution/logs_explorer/public/components/dataset_selector/sub_components/selector_footer.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,81 @@ | ||
/* | ||
* 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 React from 'react'; | ||
import { | ||
EuiBetaBadge, | ||
EuiButton, | ||
EuiButtonEmpty, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiListGroupProps, | ||
EuiPanel, | ||
} from '@elastic/eui'; | ||
import { getRouterLinkProps } from '@kbn/router-utils'; | ||
import { DiscoverEsqlUrlProps } from '../../../hooks/use_esql'; | ||
import { createAllLogDatasetsItem } from '../utils'; | ||
import { showAllLogsLabel, tryEsql } from '../constants'; | ||
|
||
type DatasetsAllActionProps = EuiListGroupProps; | ||
|
||
interface ShowAllLogsProps { | ||
isSelected: boolean; | ||
onClick(): void; | ||
} | ||
|
||
export const SelectorFooter = (props: DatasetsAllActionProps) => { | ||
return ( | ||
<EuiPanel paddingSize="s" hasShadow={false} data-test-subj="datasetSelectorSearchFooter"> | ||
<EuiFlexGroup justifyContent="spaceBetween" alignItems="center" {...props} /> | ||
</EuiPanel> | ||
); | ||
}; | ||
|
||
export const ShowAllLogsButton = ({ isSelected, onClick }: ShowAllLogsProps) => { | ||
const allLogs = createAllLogDatasetsItem(); | ||
|
||
return ( | ||
<EuiFlexItem grow={false}> | ||
<EuiButtonEmpty | ||
data-test-subj={allLogs['data-test-subj']} | ||
onClick={onClick} | ||
size="s" | ||
iconType={isSelected ? 'check' : allLogs.iconType} | ||
flush="left" | ||
> | ||
{showAllLogsLabel} | ||
</EuiButtonEmpty> | ||
</EuiFlexItem> | ||
); | ||
}; | ||
|
||
export const ESQLButton = (props: DiscoverEsqlUrlProps) => { | ||
const linkProps = getRouterLinkProps(props); | ||
|
||
return ( | ||
<EuiFlexItem grow={false}> | ||
<EuiButton | ||
{...linkProps} | ||
iconType={() => ( | ||
<EuiBetaBadge | ||
label="ESQL Beta" | ||
color="hollow" | ||
iconType="beaker" | ||
size="s" | ||
alignment="middle" | ||
/> | ||
)} | ||
iconSide="right" | ||
color="success" | ||
size="s" | ||
data-test-subj="esqlLink" | ||
> | ||
{tryEsql} | ||
</EuiButton> | ||
</EuiFlexItem> | ||
); | ||
}; |