[Dashboards as code] consolidate URL BWC and add functional tests (#221989)

Closes https://github.com/elastic/kibana/issues/221683

PR does the following
* Consolidates `SharedDashboardState` and `DashboardLocatorParams` types
into a single type `DashboardLocatorParams`.
* Combine URL parsing and locator parsing into single function,
`extractDashboardState`. Previously this was done in 2 seperate code
paths: `loadDashboardHistoryLocationState` for locator state and
`loadAndRemoveDashboardState` for URL state.
* `extractDashboardState` takes `unknown` instead of
`DashboardLocatorParams`. Input value could contain legacy versions of
`DashboardLocatorParams` or really anything since its provided in the
URL by users. `unknown` better reflects that the input could be a lot of
different things.
* `extractDashboardState` uses duck typing to try its best to convert
from legacy versions of `DashboardLocatorParams` to current
`DashboardState` type
* Replaced `bwc_shared_urls` functional test with unit tests
* Added function test `bwc_short_urls` functional tests to ensure stored
URLs continue to work. Added tests for 8.14, 8.18, and 8.19 URL state.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Devon Thomson <devon.thomson@elastic.co>
This commit is contained in:
Nathan Reese 2025-06-04 18:30:11 -06:00 committed by GitHub
parent fca224701f
commit 5e594b4a82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 958 additions and 381 deletions

View file

@ -20,7 +20,7 @@ pageLoadAssetSize:
console: 61298
contentConnectors: 65000
contentManagement: 16254
controls: 12000
controls: 13000
core: 564663
crossClusterReplication: 65408
customIntegrations: 22034