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

user-settings='{"language":"it", "date":""}' anchor="testAnchorCompound" defer-init="false" + skip-init-check="true" webcomponent="true" theme="sap_fiori_3" locale="en" diff --git a/container/typings/LuigiCompoundContainer.svelte.d.ts b/container/typings/LuigiCompoundContainer.svelte.d.ts index 86bc479218..6b4d21a96c 100644 --- a/container/typings/LuigiCompoundContainer.svelte.d.ts +++ b/container/typings/LuigiCompoundContainer.svelte.d.ts @@ -110,6 +110,12 @@ export default class LuigiCompoundContainer extends HTMLElement { */ webcomponent: boolean | WebComponentSettings | string; + /** + * If set to true, skips handshake and ready event is fired immediately. + * @since NEXT_RELEASE_CONTAINER + */ + skipInitCheck: boolean; + /** * The list of active feature toggles to be passed to the compound microfrontend. * @since NEXT_RELEASE_CONTAINER diff --git a/docs/luigi-compound-container-api.md b/docs/luigi-compound-container-api.md index 613404f32d..5f542f4cf1 100644 --- a/docs/luigi-compound-container-api.md +++ b/docs/luigi-compound-container-api.md @@ -190,6 +190,16 @@ Type: ([boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Glo * **since**: 1.0.0 +### skipInitCheck + +If set to true, skips handshake and ready event is fired immediately. + +Type: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) + +**Meta** + +* **since**: NEXT_RELEASE_CONTAINER + ### activeFeatureToggleList The list of active feature toggles to be passed to the compound microfrontend.