Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes LGTM for this file, but a side question to @AlexGPlay - do we still need this file? It seems like we migrated fully to EUI split button and looks like a dead code.

It's only imported by the deprecated TopNavMenuItem, but no caller uses it, maybe worth adding some cleanup issue to the backlog

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess first the TopNavMenuItem needs to be cleaned up and after that we can remove the @kbn/split-button package 😄

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it's dependent, but what I meant is to track it now (if it's good to go soon), otherwise we forget 😁

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, yes! that definitely sounds like a good idea 😁

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { EuiButton, EuiButtonIcon, useEuiTheme } from '@elastic/eui';
import { EuiButton, EuiButtonIcon, EuiToolTip, useEuiTheme } from '@elastic/eui';
import type { EuiButtonProps, IconType, UseEuiTheme } from '@elastic/eui';
import { useMemoCss } from '@kbn/css-utils/public/use_memo_css';
import React from 'react';
Expand Down Expand Up @@ -81,19 +81,20 @@ export const SplitButton = ({
) : (
<EuiButton iconType={iconType} {...commonMainButtonProps} />
)}
<EuiButtonIcon
css={styles.secondaryButton}
data-test-subj={mainButtonProps['data-test-subj'] + `-secondary-button`}
aria-label={secondaryButtonAriaLabel}
display={secondaryButtonFill ? 'fill' : 'base'}
title={secondaryButtonTitle}
color={color}
size={size}
iconType={secondaryButtonIcon}
onClick={onSecondaryButtonClick}
isDisabled={areButtonsDisabled || isSecondaryButtonDisabled}
isLoading={isLoading || isSecondaryButtonLoading}
/>
<EuiToolTip content={secondaryButtonTitle} disableScreenReaderOutput>
<EuiButtonIcon
css={styles.secondaryButton}
data-test-subj={mainButtonProps['data-test-subj'] + `-secondary-button`}
aria-label={secondaryButtonAriaLabel}
display={secondaryButtonFill ? 'fill' : 'base'}
color={color}
size={size}
iconType={secondaryButtonIcon}
onClick={onSecondaryButtonClick}
isDisabled={areButtonsDisabled || isSecondaryButtonDisabled}
isLoading={isLoading || isSecondaryButtonLoading}
/>
</EuiToolTip>
</div>
);
};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good ✅

Image Image

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiText,
EuiToolTip,
keys,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
Expand Down Expand Up @@ -119,28 +120,42 @@ export const InTableSearchInput: React.FC<InTableSearchInputProps> = React.memo(
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonIcon
iconType="chevronSingleUp"
color="text"
data-test-subj={BUTTON_PREV_TEST_SUBJ}
disabled={areArrowsDisabled}
aria-label={i18n.translate('dataGridInTableSearch.buttonPreviousMatch', {
<EuiToolTip
content={i18n.translate('dataGridInTableSearch.buttonPreviousMatch', {
defaultMessage: 'Previous',
})}
onClick={goToPrevMatch}
/>
disableScreenReaderOutput
>
<EuiButtonIcon
iconType="chevronSingleUp"
color="text"
data-test-subj={BUTTON_PREV_TEST_SUBJ}
disabled={areArrowsDisabled}
aria-label={i18n.translate('dataGridInTableSearch.buttonPreviousMatch', {
defaultMessage: 'Previous',
})}
onClick={goToPrevMatch}
/>
</EuiToolTip>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonIcon
iconType="chevronSingleDown"
color="text"
data-test-subj={BUTTON_NEXT_TEST_SUBJ}
disabled={areArrowsDisabled}
aria-label={i18n.translate('dataGridInTableSearch.buttonNextMatch', {
<EuiToolTip
content={i18n.translate('dataGridInTableSearch.buttonNextMatch', {
defaultMessage: 'Next',
})}
onClick={goToNextMatch}
/>
disableScreenReaderOutput
>
<EuiButtonIcon
iconType="chevronSingleDown"
color="text"
data-test-subj={BUTTON_NEXT_TEST_SUBJ}
disabled={areArrowsDisabled}
aria-label={i18n.translate('dataGridInTableSearch.buttonNextMatch', {
defaultMessage: 'Next',
})}
onClick={goToNextMatch}
/>
</EuiToolTip>
</EuiFlexItem>
</EuiFlexGroup>
}
Expand Down
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good ✅

Image Image

Original file line number Diff line number Diff line change
Expand Up @@ -282,31 +282,37 @@ export function UnifiedHistogramChart({
const actions: IconButtonGroupProps['buttons'] = [];

if (canEditVisualizationOnTheFly) {
const editLabel = i18n.translate('unifiedHistogram.editVisualizationButton', {
defaultMessage: 'Edit visualization',
});
actions.push({
label: i18n.translate('unifiedHistogram.editVisualizationButton', {
defaultMessage: 'Edit visualization',
}),
label: editLabel,
toolTipContent: editLabel,
iconType: 'pencil',
isDisabled: isFlyoutVisible,
'data-test-subj': 'unifiedHistogramEditFlyoutVisualization',
onClick: () => setIsFlyoutVisible(true),
});
} else if (onEditVisualization) {
const editLabel = i18n.translate('unifiedHistogram.editVisualizationButton', {
defaultMessage: 'Edit visualization',
});
actions.push({
label: i18n.translate('unifiedHistogram.editVisualizationButton', {
defaultMessage: 'Edit visualization',
}),
label: editLabel,
toolTipContent: editLabel,
iconType: 'lensApp',
'data-test-subj': 'unifiedHistogramEditVisualization',
onClick: onEditVisualization,
});
}

if (canSaveVisualization) {
const saveLabel = i18n.translate('unifiedHistogram.saveVisualizationButton', {
defaultMessage: 'Save visualization to dashboard',
});
actions.push({
label: i18n.translate('unifiedHistogram.saveVisualizationButton', {
defaultMessage: 'Save visualization to dashboard',
}),
label: saveLabel,
toolTipContent: saveLabel,
iconType: 'addToDashboard',
'data-test-subj': 'unifiedHistogramSaveVisualization',
onClick: () => setIsSaveModalVisible(true),
Expand Down
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good ✅

Image Image

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { EuiButtonIcon, useEuiTheme, useResizeObserver } from '@elastic/eui';
import { EuiButtonIcon, EuiToolTip, useEuiTheme, useResizeObserver } from '@elastic/eui';
import { throttle } from 'lodash';
import { i18n } from '@kbn/i18n';
import { css } from '@emotion/react';
Expand Down Expand Up @@ -97,31 +97,33 @@ export const useResponsiveTabs = ({
const scrollLeftButton = useMemo(
() =>
tabsSizeConfig.isScrollable ? (
<EuiButtonIcon
data-test-subj="unifiedTabs_tabsBar_scrollLeftBtn"
iconType="chevronSingleLeft"
color="text"
disabled={scrollState?.isScrollableLeft === false}
aria-label={scrollLeftButtonLabel}
title={scrollLeftButtonLabel}
onClick={scrollLeft}
/>
<EuiToolTip content={scrollLeftButtonLabel} disableScreenReaderOutput>
<EuiButtonIcon
data-test-subj="unifiedTabs_tabsBar_scrollLeftBtn"
iconType="chevronSingleLeft"
color="text"
disabled={scrollState?.isScrollableLeft === false}
aria-label={scrollLeftButtonLabel}
onClick={scrollLeft}
/>
</EuiToolTip>
) : null,
[scrollLeftButtonLabel, scrollLeft, tabsSizeConfig.isScrollable, scrollState?.isScrollableLeft]
);

const scrollRightButton = useMemo(
() =>
tabsSizeConfig.isScrollable ? (
<EuiButtonIcon
data-test-subj="unifiedTabs_tabsBar_scrollRightBtn"
iconType="chevronSingleRight"
color="text"
disabled={scrollState?.isScrollableRight === false}
aria-label={scrollRightButtonLabel}
title={scrollRightButtonLabel}
onClick={scrollRight}
/>
<EuiToolTip content={scrollRightButtonLabel} disableScreenReaderOutput>
<EuiButtonIcon
data-test-subj="unifiedTabs_tabsBar_scrollRightBtn"
iconType="chevronSingleRight"
color="text"
disabled={scrollState?.isScrollableRight === false}
aria-label={scrollRightButtonLabel}
onClick={scrollRight}
/>
</EuiToolTip>
) : null,
[
scrollRightButtonLabel,
Expand Down
Loading
Loading