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:
Josh Dover 2020-01-21 09:19:08 -07:00 committed by GitHub
parent 2bf111c50f
commit b0af1bf95c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View file

@ -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);
}); });
}); });

View file

@ -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,