Skip to content

Commit

Permalink
Undo unnecessary EuiSmallButton* uses
Browse files Browse the repository at this point in the history
Signed-off-by: Miki <[email protected]>
  • Loading branch information
AMoo-Miki committed Jul 18, 2024
1 parent b598005 commit 0c9fba0
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@

import React, { Fragment } from 'react';
import { FormattedMessage } from '@osd/i18n/react';
import {
EuiSmallButton,
EuiEmptyPrompt,
EuiLink,
EuiText,
} from '@elastic/eui';
import { EuiSmallButton, EuiEmptyPrompt, EuiLink, EuiText } from '@elastic/eui';
import { ApplicationStart } from 'opensearch-dashboards/public';

export const getNoItemsMessage = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React, { useState } from 'react';
import { i18n } from '@osd/i18n';
import { ApplicationStart } from 'opensearch-dashboards/public';
import {
EuiSmallButtonIcon,
EuiButtonIcon,
EuiButton,
EuiFlexGroup,
EuiFlexItem,
Expand Down Expand Up @@ -41,7 +41,7 @@ export const DataSourceErrorMenu = ({ application }: DataSourceErrorMenuProps) =
);

const iconButton = (
<EuiSmallButtonIcon
<EuiButtonIcon
className="euiHeaderLink"
data-test-subj="dataSourceErrorMenuHeaderLink"
aria-label={i18n.translate('dataSourceError.dataSourceErrorMenuHeaderLink', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
EuiSteps,
EuiPageSideBar,
EuiBottomBar,
EuiSmallButtonEmpty,
EuiSmallButton,
EuiButtonEmpty,
EuiButton,
} from '@elastic/eui';
import React, { useEffect, useState, useCallback } from 'react';
import { RouteComponentProps, useParams, withRouter } from 'react-router-dom';
Expand Down Expand Up @@ -311,7 +311,7 @@ export const DirectQueryDataSourceConfigure: React.FC<ConfigureDatasourceProps>
<EuiBottomBar data-test-subj="reviewSaveOrCancel">
<EuiFlexGroup justifyContent="flexEnd">
<EuiFlexItem grow={false}>
<EuiSmallButtonEmpty
<EuiButtonEmpty
onClick={() => {
history.push('/create');
}}
Expand All @@ -321,21 +321,21 @@ export const DirectQueryDataSourceConfigure: React.FC<ConfigureDatasourceProps>
data-test-subj="cancelButton"
>
Cancel
</EuiSmallButtonEmpty>
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiSmallButton
<EuiButton
onClick={() => setPage('configure')}
color="ghost"
size="s"
iconType="arrowLeft"
data-test-subj="previousButton"
>
Previous
</EuiSmallButton>
</EuiButton>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiSmallButton
<EuiButton
onClick={() => (page === 'review' ? createDatasource() : setPage('review'))}
size="s"
iconType="arrowRight"
Expand All @@ -345,7 +345,7 @@ export const DirectQueryDataSourceConfigure: React.FC<ConfigureDatasourceProps>
{page === 'configure'
? `Review Configuration`
: `Connect to ${DatasourceTypeToDisplayName[type]}`}
</EuiSmallButton>
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
</EuiBottomBar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
EuiText,
EuiFlexGroup,
EuiFlexItem,
EuiSmallButtonIcon,
EuiButtonIcon,
} from '@elastic/eui';
import { ApplicationStart } from 'opensearch-dashboards/public';
import { FormattedMessage } from 'react-intl';
Expand All @@ -38,7 +38,7 @@ export const NoDataSource: React.FC<DataSourceDropDownHeaderProps> = ({
}) => {
const [showPopover, setShowPopover] = useState<boolean>(false);
const button = (
<EuiSmallButtonIcon
<EuiButtonIcon
className="euiHeaderLink"
data-test-subj="dataSourceEmptyMenuHeaderLink"
aria-label={i18n.translate('dataSourceEmpty.dataSourceEmptyMenuHeaderLink', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,7 @@
*/

import React, { useState, useEffect } from 'react';
import {
EuiLink,
EuiIconTip,
EuiText,
EuiPopoverFooter,
EuiSmallButton,
EuiSpacer,
} from '@elastic/eui';
import { EuiLink, EuiIconTip, EuiText, EuiPopoverFooter, EuiButton, EuiSpacer } from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
import { DiscoverFieldBucket } from './discover_field_bucket';
import { getWarnings } from './lib/get_warnings';
Expand Down Expand Up @@ -114,7 +107,7 @@ export function DiscoverFieldDetails({
<div data-test-subj={`fieldVisualizeLink`}>
<EuiSpacer size="xs" />
{/* eslint-disable-next-line @elastic/eui/href-or-on-click */}
<EuiSmallButton
<EuiButton
onClick={(e) => handleVisualizeLinkClick(e)}
href={visualizeLink}
size="s"
Expand All @@ -125,7 +118,7 @@ export function DiscoverFieldDetails({
id="discover.fieldChooser.detailViews.visualizeLinkText"
defaultMessage="Visualize"
/>
</EuiSmallButton>
</EuiButton>
{warnings.length > 0 && (
<EuiIconTip type="alert" color="warning" content={warnings.join(' ')} />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ export function OpenSearchPanel({ onClose, makeUrl }: Props) {
<EuiFlyoutFooter>
<EuiFlexGroup justifyContent="flexEnd">
<EuiFlexItem grow={false}>
{/* eslint-disable-next-line @elastic/eui/href-or-on-click */}
<EuiSmallButtonEmpty
onClick={onClose}
href={addBasePath(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

import { FormattedMessage } from '@osd/i18n/react';
import React, { Fragment } from 'react';
import { EuiText, EuiSmallButton } from '@elastic/eui';
import { EuiText, EuiButton } from '@elastic/eui';
import { VisTypeAlias } from '../../vis_types';

interface Props {
Expand All @@ -52,15 +52,15 @@ export function NewVisHelp(props: Props) {
<p>
<strong>{t.promotion!.description}</strong>
</p>
<EuiSmallButton
<EuiButton
onClick={() => props.onPromotionClicked(t)}
fill
size="s"
iconType="popout"
iconSide="right"
>
{t.promotion!.buttonText}
</EuiSmallButton>
</EuiButton>
</Fragment>
))}
</EuiText>
Expand Down

0 comments on commit 0c9fba0

Please sign in to comment.