Skip to content

Commit

Permalink
Adds skipInitCheck property to LuigiCompoundContainer (#3939)
Browse files Browse the repository at this point in the history
  • Loading branch information
walmazacn authored Oct 1, 2024
1 parent c54dda8 commit 9488ccd
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
5 changes: 4 additions & 1 deletion container/src/LuigiCompoundContainer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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;
Expand All @@ -107,6 +109,7 @@
nodeParams &&
pathParams &&
searchParams &&
skipInitCheck &&
theme &&
userSettings
);
Expand Down Expand Up @@ -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, {});
Expand Down
1 change: 1 addition & 0 deletions container/test-app/compound/compoundClientAPI.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ <h3>
user-settings='{"language":"it", "date":""}'
anchor="testAnchorCompound"
defer-init="false"
skip-init-check="true"
webcomponent="true"
theme="sap_fiori_3"
locale="en"
Expand Down
6 changes: 6 additions & 0 deletions container/typings/LuigiCompoundContainer.svelte.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions docs/luigi-compound-container-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 9488ccd

Please sign in to comment.