Skip to content

Commit

Permalink
Merge branch 'main' into unload-fn-improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesDoberer authored Oct 1, 2024
2 parents 3b02009 + 98d4caf commit e2736f3
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/workflows/checkmarx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Checkmarx One Scan
on: workflow_dispatch
jobs:
trigger_scan:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkmarx One CLI Action
uses: checkmarx/ast-github-action@main #Github Action version
with:
project_name: Luigi
cx_tenant: sap
base_uri: https://checkmarx.tools.sap
base_auth_uri: https://checkmarx.tools.sap
cx_client_id: ${{ secrets.CXONE_CLIENT_ID }}
cx_client_secret: ${{ secrets.CXONE_CLIENT_SECRET }}
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 e2736f3

Please sign in to comment.