Clear core loading indicator just before UI is rendered (#55242)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
2bf111c50f
commit
b0af1bf95c
|
@ -429,15 +429,14 @@ describe('Notifications targetDomElement', () => {
|
||||||
rootDomElement,
|
rootDomElement,
|
||||||
});
|
});
|
||||||
|
|
||||||
let targetDomElementParentInStart: HTMLElement | null;
|
let targetDomElementInStart: HTMLElement | null;
|
||||||
MockNotificationsService.start.mockImplementation(({ targetDomElement }): any => {
|
MockNotificationsService.start.mockImplementation(({ targetDomElement }): any => {
|
||||||
expect(targetDomElement.parentElement).not.toBeNull();
|
targetDomElementInStart = targetDomElement;
|
||||||
targetDomElementParentInStart = targetDomElement.parentElement;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Starting the core system should pass the targetDomElement as a child of the rootDomElement
|
// Starting the core system should pass the targetDomElement as a child of the rootDomElement
|
||||||
await core.setup();
|
await core.setup();
|
||||||
await core.start();
|
await core.start();
|
||||||
expect(targetDomElementParentInStart!).toBe(rootDomElement);
|
expect(targetDomElementInStart!.parentElement).toBe(rootDomElement);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -222,13 +222,6 @@ export class CoreSystem {
|
||||||
const notificationsTargetDomElement = document.createElement('div');
|
const notificationsTargetDomElement = document.createElement('div');
|
||||||
const overlayTargetDomElement = document.createElement('div');
|
const overlayTargetDomElement = document.createElement('div');
|
||||||
|
|
||||||
// ensure the rootDomElement is empty
|
|
||||||
this.rootDomElement.textContent = '';
|
|
||||||
this.rootDomElement.classList.add('coreSystemRootDomElement');
|
|
||||||
this.rootDomElement.appendChild(coreUiTargetDomElement);
|
|
||||||
this.rootDomElement.appendChild(notificationsTargetDomElement);
|
|
||||||
this.rootDomElement.appendChild(overlayTargetDomElement);
|
|
||||||
|
|
||||||
const overlays = this.overlay.start({
|
const overlays = this.overlay.start({
|
||||||
i18n,
|
i18n,
|
||||||
targetDomElement: overlayTargetDomElement,
|
targetDomElement: overlayTargetDomElement,
|
||||||
|
@ -276,6 +269,14 @@ export class CoreSystem {
|
||||||
};
|
};
|
||||||
|
|
||||||
const plugins = await this.plugins.start(core);
|
const plugins = await this.plugins.start(core);
|
||||||
|
|
||||||
|
// ensure the rootDomElement is empty
|
||||||
|
this.rootDomElement.textContent = '';
|
||||||
|
this.rootDomElement.classList.add('coreSystemRootDomElement');
|
||||||
|
this.rootDomElement.appendChild(coreUiTargetDomElement);
|
||||||
|
this.rootDomElement.appendChild(notificationsTargetDomElement);
|
||||||
|
this.rootDomElement.appendChild(overlayTargetDomElement);
|
||||||
|
|
||||||
const rendering = this.rendering.start({
|
const rendering = this.rendering.start({
|
||||||
application,
|
application,
|
||||||
chrome,
|
chrome,
|
||||||
|
|
Loading…
Reference in a new issue