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.
[SLOs] In Embeddables, show all related instances option (elastic#175503
) ## Summary in SLOs embeddable, added the ability show all related instances Overviews and alerts !! if selected SLO has group-by, it will give an option to show all related instances from the group-by field <img width="829" alt="image" src="https://github.com/elastic/kibana/assets/3505601/f57ad76b-4170-4fc0-8335-c0f0b2a8807e"> All related instances will appear as grid <img width="1728" alt="image" src="https://github.com/elastic/kibana/assets/3505601/c43f058a-1b43-4e44-807d-4157e1f4a2be">
- Loading branch information
1 parent
692f95e
commit 34dbd2a
Showing
16 changed files
with
383 additions
and
47 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
35 changes: 35 additions & 0 deletions
35
x-pack/plugins/observability/public/embeddable/slo/alerts/components/slo_included_count.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,35 @@ | ||
/* | ||
* 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 { i18n } from '@kbn/i18n'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import { useFetchSloList } from '../../../../hooks/slo/use_fetch_slo_list'; | ||
import { SloItem } from '../types'; | ||
|
||
export function SloIncludedCount({ slos }: { slos: SloItem[] }) { | ||
const { data: sloList } = useFetchSloList({ | ||
kqlQuery: slos.map((slo) => `slo.id:${slo.id}`).join(' or '), | ||
perPage: 0, | ||
}); | ||
|
||
return ( | ||
<FormattedMessage | ||
id="xpack.observability.sloAlertsWrapper.sLOsIncludedFlexItemLabel.withInstances" | ||
defaultMessage="{numOfSlos, number} {numOfSlos, plural, one {SLO} other {SLOs}}{instances} included" | ||
values={{ | ||
numOfSlos: slos.length, | ||
instances: i18n.translate( | ||
'xpack.observability.sloAlertsWrapper.sLOsIncludedFlexItemLabel.instancesCount', | ||
{ | ||
defaultMessage: ' ({count, number} {count, plural, one {Instance} other {Instances}})', | ||
values: { count: sloList?.total ?? 0 }, | ||
} | ||
), | ||
}} | ||
/> | ||
); | ||
} |
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
Oops, something went wrong.