[ML] AIOps: Enhance the UX for grouped results which only contain field / value pairs that appear in other groups (#148757)

## Summary

Related meta issue: https://github.com/elastic/kibana/issues/146162

This PR updates the UX for grouped results which only contain field /
value pairs that appear in other groups. In the updated text the '+' and
'more' are dropped from the label.

<img width="1098" alt="image"
src="https://user-images.githubusercontent.com/7405507/212317301-7cd40c62-d96f-4a0e-934e-2dc6e39e25a4.png">


### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
This commit is contained in:
Melissa Alvarez 2023-01-13 09:36:20 -07:00 committed by GitHub
parent c9469e0b22
commit 852072f41b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -292,13 +292,20 @@ export const SpikeAnalysisGroupsTable: FC<SpikeAnalysisTableProps> = ({
<br />
</>
) : null}
{repeatedValues.length > 0 ? (
{repeatedValues.length > 0 && valuesBadges.length ? (
<FormattedMessage
id="xpack.aiops.explainLogRateSpikes.spikeAnalysisTableGroups.moreRepeatedLabel"
defaultMessage="+{count, plural, one {# more field/value pair} other {# more field/value pairs}} also appearing in other groups"
values={{ count: repeatedValues.length }}
/>
) : null}
{repeatedValues.length > 0 && !valuesBadges.length ? (
<FormattedMessage
id="xpack.aiops.explainLogRateSpikes.spikeAnalysisTableGroups.onlyMoreRepeatedLabel"
defaultMessage="{count, plural, one {# field/value pair} other {# field/value pairs}} also appearing in other groups"
values={{ count: repeatedValues.length }}
/>
) : null}
</EuiBadge>
<EuiSpacer size="xs" />
</>