Skip to content

Commit

Permalink
Merge branch 'main' into luigi-headless
Browse files Browse the repository at this point in the history
  • Loading branch information
hardl authored Oct 7, 2024
2 parents bb80947 + ff0fd4c commit 710a65c
Show file tree
Hide file tree
Showing 31 changed files with 227 additions and 43 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/checkmarx.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Checkmarx One Scan
on: workflow_dispatch
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
trigger_scan:
runs-on: ubuntu-latest
Expand Down
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ The lerna-changelog tool detects changes based on PR labels and maps them to sec
-->


## [v2.17.0] (2024-10-02)

#### :rocket: Added
* [#3946](https://github.com/SAP/luigi/pull/3946) Adds option to disable luigiCookie ([@walmazacn](https://github.com/walmazacn))
* [#3922](https://github.com/SAP/luigi/pull/3922) Adds node property for hiding global search ([@walmazacn](https://github.com/walmazacn))

#### :bug: Fixed
* [#3968](https://github.com/SAP/luigi/pull/3968) Fix fdToolLayout background-color ([@JohannesDoberer](https://github.com/JohannesDoberer))
* [#3964](https://github.com/SAP/luigi/pull/3964) Clean Luigi store ([@JohannesDoberer](https://github.com/JohannesDoberer))






## [v2.16.0] (2024-09-27)

#### :rocket: Added
Expand Down Expand Up @@ -1866,4 +1881,5 @@ The lerna-changelog tool detects changes based on PR labels and maps them to sec
[v2.14.2]: https://github.com/SAP/luigi/compare/v2.14.1...v2.14.2
[v2.14.3]: https://github.com/SAP/luigi/compare/v2.14.2...v2.14.3
[v2.15.0]: https://github.com/SAP/luigi/compare/v2.14.3...v2.15.0
[v2.16.0]: https://github.com/SAP/luigi/compare/v2.15.0...v2.16.0
[v2.16.0]: https://github.com/SAP/luigi/compare/v2.15.0...v2.16.0
[v2.17.0]: https://github.com/SAP/luigi/compare/v2.16.0...v2.17.0
33 changes: 33 additions & 0 deletions blog/2024-07-10-release-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Luigi v2.14
seoMetaDescription: Release notes for Luigi v2.14
author:
- Mahati Shankar
layout: blog
---

You can read about the new features in Luigi v2.14 in the release notes below.

<!-- Excerpt -->


#### E2E Tests With Nightwatch, WebdriverIO and Puppeteer

The testing-utilities library now additionally supports Nightwatch, WebdriverIO and Puppeteer. You can now use these testing frameworks for your e2e tests.

#### getCurrentRoute Has Been Added

[getCurrentRoute](https://docs.luigi-project.io/docs/luigi-core-api?section=getcurrentroute) has been added to the Luigi core API which as the name suggests returns the current Luigi route.

#### getCurrentTheme in WC Client

The method [getCurrentTheme](https://docs.luigi-project.io/docs/luigi-core-api?section=getcurrenttheme) is now part of the core API so you can now use it in the WebComponent client too.


#### Fix Top Nav Children Not Rendered

Fixed issue where nodes weren't rendered in the top navigation under certain conditions.

#### Bugfixes

For a full list of bugfixes in this release, see our [changelog](https://github.com/SAP/luigi/blob/main/CHANGELOG.md).
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
"@luigi-project/client": "^2.0.0",
"@luigi-project/testing-utilities": "^2.0.0"
},
"version": "2.16.0"
"version": "2.17.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"microfrontends",
"testing"
],
"version": "2.16.0",
"version": "2.17.0",
"engines": {
"node": ">=18.19.1"
}
Expand Down
4 changes: 2 additions & 2 deletions client-frameworks-support/testing-utilities/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client-frameworks-support/testing-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"microfrontends",
"testing"
],
"version": "2.16.0",
"version": "2.17.0",
"engines": {
"node": ">=18.19.1"
}
Expand Down
2 changes: 1 addition & 1 deletion client/public/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"micro-frontends",
"microfrontends"
],
"version": "2.16.0"
"version": "2.17.0"
}
5 changes: 4 additions & 1 deletion client/src/lifecycleManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class LifecycleManager extends LuigiClientBase {
helpers.setLuigiCoreDomain(e.origin);
this.luigiInitialized = true;
this._notifyInit(e.origin);
this._tpcCheck();
helpers.sendPostMessageToLuigiCore({ msg: 'luigi.init.ok' });
});

Expand Down Expand Up @@ -135,10 +136,12 @@ class LifecycleManager extends LuigiClientBase {
},
'*'
);
this._tpcCheck();
}

_tpcCheck() {
if (this.currentContext?.internal?.thirdPartyCookieCheck?.disabled) {
return;
}
let tpc = 'enabled';
let cookies = document.cookie;
let luigiCookie;
Expand Down
1 change: 1 addition & 0 deletions container/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/test-app/bundle.js
/test-app/bundle.js.map
/test-app/compound/luigi-element.js
/test-app/iframe/luigi-client.js
/public/**/*.ts

/coverage
Expand Down
18 changes: 15 additions & 3 deletions container/cypress/e2e/test-app/iframe/iframe-container.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ describe('Iframe Container Test', () => {
stub = cy.stub();
});

it('should sent third party cookies request', () => {
cy.on('window:alert', stub);

cy.get(containerSelector).should('not.have.attr', 'skip-cookie-check');
cy.get(containerSelector)
.shadow()
.get('iframe')
.then(() => {
cy.wrap(stub).should('have.been.calledWith', 'set-third-party-cookies-request');
cy.getCookie('luigiCookie').should('exist');
});
});

it('navigation sent', () => {
cy.get(containerSelector)
.shadow()
Expand All @@ -24,13 +37,12 @@ describe('Iframe Container Test', () => {
});

it('sendCustomMessage', () => {
cy.get('#btn-1')
.click()
cy.get('#btn-1').click();
cy.get(containerSelector)
.shadow()
.get('iframe')
.then(iframe => {
const $body = iframe.contents().find('body')
const $body = iframe.contents().find('body');
cy.wrap($body)
.find('#content')
.should('have.text', 'Received Custom Message: some data');
Expand Down
24 changes: 24 additions & 0 deletions container/cypress/e2e/test-app/iframe/iframe-cookies.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
describe('Iframe Cookies Test', () => {
const containerSelector = '[data-test-id="iframe-based-container-test"]';
let stub;

beforeEach(() => {
cy.visit('http://localhost:8080/iframe/iframe-cookies.html');
stub = cy.stub();
});

it('should not sent third party cookies request', () => {
cy.on('window:alert', stub);

cy.get(containerSelector)
.should('have.attr', 'skip-cookie-check')
.and('match', /true/);
cy.get(containerSelector)
.shadow()
.get('iframe')
.then(() => {
cy.wrap(stub).should('not.have.been.calledWith', 'set-third-party-cookies-request');
cy.getCookie('luigiCookie').should('not.exist');
});
});
});
3 changes: 2 additions & 1 deletion container/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
"bundle": "npm run build",
"dev": "rollup -c -w",
"copyBundle": "cp public/bundle.js public/bundle.js.map test-app/ && cp public/bundle.js public/bundle.js.map examples/ || COPY public\\* test-app\\",
"copyLuigiClient": "cp ../client/public/luigi-client.js test-app/iframe",
"copyLuigiElement": "cp ../client/src/luigi-element.js test-app/compound",
"serve": "npm run build && npm run copyLuigiElement && npm run copyBundle && sirv -D -c test-app --no-clear",
"serve": "npm run build && npm run copyLuigiClient && npm run copyLuigiElement && npm run copyBundle && sirv -D -c test-app --no-clear",
"bundle:watch": "chokidar \"src/**/*.*\" -c \"npm run build && npm run copyBundle\"",
"start": "concurrently -k \"npm run serve\" \"npm run bundle:watch\"",
"start-examples":"npm run copyBundle && sirv -D -c examples --no-clear",
Expand Down
1 change: 1 addition & 0 deletions container/public/LuigiCompoundContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { LuigiCompoundContainer as default } from "./bundle.js";
1 change: 1 addition & 0 deletions container/public/LuigiContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { LuigiContainer as default } from "./bundle.js";
3 changes: 3 additions & 0 deletions container/src/LuigiContainer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
pathParams: { type: 'Object', reflect: false, attribute: 'path-params' },
sandboxRules: { type: 'Array', reflect: false, attribute: 'sandbox-rules' },
searchParams: { type: 'Object', reflect: false, attribute: 'search-params' },
skipCookieCheck: { type: 'String', reflect: false, attribute: 'skip-cookie-check' },
skipInitCheck: { type: 'Boolean', reflect: false, attribute: 'skip-init-check' },
theme: { type: 'String', reflect: false, attribute: 'theme' },
userSettings: { type: 'Object', reflect: false, attribute: 'user-settings' },
Expand Down Expand Up @@ -79,6 +80,7 @@
export let pathParams: any;
export let sandboxRules: string[];
export let searchParams: any;
export let skipCookieCheck: 'false' | 'true';
export let skipInitCheck: boolean;
export let theme: string;
export let userSettings: any;
Expand Down Expand Up @@ -113,6 +115,7 @@
pathParams &&
sandboxRules &&
searchParams &&
skipCookieCheck &&
skipInitCheck &&
theme &&
userSettings
Expand Down
6 changes: 5 additions & 1 deletion container/src/services/container.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ export class ContainerService {
{
msg: LuigiInternalMessageID.SEND_CONTEXT_HANDSHAKE,
context: targetCnt.context || {},
internal: {},
internal: {
thirdPartyCookieCheck: {
disabled: targetCnt.skipCookieCheck === 'true'
}
},
authData: targetCnt.authData || {}
},
'*'
Expand Down
38 changes: 38 additions & 0 deletions container/test-app/iframe/iframe-cookies.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<html>
<head>
<script type="module">
import '../bundle.js';
</script>
</head>
<body>
<h3>
This page is used to test **skip-cookie-check** feature for iFrame based LuigiContainer
</h3>

<div style="border:solid 1px blue; height: 400px">
<!-- Luigi Container to test general functionality-->
<luigi-container
data-test-id="iframe-based-container-test"
viewURL="./microfrontend.html"
skip-cookie-check="true"
></luigi-container>
</div>

<script type="module">
import Events from '../bundle.js';

const luigiContainer = document.querySelector(
'[data-test-id="iframe-based-container-test"]'
);

// SET_THIRD_PARTY_COOKIES_REQUEST - called on microfrontend startup
luigiContainer.addEventListener(Events.SET_THIRD_PARTY_COOKIES_REQUEST, event => {
console.log(Events.SET_THIRD_PARTY_COOKIES_REQUEST, event);
alert(
Events.SET_THIRD_PARTY_COOKIES_REQUEST,
'message received: ' + JSON.stringify(event.detail.data.data)
);
});
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion container/test-app/iframe/microfrontend.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<title></title>
<meta charset="utf-8" />
<script src="https://fiddle.luigi-project.io/vendor/luigi-client/luigi-client.js"></script>
<script src="./luigi-client.js"></script>
<style>
html,
body {
Expand Down
5 changes: 5 additions & 0 deletions container/test-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ <h1>Container Test-App</h1>
<td><a href="iframe/iframe-settings.html">iFrame Settings</a></td>
<td><a href="compound/nested.html">Nested</a></td>
</tr>
<tr>
<td><a href="#">-</a></td>
<td><a href="iframe/iframe-cookies.html">iFrame Cookies</a></td>
<td><a href="#">-</a></td>
</tr>
<!-- Add more rows as needed -->
</tbody>
</table>
Expand Down
13 changes: 11 additions & 2 deletions container/test/services/container.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('getContainerManager messageListener', () => {
gtcSpy.mockRestore();
});

it('test get context message', () => {
it('test get context message', () => {
const event = {
source: cw,
data: {
Expand All @@ -87,7 +87,16 @@ describe('getContainerManager messageListener', () => {
cw.postMessage = postMessageMock;

// Define the message to send and target Origin
const message = {"context": {}, "internal": {}, "msg": "luigi.init", "authData":{}};
const message = {
"authData":{},
"context": {},
"internal": {
"thirdPartyCookieCheck": {
"disabled": false
}
},
"msg": "luigi.init"
};
const targetOrigin = "*";

// Call the method that should trigger postMessage
Expand Down
6 changes: 6 additions & 0 deletions container/typings/LuigiContainer.svelte.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ export default class LuigiContainer extends HTMLElement {
*/
activeFeatureToggleList: string[];

/**
* If set to true, skips third party cookie check
* @since NEXT_RELEASE_CONTAINER
*/
skipCookieCheck: 'false' | 'true';

/**
* If set to true, skips handshake and ready event is fired immediately
* @since 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion core/public/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
"micro-frontends",
"microfrontends"
],
"version": "2.16.0"
"version": "2.17.0"
}
2 changes: 1 addition & 1 deletion core/public_root/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
"micro-frontends",
"microfrontends"
],
"version": "2.16.0"
"version": "2.17.0"
}
Loading

0 comments on commit 710a65c

Please sign in to comment.