[dashboard] fix legacy embeddables do not render in print mode (#211072)

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

Immediately resolve `DashboardContainer.untilContainerInitialized` when
in print mode since controlGroupApi will never become available.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Nathan Reese 2025-02-18 09:09:44 -07:00 committed by GitHub
parent c509757553
commit 1829e15687
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -235,6 +235,11 @@ export class DashboardContainer
const controlGroupApi$ = new BehaviorSubject<ControlGroupApi | undefined>(undefined);
async function untilContainerInitialized(): Promise<void> {
return new Promise((resolve) => {
if (initialInput.viewMode === ViewMode.PRINT) {
// control group is not created in print mode
resolve();
return;
}
controlGroupApi$
.pipe(
skipWhile((controlGroupApi) => !controlGroupApi),