[Discover] Fix resource badge text rendering (#211885)

## Summary

Fixes the resource badge rendering so that the formatting does not
output html when the page has a filter applied to it. Badges will no
longer have `<mark>` applied to the text.

<img alt="Resource badge fix 2025-02-20 114954"
src="https://github.com/user-attachments/assets/f92c3c5d-152f-42c5-8159-ba34f6cd174e"
/>

## How to test

- Setup an edge-oblt cluster to point to in `kibana.dev.yml`, or create
a data view with an id that contains `apm_static_data_view_id`, so for
example `apm_static_data_view_id_default`. Then, add the following as
well to the `kibana.dev.yaml`:
```yaml
discover.experimental.enabledProfiles:
  - traces-data-source-profile
```
- Go to Discover page with the data view enabled
- Add a filter for one of the resource badge fields: service.name,
event.outcome
- The formatting on the badge should not show `<mark>` around the text
label, and instead only on the flyout, will the filtered fields show the
marked formatting.
This commit is contained in:
Gonçalo Rica Pais da Silva 2025-02-21 18:20:33 +01:00 committed by GitHub
parent ff84c0e85a
commit dcca0ba567
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -175,7 +175,7 @@ export const createResourceFields = ({
fieldFormats,
dataView,
dataView.getFieldByName(name),
'html'
'text'
);
return {

View file

@ -50,7 +50,7 @@ export const getServiceNameCell =
props.fieldFormats,
props.dataView,
field,
'html'
'text'
);
return (