[Discover][DataViews] Fix "View conflicts" button when data view id has special characters (#192374)

- Closes https://github.com/elastic/kibana/issues/192148

## Summary

This bug appears when a custom data view ID (like `logging-*:logs-*`) is
used. The PR adds decoding for the `id` param for Data view edit page.

### For testing

Create indices with different field types but with the same field names.

```
PUT my-index-1
{
  "mappings": {
    "dynamic": false,
    "properties": {
      "a": {
        "type": "float"
      }
    }
  }
}

PUT my-index-2
{
  "mappings": {
    "dynamic": false,
    "properties": {
      "a": {
        "type": "keyword"
      }
    }
  }
}

PUT my-index-1/_doc
{
  "a": 500.4
}

PUT my-index-2/_doc
{
  "a": "hi there"
}
```

Then create a data view with `my-index-*` as index pattern and a custom
id `logging-*:logs-*`. Navigate to Data Views Management page and check
the button.
This commit is contained in:
Julia Rechkunova 2024-09-10 09:38:23 +03:00 committed by GitHub
parent 4e8b050dab
commit 8da3f761f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -24,7 +24,7 @@ const EditIndexPatternCont: React.FC<RouteComponentProps<{ id: string }>> = ({ .
useEffect(() => {
dataViews
.get(props.match.params.id)
.get(decodeURIComponent(props.match.params.id))
.then((ip: DataView) => {
setIndexPattern(ip);
setBreadcrumbs(getEditBreadcrumbs(ip));