diff --git a/container/cypress/e2e/test-app/compound/wc-compound-container.cy.js b/container/cypress/e2e/test-app/compound/wc-compound-container.cy.js index 3fca178d08..63d4f06327 100644 --- a/container/cypress/e2e/test-app/compound/wc-compound-container.cy.js +++ b/container/cypress/e2e/test-app/compound/wc-compound-container.cy.js @@ -117,6 +117,12 @@ describe('Compound Container Tests', () => { }); }); + it('LuigiClient API - getSkipInitCheck', () => { + cy.get(containerSelector) + .invoke('attr', 'skip-init-check') + .should('eq', 'true'); + }); + it('LuigiClient API - getActiveFeatureToggles', () => { cy.on('window:alert', stub); diff --git a/container/src/LuigiCompoundContainer.svelte b/container/src/LuigiCompoundContainer.svelte index 80dc657322..38f489dea7 100644 --- a/container/src/LuigiCompoundContainer.svelte +++ b/container/src/LuigiCompoundContainer.svelte @@ -29,6 +29,7 @@ reflect: false, attribute: 'search-params', }, + skipInitCheck: { type: 'Boolean', reflect: false, attribute: 'skip-init-check' }, theme: { type: 'String', reflect: false, attribute: 'theme' }, userSettings: { type: 'Object', @@ -81,6 +82,7 @@ export let nodeParams: any; export let pathParams: any; export let searchParams: any; + export let skipInitCheck: boolean; export let theme: string; export let userSettings: any; export let viewurl: string; @@ -107,6 +109,7 @@ nodeParams && pathParams && searchParams && + skipInitCheck && theme && userSettings ); @@ -147,7 +150,7 @@ } webcomponentService.renderWebComponentCompound(node, thisComponent.getNoShadow() ? thisComponent : mainComponent, ctx).then(compCnt => { eventBusElement = compCnt as HTMLElement; - if (thisComponent.hasAttribute('skip-init-check') || !node.viewUrl) { + if (skipInitCheck || !node.viewUrl) { thisComponent.initialized = true; setTimeout(() => { webcomponentService.dispatchLuigiEvent(Events.INITIALIZED, {}); diff --git a/container/test-app/compound/compoundClientAPI.html b/container/test-app/compound/compoundClientAPI.html index df52da4a2a..6eccf82165 100644 --- a/container/test-app/compound/compoundClientAPI.html +++ b/container/test-app/compound/compoundClientAPI.html @@ -35,6 +35,7 @@