diff --git a/README.md b/README.md index 4b64e45..7533df2 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Zentrale, barrierearme Portalnavigation aus SharePoint Managed Metadata für Sha | Eigenschaft | Wert | |---|---| -| Version | 2.2.3 | +| Version | 2.2.4 | | SharePoint Framework | 1.4.1 | | Node.js für den Build | 8.17.0 | | Moderne Seiten | SPFx Application Customizer | @@ -272,6 +272,10 @@ MegaMenu/ ## Versionshistorie +### 2.2.4 + +- Der Ladehinweis wird auch dann zuverlässig entfernt, wenn der Custom-Branding-Host während des asynchronen Ladens erzeugt wird. + ### 2.2.1 - Terms mit `_Sys_Nav_ExcludedProviders = GlobalNavigationTaxonomyProvider` werden einschließlich ihres Unterbaums diff --git a/ToDo.md b/ToDo.md index 5e1c463..43d1609 100644 --- a/ToDo.md +++ b/ToDo.md @@ -1,4 +1,4 @@ -# MegaMenu – Arbeitsplan Version 2.2.3 +# MegaMenu – Arbeitsplan Version 2.2.4 Status: Implementierung abgeschlossen; Ship-Build auf der vorgesehenen Node-8-Buildumgebung ausstehend diff --git a/config/package-solution.json b/config/package-solution.json index 0b000a3..054b8c6 100644 --- a/config/package-solution.json +++ b/config/package-solution.json @@ -3,7 +3,7 @@ "solution": { "name": "mega-menu-client-side-solution", "id": "f4660e06-ce08-43ee-bfb7-5c4464e01133", - "version": "2.2.3.0", + "version": "2.2.4.0", "includeClientSideAssets": true, "skipFeatureDeployment": true }, diff --git a/package-lock.json b/package-lock.json index ab5d507..b370c91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mega-menu", - "version": "2.2.3", + "version": "2.2.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7561b2f..d13fdf0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mega-menu", - "version": "2.2.3", + "version": "2.2.4", "private": true, "main": "lib/index.js", "engines": { diff --git a/src/extensions/megaMenu/MegaMenuApplicationCustomizer.ts b/src/extensions/megaMenu/MegaMenuApplicationCustomizer.ts index 369668f..8a821d8 100644 --- a/src/extensions/megaMenu/MegaMenuApplicationCustomizer.ts +++ b/src/extensions/megaMenu/MegaMenuApplicationCustomizer.ts @@ -37,13 +37,14 @@ export default class MegaMenuApplicationCustomizer private _topPlaceholder: PlaceholderContent | undefined; private _menuContainer: HTMLElement | undefined; private _renderer: MegaMenuRenderer | undefined; + private _statusElement: HTMLElement | undefined; @override public onInit(): Promise { const debug: boolean = this._isDebugEnabled(); debugLog(debug, LOG_SOURCE, 'onInit started.', { componentId: UserCustomActionMegaMenuId, - version: '2.2.0', + version: '2.2.4', properties: this.properties || {}, pageUrl: window.location.href, webUrl: this.context.pageContext.web.absoluteUrl, @@ -132,6 +133,8 @@ export default class MegaMenuApplicationCustomizer return; } + this._clearStatus(); + if (this._renderer) { debugLog(debug, LOG_SOURCE, 'Disposing the previous renderer instance.'); this._renderer.dispose(); @@ -203,6 +206,7 @@ export default class MegaMenuApplicationCustomizer private _onDispose = (): void => { this.context.placeholderProvider.changedEvent.remove(this, this._renderPlaceHolders); + this._clearStatus(); if (this._renderer) { this._renderer.dispose(); this._renderer = undefined; @@ -250,6 +254,7 @@ export default class MegaMenuApplicationCustomizer if (!this._topPlaceholder) { return; } + this._clearStatus(); this._menuContainer = this._getOrCreateContainer('CustomHeader', this._topPlaceholder); const container: HTMLElement = this._menuContainer || this._topPlaceholder.domElement; container.innerHTML = ''; @@ -258,6 +263,14 @@ export default class MegaMenuApplicationCustomizer status.setAttribute('role', 'status'); status.textContent = message; container.appendChild(status); + this._statusElement = status; + } + + private _clearStatus(): void { + if (this._statusElement && this._statusElement.parentNode) { + this._statusElement.parentNode.removeChild(this._statusElement); + } + this._statusElement = undefined; } private _isGuid(value: string): boolean { diff --git a/tests/validate-static-assets.js b/tests/validate-static-assets.js index 809a251..89b1527 100644 --- a/tests/validate-static-assets.js +++ b/tests/validate-static-assets.js @@ -41,6 +41,10 @@ validateStyle('classic/megamenu-classic.css'); validateStyle('src/extensions/megaMenu/MegaMenu.module.scss'); var modernStyles = read('src/extensions/megaMenu/MegaMenu.module.scss'); +var applicationCustomizer = read('src/extensions/megaMenu/MegaMenuApplicationCustomizer.ts'); +assert('modern loading status is cleared before menu render', + applicationCustomizer.indexOf('this._clearStatus();') >= 0 && + applicationCustomizer.indexOf('private _statusElement: HTMLElement | undefined;') >= 0); [ 'white', 'neutralLighter',