Skip to content

Commit

Permalink
[ML] Consolidate button icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Aug 18, 2020
1 parent 74071d9 commit c9fc1b2
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ export class AnnotationsTable extends Component {
<EuiButtonIcon
onClick={() => this.openSingleMetricView(annotation)}
disabled={!isDrillDownAvailable}
iconType="stats"
iconType="visLine"
aria-label={openInSingleMetricViewerAriaLabelText}
/>
</EuiToolTip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const AnomalyResultsViewSelector: FC<Props> = ({ viewId }) => {
label: i18n.translate('xpack.ml.anomalyResultsViewSelector.anomalyExplorerLabel', {
defaultMessage: 'View results in the Anomaly Explorer',
}),
iconType: 'tableOfContents',
iconType: 'visTable',
value: 'explorer',
'data-test-subj': 'mlAnomalyResultsViewSelectorExplorer',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const ViewResultsPanel: FC<Props> = ({ jobId, analysisType }) => {
<Fragment>
<EuiCard
className="dfAnalyticsCreationWizard__card"
icon={<EuiIcon size="xxl" type="tableDensityNormal" />}
icon={<EuiIcon size="xxl" type="visTable" />}
title={i18n.translate('xpack.ml.dataframe.analytics.create.viewResultsCardTitle', {
defaultMessage: 'View Results',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ export const useStartAction = (canStartStopDataFrameAnalytics: boolean) => {
canStartStopDataFrameAnalytics={canStartStopDataFrameAnalytics}
/>
),
available: (i: DataFrameAnalyticsListRow) => !isDataFrameAnalyticsRunning(i.stats.state),
available: (i: DataFrameAnalyticsListRow) =>
!isDataFrameAnalyticsRunning(item.stats.state) &&
!isDataFrameAnalyticsFailed(item.stats.state),
enabled: startButtonEnabled,
description: startActionNameText,
icon: 'play',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export const useStopAction = (canStartStopDataFrameAnalytics: boolean) => {
const action: DataFrameAnalyticsListAction = useMemo(
() => ({
name: () => <StopActionName isDisabled={!canStartStopDataFrameAnalytics} />,
available: (i: DataFrameAnalyticsListRow) => isDataFrameAnalyticsRunning(i.stats.state),
available: (i: DataFrameAnalyticsListRow) =>
isDataFrameAnalyticsRunning(i.stats.state) || isDataFrameAnalyticsFailed(i.stats.state),
enabled: () => canStartStopDataFrameAnalytics,
description: stopActionNameText,
icon: 'stop',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function ExplorerChartContainer({ series, severity, tooManyBuckets, wrapLabel })
<EuiToolTip position="top" content={textViewButton}>
<EuiButtonEmpty
iconSide="right"
iconType="stats"
iconType="visLine"
size="xs"
onClick={() => window.open(getExploreSeriesLink(series), '_blank')}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function ResultLinks({ jobs }) {
<EuiToolTip position="bottom" content={openJobsInSingleMetricViewerText}>
<EuiButtonIcon
href={getLink('timeseriesexplorer', jobs)}
iconType="stats"
iconType="visLine"
aria-label={openJobsInSingleMetricViewerText}
className="results-button"
isDisabled={singleMetricEnabled === false || jobActionsDisabled === true}
Expand All @@ -62,7 +62,7 @@ export function ResultLinks({ jobs }) {
<EuiToolTip position="bottom" content={openJobsInAnomalyExplorerText}>
<EuiButtonIcon
href={getLink('explorer', jobs)}
iconType="tableOfContents"
iconType="visTable"
aria-label={openJobsInAnomalyExplorerText}
className="results-button"
isDisabled={jobActionsDisabled === true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ export class ForecastsTable extends Component {
<EuiButtonIcon
onClick={() => this.openSingleMetricView(forecast)}
isDisabled={forecast.forecast_status !== FORECAST_REQUEST_STATE.FINISHED}
iconType="stats"
iconType="visLine"
aria-label={viewForecastAriaLabel}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const ViewLink: FC<Props> = ({ item }) => {
color="text"
size="xs"
onClick={clickHandler}
iconType="tableOfContents"
iconType="visTable"
aria-label={openJobsInAnomalyExplorerText}
className="results-button"
data-test-subj="mlAnalyticsJobViewButton"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ export const ExplorerLink: FC<Props> = ({ jobsList }) => {
color="text"
size="xs"
href={getLink('explorer', jobsList)}
iconType="tableOfContents"
iconType="visTable"
aria-label={openJobsInAnomalyExplorerText}
className="results-button"
data-test-subj={`openOverviewJobsInAnomalyExplorer`}
>
{i18n.translate('xpack.ml.overview.anomalyDetection.exploreActionName', {
defaultMessage: 'Explore',
{i18n.translate('xpack.ml.overview.anomalyDetection.viewActionName', {
defaultMessage: 'View',
})}
</EuiButtonEmpty>
</EuiToolTip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function getColumns(viewForecast) {
return (
<EuiButtonIcon
onClick={() => viewForecast(forecast.forecast_id)}
iconType="stats"
iconType="visLine"
aria-label={viewForecastAriaLabel}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function createOpenInExplorerAction(getStartServices: MlCoreSetup['getSta
id: 'open-in-anomaly-explorer',
type: OPEN_IN_ANOMALY_EXPLORER_ACTION,
getIconType(context: ActionContextMapping[typeof OPEN_IN_ANOMALY_EXPLORER_ACTION]): string {
return 'tableOfContents';
return 'visTable';
},
getDisplayName() {
return i18n.translate('xpack.ml.actions.openInAnomalyExplorerTitle', {
Expand Down

0 comments on commit c9fc1b2

Please sign in to comment.