-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into discover-create-where-filter
- Loading branch information
Showing
47 changed files
with
900 additions
and
396 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
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 was deleted.
Oops, something went wrong.
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
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
55 changes: 55 additions & 0 deletions
55
...k/plugins/observability_solution/slo/public/components/slo/burn_rate/burn_rate_header.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,55 @@ | ||
/* | ||
* 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 { EuiButtonGroup, EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import React from 'react'; | ||
import { SloTabId } from '../../../pages/slo_details/components/slo_details'; | ||
import { BurnRateOption } from './burn_rates'; | ||
interface Props { | ||
burnRateOption: BurnRateOption; | ||
setBurnRateOption: (option: BurnRateOption) => void; | ||
burnRateOptions: BurnRateOption[]; | ||
selectedTabId: SloTabId; | ||
} | ||
export function BurnRateHeader({ | ||
burnRateOption, | ||
burnRateOptions, | ||
setBurnRateOption, | ||
selectedTabId, | ||
}: Props) { | ||
const onBurnRateOptionChange = (optionId: string) => { | ||
const selected = burnRateOptions.find((opt) => opt.id === optionId) ?? burnRateOptions[0]; | ||
setBurnRateOption(selected); | ||
}; | ||
return ( | ||
<EuiFlexGroup justifyContent="spaceBetween"> | ||
<EuiFlexItem grow={false}> | ||
<EuiTitle size="xs"> | ||
<h2> | ||
{i18n.translate('xpack.slo.burnRate.title', { | ||
defaultMessage: 'Burn rate', | ||
})} | ||
</h2> | ||
</EuiTitle> | ||
</EuiFlexItem> | ||
{selectedTabId !== 'history' && ( | ||
<EuiFlexItem grow={false}> | ||
<EuiButtonGroup | ||
legend={i18n.translate('xpack.slo.burnRate.timeRangeBtnLegend', { | ||
defaultMessage: 'Select the time range', | ||
})} | ||
options={burnRateOptions.map((opt) => ({ id: opt.id, label: opt.label }))} | ||
idSelected={burnRateOption.id} | ||
onChange={onBurnRateOptionChange} | ||
buttonSize="compressed" | ||
/> | ||
</EuiFlexItem> | ||
)} | ||
</EuiFlexGroup> | ||
); | ||
} |
Oops, something went wrong.