[Dashboard] State extraction as a consistent override#259839
[Dashboard] State extraction as a consistent override#259839ThomThomson merged 3 commits intoelastic:mainfrom
Conversation
|
/ci |
|
Pinging @elastic/kibana-presentation (Team:Presentation) |
| }; | ||
|
|
||
| const { panels, savedObjectReferences } = extractPanelsState(stateAsObject); | ||
| if (panels?.length) dashboardState.panels = panels; |
There was a problem hiding this comment.
This may cause problems if URL return empty array and then that empty array removes all panels as override state.
I think you should add a length check to loadDashboardApi so panels is only overridden if there is a length
https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/dashboard/public/dashboard_api/load_dashboard_api/load_dashboard_api.ts#L77
There was a problem hiding this comment.
That is how it was before, but IMO an override should override. If you pass in empty panels to the URL, that should only happen because the user deleted all panels before sharing the Dashboard. There is a difference between
panels: undefined; // no panels in this URL, fall back to what you had and
panels: []; // explicitly setting panels to an empty array
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
Async chunks
|
…heck * commit '6f040b29a5220ce12886a9731f656613e50aff06': (34 commits) [Entity Analytics] Add entity resolution UI to service flyout (elastic#260504) [Dashboard] Fix setState in embeddables (elastic#260082) [EDR Workflows] Unskip FTR tests that failed due to transient Fleet service unavailability (elastic#260519) [Observability:Streams] Fix query streams error handling test (elastic#260777) [Alerting v2] Dispatcher grouping modes, throttle strategies, and matcher autosuggestion (elastic#260249) [Dashboard] State extraction as a consistent override (elastic#259839) [Alerting v2] [Rule authoring] Fix rule name validation and error visibility in create/edit flow (elastic#260337) [Fix] re-introduce sln breadcrumbs to unified rules (elastic#260289) [Security Solution][Endpoint] Updated kibana docs to include `xpack.securitySolution.maxEndpointScriptFileSize` as configurable in cloud (elastic#260568) [Alerting v2] updated the alerting-v2-constants package with artifacts constants, fix to the runbook max characters (elastic#260342) [Automatic Import V2] Provide user tooltips (elastic#260725) [One Workflow] Deduplicate step types by base type in workflow list (elastic#260763) [Security Solution] Execution results UI: Enable the feature flag (elastic#260711) [Metrics][Discover] internal/search/esql_async returns 200 but METRICS_INFO responds with error (elastic#260746) Collapse redundant anyOf/oneOf array unions in OAS query params (elastic#260585) [Unified rules] Hide stack rules from global search (elastic#260088) [Agent Builder] Sidebar navigation updates (elastic#260728) [* As Code] Use PUT for upserts (elastic#260318) Update EUI to v114.0.0 (elastic#259497) [Entity Resolution] Add contextual-security-apps as co-owner of resolution paths (elastic#260659) ... # Conflicts: # src/platform/plugins/shared/dashboard/public/index.ts
Makes the Dashboard URL state extraction function act as a pure override.
Summary
Closes #257722
Root cause of the issue was that the extraction functions treated the
panelsandpinned_panelskeys inconsistently, not providing panels as an override if a blank array was given.Instead, this function should act as a pure override. I.e. if panels or pinned panels are given to this function it should return what it's given regardless of the count of elements in the array.