feat: Update version to 2.2.4 and enhance loading status handling in MegaMenu

This commit is contained in:
Torsten Brendgen
2026-08-19 20:52:30 +02:00
parent df3df26be9
commit 79b4a8a6c4
7 changed files with 27 additions and 6 deletions
@@ -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<void> {
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 {