Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds skipInitCheck property to LuigiCompoundContainer #3939

Merged
merged 15 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 &&
ndricimrr marked this conversation as resolved.
Show resolved Hide resolved
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