diff --git a/.github/workflows/mend.yml b/.github/workflows/mend.yml index ec53c3430e..d2836f810a 100644 --- a/.github/workflows/mend.yml +++ b/.github/workflows/mend.yml @@ -20,8 +20,8 @@ jobs: - uses: actions/cache@v4 with: path: ~/.cache - key: whitesource_cache-${{ github.ref }} - - run: sudo apt-get install build-essential python2 libgconf-2-4 libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb + key: whitesource_cache-${{ github.ref }} + - run: sudo apt-get install build-essential python-is-python3 libgtk2.0-0t64 libgtk-3-0t64 libgbm-dev libnotify-dev libnss3 libxss1 libasound2t64 libxtst6 xauth xvfb - run: npm --prefix ./client ci ./client - run: npm --prefix ./core ci ./core - run: npm --prefix ./website/landingpage/dev install ./website/landingpage/dev diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb8358e52b..c67fb43bf8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -111,7 +111,7 @@ jobs: ~/cypress-binary-cache key: buildcache-${{ github.ref }} - run: cp -r ~/tmp_build/* . - - run: sudo apt-get install libgconf-2-4 libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb + - run: sudo apt-get install libgtk2.0-0t64 libgtk-3-0t64 libgbm-dev libnotify-dev libnss3 libxss1 libasound2t64 libxtst6 xauth xvfb - run: npm install --prefix test/e2e-test-application @babel/plugin-proposal-class-properties - run: ls test - run: bash ./test/e2e-js.sh || exit 1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 710443ec1c..f9d27c01ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,36 @@ The lerna-changelog tool detects changes based on PR labels and maps them to sec --> +## [v2.20.0] (2025-02-18) + +#### :rocket: Added +* [#4144](https://github.com/SAP/luigi/pull/4144) Angular 19 support for client-support-angular library ([@walmazacn](https://github.com/walmazacn)) +* [#4137](https://github.com/SAP/luigi/pull/4137) Appswitcher enhancements ([@hardl](https://github.com/hardl)) + +#### :bug: Fixed +* [#4149](https://github.com/SAP/luigi/pull/4149) Filter out empty nav groups ([@hardl](https://github.com/hardl)) +* [#4148](https://github.com/SAP/luigi/pull/4148) Fix: Wrong backgroundColor for profile initials ([@JohannesDoberer](https://github.com/JohannesDoberer)) +* [#4140](https://github.com/SAP/luigi/pull/4140) Accessibility tab order ([@JohannesDoberer](https://github.com/JohannesDoberer)) + + + + +## [v2.19.2] (2025-01-16) + +#### :bug: Fixed +* [#4114](https://github.com/SAP/luigi/pull/4114) switch visibility of usersettings entry after prep of all data ([@hardl](https://github.com/hardl)) + + + +## [v2.19.1] (2025-01-16) + +#### :bug: Fixed +* [#4110](https://github.com/SAP/luigi/pull/4110) Fix: usersettings profile entry when set in afterInit ([@hardl](https://github.com/hardl)) +* [#4102](https://github.com/SAP/luigi/pull/4102) Fix: iconClassAttribute for sap-icons ([@hardl](https://github.com/hardl)) + + + + ## [v2.19.0] (2024-12-23) #### :rocket: Added @@ -1936,4 +1966,7 @@ The lerna-changelog tool detects changes based on PR labels and maps them to sec [v2.18.1]: https://github.com/SAP/luigi/compare/v2.18.0...v2.18.1 [v2.18.2]: https://github.com/SAP/luigi/compare/v2.18.1...v2.18.2 [v2.18.3]: https://github.com/SAP/luigi/compare/v2.18.2...v2.18.3 -[v2.19.0]: https://github.com/SAP/luigi/compare/v2.18.3...v2.19.0 \ No newline at end of file +[v2.19.0]: https://github.com/SAP/luigi/compare/v2.18.3...v2.19.0 +[v2.19.1]: https://github.com/SAP/luigi/compare/v2.19.0...v2.19.1 +[v2.19.2]: https://github.com/SAP/luigi/compare/v2.19.1...v2.19.2 +[v2.20.0]: https://github.com/SAP/luigi/compare/v2.19.2...v2.20.0 \ No newline at end of file diff --git a/blog/2025-02-12-luigi-container.md b/blog/2025-02-12-luigi-container.md new file mode 100644 index 0000000000..827f75e04a --- /dev/null +++ b/blog/2025-02-12-luigi-container.md @@ -0,0 +1,24 @@ +--- +title: Luigi Container v1.6 +seoMetaDescription: Release notes for Luigi Container v1.6 +author: + - Johannes Doberer +layout: blog +--- + +You can read about the new features in Luigi Container v1.6 in the release notes below. + + + + +#### Renamed `closeAlert` to `notifyAlertClosed` + +We deprecated the function `closeAlert` and renamed it to `notifyAlertClosed`. + +#### showAlert promise for micro frontends based on webcomponents + +The `showAlert` function returns a promise for micro frontends based on web components. The promise resolves to either a `dismissKey`, if defined in the alert settings, or the unique ID of the alert. + +#### Bugfixes + +For a full list of bugfixes in this release, see our [changelog](https://github.com/SAP/luigi/releases/tag/container%2Fv1.6.0). \ No newline at end of file diff --git a/blog/2025-02-18-release-notes.md b/blog/2025-02-18-release-notes.md new file mode 100644 index 0000000000..cfeb9813ea --- /dev/null +++ b/blog/2025-02-18-release-notes.md @@ -0,0 +1,25 @@ +--- +title: Luigi v2.20 +seoMetaDescription: Release notes for Luigi v2.20 +author: + - Johannes Doberer +layout: blog +--- + +You can read about the new features in Luigi v2.20 in the release notes below. + + + + +#### Client support angular library supports Angular v19 + +The angular support library for Luigi Client supports now Angular version 19. + +#### Appswitcher improvement + +Adds the option [selectionConditions](https://docs.luigi-project.io/docs/navigation-parameters-reference?section=items-2) for appswitcher items to be resolved as selected for other routes than their corresponding links. Additionally it can be matched against context values of the current node. + + +#### Bugfixes + +For a full list of bugfixes in this release, see our [changelog](https://github.com/SAP/luigi/blob/main/CHANGELOG.md). \ No newline at end of file diff --git a/client-frameworks-support/client-support-angular/package-lock.json b/client-frameworks-support/client-support-angular/package-lock.json index 36512a077a..6e0cb83c76 100644 --- a/client-frameworks-support/client-support-angular/package-lock.json +++ b/client-frameworks-support/client-support-angular/package-lock.json @@ -16,8 +16,8 @@ "@angular/platform-browser": "^14.2.12", "@angular/platform-browser-dynamic": "^14.2.12", "@angular/router": "^14.2.12", - "@luigi-project/client": "^2.0.0", - "@luigi-project/testing-utilities": "^2.0.0", + "@luigi-project/client": "^2.19.2", + "@luigi-project/testing-utilities": "^2.19.2", "rxjs": "~6.6.0", "tslib": "^2.4.0", "zone.js": "~0.11.6" @@ -2882,15 +2882,15 @@ "license": "MIT" }, "node_modules/@luigi-project/client": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/@luigi-project/client/-/client-2.18.0.tgz", - "integrity": "sha512-H9GaPlpO3ilwsOr2bPLUQ7Wkw9XIFZwUe7m5YxqAyK5e0WapfDbbLBlrS4YtmEEbSSgTEvggVXGX5pArens7Hg==", + "version": "2.19.2", + "resolved": "https://registry.npmjs.org/@luigi-project/client/-/client-2.19.2.tgz", + "integrity": "sha512-4Fjz+Qh9+IjFZT4t/wni+iW68AIPr/AOOSyhy61GMSf1yPai1+jaQnx7qqtzV5oWcPddmwsDkRFDcyD6sDMusw==", "license": "Apache-2.0" }, "node_modules/@luigi-project/testing-utilities": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/@luigi-project/testing-utilities/-/testing-utilities-2.18.0.tgz", - "integrity": "sha512-gi+cPTYxMa+ScNQzUfhKYj0LjJRm+t/8lB4+RUaw4rV+2HXf49MZc4tpEzkWf/QTnkEzV/8fZjUU/+UzlKJ54w==", + "version": "2.19.2", + "resolved": "https://registry.npmjs.org/@luigi-project/testing-utilities/-/testing-utilities-2.19.2.tgz", + "integrity": "sha512-3XPY55kIhQdMNGodMGmVmva4GtgNpOuRuQyvuwGoG9/Ud0UdWrjjO+bAFE0nF6c9LIlubtSTho0UEXQKm3zpGw==", "license": "Apache-2.0", "engines": { "node": ">=18.19.1" @@ -6410,9 +6410,9 @@ "license": "Apache-2.0" }, "node_modules/express": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", - "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "dev": true, "license": "MIT", "dependencies": { @@ -6435,7 +6435,7 @@ "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.10", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", "qs": "6.13.0", "range-parser": "~1.2.1", @@ -6450,6 +6450,10 @@ }, "engines": { "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/express/node_modules/cookie": { @@ -9839,9 +9843,9 @@ "license": "MIT" }, "node_modules/path-to-regexp": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", "dev": true, "license": "MIT" }, diff --git a/client-frameworks-support/client-support-angular/package.json b/client-frameworks-support/client-support-angular/package.json index 6ca15cfa2a..57fd13ad39 100644 --- a/client-frameworks-support/client-support-angular/package.json +++ b/client-frameworks-support/client-support-angular/package.json @@ -21,8 +21,8 @@ "@angular/platform-browser": "^14.2.12", "@angular/platform-browser-dynamic": "^14.2.12", "@angular/router": "^14.2.12", - "@luigi-project/client": "^2.0.0", - "@luigi-project/testing-utilities": "^2.0.0", + "@luigi-project/client": "^2.19.2", + "@luigi-project/testing-utilities": "^2.19.2", "rxjs": "~6.6.0", "tslib": "^2.4.0", "zone.js": "~0.11.6" diff --git a/client-frameworks-support/client-support-angular/projects/client-support-angular/package.json b/client-frameworks-support/client-support-angular/projects/client-support-angular/package.json index 4500024e59..d2ee2bd5f1 100644 --- a/client-frameworks-support/client-support-angular/projects/client-support-angular/package.json +++ b/client-frameworks-support/client-support-angular/projects/client-support-angular/package.json @@ -7,8 +7,8 @@ "url": "ssh://github.com/SAP/luigi.git" }, "peerDependencies": { - "@angular/common": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0", - "@angular/core": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0", + "@angular/common": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "@angular/core": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "@luigi-project/testing-utilities": "^2.0.0", "@luigi-project/client": "^2.0.0" }, @@ -22,5 +22,5 @@ "@luigi-project/client": "^2.0.0", "@luigi-project/testing-utilities": "^2.0.0" }, - "version": "2.19.0" + "version": "2.20.0" } \ No newline at end of file diff --git a/client-frameworks-support/client-support-angular/projects/client-support-angular/tsconfig.lib.json b/client-frameworks-support/client-support-angular/projects/client-support-angular/tsconfig.lib.json index 51b4e658ce..acd0a26476 100644 --- a/client-frameworks-support/client-support-angular/projects/client-support-angular/tsconfig.lib.json +++ b/client-frameworks-support/client-support-angular/projects/client-support-angular/tsconfig.lib.json @@ -3,7 +3,6 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "../../out-tsc/lib", - "target": "es2020", "declaration": true, "declarationMap": true, "inlineSources": true, diff --git a/client-frameworks-support/client-support-angular/tsconfig.json b/client-frameworks-support/client-support-angular/tsconfig.json index b8c62206ac..e568f7b292 100644 --- a/client-frameworks-support/client-support-angular/tsconfig.json +++ b/client-frameworks-support/client-support-angular/tsconfig.json @@ -13,8 +13,8 @@ "experimentalDecorators": true, "moduleResolution": "node", "importHelpers": true, - "target": "es2020", - "module": "es2020", + "target": "ES2022", + "module": "ES2020", "lib": [ "es2020", "dom" @@ -24,12 +24,13 @@ "dist/client-support-angular/client-support-angular", "dist/client-support-angular" ] - } + }, + "useDefineForClassFields": false }, "angularCompilerOptions": { + "fullTemplateTypeCheck": true, "strictInjectionParameters": true, "strictInputAccessModifiers": true, "strictTemplates": true, - "fullTemplateTypeCheck": true, } } \ No newline at end of file diff --git a/client-frameworks-support/testing-utilities/dist/package.json b/client-frameworks-support/testing-utilities/dist/package.json index 03378155c5..c5576a3788 100644 --- a/client-frameworks-support/testing-utilities/dist/package.json +++ b/client-frameworks-support/testing-utilities/dist/package.json @@ -19,7 +19,7 @@ "microfrontends", "testing" ], - "version": "2.19.0", + "version": "2.20.0", "engines": { "node": ">=18.19.1" } diff --git a/client-frameworks-support/testing-utilities/package-lock.json b/client-frameworks-support/testing-utilities/package-lock.json index 56cb927d20..a618c61786 100644 --- a/client-frameworks-support/testing-utilities/package-lock.json +++ b/client-frameworks-support/testing-utilities/package-lock.json @@ -1,12 +1,12 @@ { "name": "@luigi-project/testing-utilities", - "version": "2.19.0", + "version": "2.20.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@luigi-project/testing-utilities", - "version": "2.19.0", + "version": "2.20.0", "license": "Apache-2.0", "devDependencies": { "ncp": "^2.0.0", diff --git a/client-frameworks-support/testing-utilities/package.json b/client-frameworks-support/testing-utilities/package.json index fd7f668b1d..ef0a6bc305 100644 --- a/client-frameworks-support/testing-utilities/package.json +++ b/client-frameworks-support/testing-utilities/package.json @@ -29,7 +29,7 @@ "microfrontends", "testing" ], - "version": "2.19.0", + "version": "2.20.0", "engines": { "node": ">=18.19.1" } diff --git a/client/luigi-element.d.ts b/client/luigi-element.d.ts index 46b6c0812b..f8848f099b 100644 --- a/client/luigi-element.d.ts +++ b/client/luigi-element.d.ts @@ -61,7 +61,59 @@ export declare interface NodeParams { [key: string]: string; } +export declare interface UserSettings { + [key: string]: number | string | boolean; +} + +/** + * Returns the anchor of active URL. + * @returns {String} the anchor string + * @memberof Lifecycle + * @example + * LuigiClient.getAnchor(); + */ +export function getAnchor(): String; +export type getAnchor = () => String; + +/** + * Returns the current user settings. + * @returns {Object} current user settings + * @memberof Lifecycle + */ +export function getUserSettings(): UserSettings; +export type getUserSettings = () => UserSettings; + +/** + * Allows you to change node labels within the same view group, e.g. in your node config: `label: 'my Node {viewGroupData.vg1}'`. + * @param {Object} value a data object containing the view group name and desired label + * @memberof Lifecycle + * @example + * LuigiClient.setViewGroupData({'vg1':' Luigi rocks!'}) + */ +export function setViewGroupData(value: Object): void; +export type setViewGroupData = (value: Object) => void; + export declare interface UxManager { + /** + * Gets the current theme. + * @returns {*} current themeObj + * @memberof uxManager + */ + getCurrentTheme: () => any; + + /** + * Gets the dirty status, which is set by the Client. + * @returns {boolean} dirty status + * @memberof uxManager + */ + getDirtyStatus: () => boolean; + + /** + * Removes the backdrop. + * @memberof uxManager + */ + removeBackdrop: () => void; + /** * Hides the app loading indicator. * @memberof uxManager @@ -212,6 +264,23 @@ export declare interface LinkManager { drawerSettings?: DrawerSettings ) => void; + /** + * Offers an alternative way of navigating with intents. This involves specifying a semanticSlug and an object containing + * parameters. + * This method internally generates a URL of the form `#?intent=-?=` through the given + * input arguments. This then follows a call to the original `linkManager.navigate(...)` function. + * Consequently, the following calls shall have the exact same effect: + * - linkManager().navigateToIntent('Sales-settings', {project: 'pr2', user: 'john'}) + * - linkManager().navigate('/#?intent=Sales-settings?project=pr2&user=john') + * @memberof LuigiNavigation + * @param {string} semanticSlug concatenation of semantic object and action connected with a dash (-), i.e.: `-` + * @param {Object} params an object representing all the parameters passed, i.e.: `{param1: '1', param2: 2, param3: 'value3'}`. + * @example + * LuigiClient.linkManager().navigateToIntent('Sales-settings', {project: 'pr2', user: 'john'}) + * LuigiClient.linkManager().navigateToIntent('Sales-settings') + */ + navigateToIntent: (semanticSlug: string, params?: Object) => void; + /** * Opens a view in a modal. You can specify the modal's title and size. If you do not specify the title, it is the node label. If there is no node label, the title remains empty. The default size of the modal is `l`, which means 80%. You can also use `m` (60%) and `s` (40%) to set the modal size. Optionally, use it in combination with any of the navigation functions. * @memberof linkManager @@ -271,6 +340,15 @@ export declare interface LinkManager { */ fromContext: (navigationContext: string) => this; + /** + * Enables navigating to sibling nodes without knowing the absolute path + * @memberof linkManager + * @returns {linkManager} link manager instance + * @example + * LuigiClient.linkManager().fromParent().navigate('/sibling') + */ + fromParent: () => this; + /** * Sets the current navigation context which is then used by the `navigate` function. This has to be a parent navigation context, it is not possible to use the child navigation contexts. * @memberof linkManager diff --git a/client/public/package.json b/client/public/package.json index 05105c5752..7a354be32d 100644 --- a/client/public/package.json +++ b/client/public/package.json @@ -17,5 +17,5 @@ "micro-frontends", "microfrontends" ], - "version": "2.19.0" + "version": "2.20.0" } \ No newline at end of file diff --git a/container/CHANGELOG.md b/container/CHANGELOG.md index a20add38bb..7e1cdf32ce 100644 --- a/container/CHANGELOG.md +++ b/container/CHANGELOG.md @@ -4,6 +4,23 @@ +## [v1.6.0] (2025-02-12) + +#### :rocket: Added + +* [#4127](https://github.com/SAP/luigi/pull/4127) rename closeAlert fn ([@JohannesDoberer](https://github.com/JohannesDoberer)) +* [#4115](https://github.com/SAP/luigi/pull/4115) showAlert promise for webcomponents ([@JohannesDoberer](https://github.com/JohannesDoberer)) + +#### :bug: Fixed + +* [#4133](https://github.com/SAP/luigi/pull/4133) Missing context properties ([@JohannesDoberer](https://github.com/JohannesDoberer)) +* [#4132](https://github.com/SAP/luigi/pull/4132) Container iframe get node params function missing ([@JohannesDoberer](https://github.com/JohannesDoberer)) +* [#4106](https://github.com/SAP/luigi/pull/4106) Fix: dismissKey optional in closeAlert ([@JohannesDoberer](https://github.com/JohannesDoberer)) + + + + + ## [v1.5.0] (2024-11-29) #### :rocket: Added @@ -63,4 +80,5 @@ [v1.2.0]: https://github.com/SAP/luigi/compare/container/v1.1.0...container/v1.2.0 [v1.3.0]: https://github.com/SAP/luigi/compare/container/v1.2.0...container/v1.3.0 [v1.4.0]: https://github.com/SAP/luigi/compare/container/v1.3.0...container/v1.4.0 -[v1.5.0]: https://github.com/SAP/luigi/compare/container/v1.4.0...container/v1.5.0 \ No newline at end of file +[v1.5.0]: https://github.com/SAP/luigi/compare/container/v1.4.0...container/v1.5.0 +[v1.6.0]: https://github.com/SAP/luigi/compare/container/v1.5.0...container/v1.6.0 \ No newline at end of file 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 0422b11f71..cd88e69703 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 @@ -1,15 +1,20 @@ describe('Compound Container Tests', () => { describe('LuigiClient API - LuigiCompoundContainer', () => { const containerSelector = '[data-test-id="luigi-client-api-test-compound-01"]'; - let consoleLog; + let consoleInfo; let stub; beforeEach(() => { cy.visit('http://localhost:8080/compound/compoundClientAPI.html', { onBeforeLoad(win) { - // Set up a spy on console.log - cy.stub(win.console, 'log', (value) => { - consoleLog = value; + // Clear logs in window console + if (Object.prototype.toString.call(win.console.clear) === '[object Function]') { + win.console.clear(); + } + + // Set up a spy on console.info + cy.stub(win.console, 'info', (value) => { + consoleInfo = value; }); } }); @@ -286,11 +291,17 @@ describe('Compound Container Tests', () => { it('LuigiClient API publishEvent', () => { cy.on('window:alert', stub); - cy.get(containerSelector).shadow().contains('Publish event').click(); + cy.get(containerSelector) + .shadow() + .contains('Publish event') + .click({force: true}); cy.should(() => { + if (consoleInfo) { + expect(consoleInfo).to.equal('dataConverter(): Received Custom Message from "input1" MF My own event data'); + } + expect(stub.getCall(0)).to.be.calledWith('custom-message: sendInput'); - expect(consoleLog).to.equal('dataConverter(): Received Custom Message from "input1" MF My own event data'); }); }); @@ -317,4 +328,129 @@ describe('Compound Container Tests', () => { }); }); }); + + describe('LuigiClient API - LuigiElement (compound child)', () => { + const buttonSelector = '[id="luigi-client-init-button"]'; + const containerSelector = '[id="luigi-client-init-test"]'; + let consoleLog; + let stub; + + beforeEach(() => { + cy.visit('http://localhost:8080/compound/compoundClientAPI.html', { + onBeforeLoad(win) { + // Clear logs in window console + if (Object.prototype.toString.call(win.console.clear) === '[object Function]') { + win.console.clear(); + } + + // Set up a spy on console.log + cy.stub(win.console, 'log', (value) => { + consoleLog = value; + }); + } + }); + cy.get(buttonSelector).click(); + stub = cy.stub(); + }); + + it('LuigiClient API - addNodeParams', () => { + cy.get(containerSelector) + .shadow() + .contains('addNodeParams') + .click() + .then(() => { + expect(consoleLog).to.equal('addNodeParams has been called with no effect'); + }); + }); + + it('LuigiClient API - getNodeParams', () => { + cy.get(containerSelector) + .shadow() + .contains('getNodeParams') + .click() + .then(() => { + expect(consoleLog).to.equal('getNodeParams: {}'); + }); + }); + + it('LuigiClient API - getCurrentTheme', () => { + cy.get(containerSelector) + .shadow() + .contains('getCurrentTheme') + .click() + .then(() => { + expect(consoleLog).to.equal('getCurrentTheme: sap_fiori_3'); + }); + }); + + it('LuigiClient API - getDirtyStatus', () => { + cy.get(containerSelector) + .shadow() + .contains('getDirtyStatus') + .click() + .then(() => { + expect(consoleLog).to.equal('getDirtyStatus: false'); + }); + }); + + it('LuigiClient API - removeBackdrop', () => { + cy.get(containerSelector) + .shadow() + .contains('removeBackdrop') + .click() + .then(() => { + expect(consoleLog).to.equal('removeBackdrop has been called'); + }); + }); + + it('LuigiClient API - getAnchor', () => { + cy.get(containerSelector) + .shadow() + .contains('getAnchor') + .click() + .then(() => { + expect(consoleLog).to.equal('getAnchor: testAnchorCompound'); + }); + }); + + it('LuigiClient API - getUserSettings', () => { + cy.get(containerSelector) + .shadow() + .contains('getUserSettings') + .click() + .then(() => { + expect(consoleLog).to.equal('getUserSettings: {"language":"it","date":""}'); + }); + }); + + it('LuigiClient API - setViewGroupData', () => { + cy.get(containerSelector) + .shadow() + .contains('setViewGroupData') + .click() + .then(() => { + expect(consoleLog).to.equal('setViewGroupData has been called with {"vg":"some data"}'); + }); + }); + + it('LuigiClient API - navigateToIntent', () => { + cy.get(containerSelector) + .shadow() + .contains('navigateToIntent') + .click() + .then(() => { + expect(consoleLog).to.equal('navigateToIntent has been called with "sales-setting"'); + }); + }); + + it('LuigiClient API - fromParent', () => { + cy.get(containerSelector) + .shadow() + .contains('fromParent') + .click() + .then(() => { + expect(consoleLog).to.equal('fromParent has been called'); + }); + }); + }); }); diff --git a/container/cypress/e2e/test-app/iframe/iframe-container.cy.js b/container/cypress/e2e/test-app/iframe/iframe-container.cy.js index e2f90edefc..8b0124f494 100644 --- a/container/cypress/e2e/test-app/iframe/iframe-container.cy.js +++ b/container/cypress/e2e/test-app/iframe/iframe-container.cy.js @@ -51,6 +51,33 @@ describe('Iframe Container Test', () => { }); }); + it('showAlert with notifyAlertClosed', () => { + cy.on('window:alert', stub); + + cy.get(containerSelector) + .shadow() + .get('iframe') + .then((iframe) => { + const $body = iframe.contents().find('body'); + cy.wrap($body) + .contains('test showAlert with notifyAlertClosed') + .click() + .then(() => { + cy.wrap(stub).should('have.been.calledWith', 'show-alert-request message received: {"isTrusted":true}'); + }); + }); + + cy.contains('Close Alert using notifyAlertClosed').click(); + cy.wait(500); + cy.get(containerSelector) + .shadow() + .get('iframe') + .then((iframe) => { + const $body = iframe.contents().find('body'); + cy.wrap($body).contains('Callback called on iframe neverShowItAgain'); + }); + }); + it('goBack', () => { cy.on('window:alert', stub); @@ -226,4 +253,49 @@ describe('Iframe Container Test', () => { }); }); }); + + it('getNodeParams', () => { + cy.get(containerSelector) + .shadow() + .get('iframe') + .then((iframe) => { + const $body = iframe.contents().find('body'); + cy.wrap($body) + .contains('Test get node params') + .click() + .then(() => { + cy.wrap($body).contains('nodeParams: {"node":"params"}'); + }); + }); + }); + + it('getPathParams', () => { + cy.get(containerSelector) + .shadow() + .get('iframe') + .then((iframe) => { + const $body = iframe.contents().find('body'); + cy.wrap($body) + .contains('test get path params') + .click() + .then(() => { + cy.wrap($body).contains('pathParams: {"path":"param"}'); + }); + }); + }); + + it('getCoreSearchParams', () => { + cy.get(containerSelector) + .shadow() + .get('iframe') + .then((iframe) => { + const $body = iframe.contents().find('body'); + cy.wrap($body) + .contains('test get core search params') + .click() + .then(() => { + cy.wrap($body).contains('searchParams: {"search":"param"}'); + }); + }); + }); }); diff --git a/container/cypress/e2e/test-app/wc/wc-container.cy.js b/container/cypress/e2e/test-app/wc/wc-container.cy.js index 349c932115..62117fcde5 100644 --- a/container/cypress/e2e/test-app/wc/wc-container.cy.js +++ b/container/cypress/e2e/test-app/wc/wc-container.cy.js @@ -168,7 +168,7 @@ describe('Web Container Test', () => { }); it('openAsDrawer webcomponent container', () => { cy.on('window:alert', stub); - + cy.get(containerSelector) .shadow() .get('#openAsDrawerBtn') @@ -179,7 +179,7 @@ describe('Web Container Test', () => { }); it('openAsSplitview webcomponent container', () => { cy.on('window:alert', stub); - + cy.get(containerSelector) .shadow() .get('#openAsSplitviewBtn') @@ -195,7 +195,7 @@ describe('Web Container Test', () => { const alertMessages = [ 'UPDATE_TOP_NAVIGATION_REQUEST event received', 'some goBackValue', - 'LuigiClient.linkManager().pathExists()=true\nthis.LuigiClient.linkManager().hasBack()=false', + 'LuigiClient.linkManager().pathExists()=true\nthis.LuigiClient.linkManager().hasBack()=false' ]; cy.get(containerSelector) @@ -217,7 +217,76 @@ describe('Web Container Test', () => { .get('#showAlert') .click() .then(() => { - expect(stub.getCall(0)).to.be.calledWith("uxManager().showAlert() test"); + expect(stub.getCall(0)).to.be.calledWith( + 'This is an alert message {goToHome} with a {relativePath}. You can go to {goToOtherProject}. {neverShowItAgain}' + ); + }); + }); + + it('closeAlert via xButton', () => { + cy.on('window:alert', stub); + + cy.get(containerSelector) + .shadow() + .get('#showAlert') + .click() + .then(() => { + expect(stub.getCall(0)).to.be.calledWith( + 'This is an alert message {goToHome} with a {relativePath}. You can go to {goToOtherProject}. {neverShowItAgain}' + ); + }); + cy.get('#closeAlert') + .click() + .then(() => { + cy.get(containerSelector) + .shadow() + .get('#closeAlertResponse') + .should('have.text', 'Callback called on wc true'); + }); + }); + + it('closeAlert via xButton after navigate away', () => { + //expectation promise will not fullfilled + cy.on('window:alert', stub); + + cy.get(containerSelector) + .shadow() + .get('#showAlert') + .click() + .then(() => { + expect(stub.getCall(0)).to.be.calledWith( + 'This is an alert message {goToHome} with a {relativePath}. You can go to {goToOtherProject}. {neverShowItAgain}' + ); + // Simulate navigate away and luigi-container is not in dom anymore + cy.get('luigi-container').invoke('remove'); + + cy.get('#closeAlert').click(); + + // Expect + // Callback is not fullfilled which means luigi-container isn't connected to dom + cy.get('#callbackCloseAlert').should('not.exist'); + }); + }); + + it('closeAlert via dismissButton', () => { + cy.on('window:alert', stub); + + cy.get(containerSelector) + .shadow() + .get('#showAlert') + .click() + .then(() => { + expect(stub.getCall(0)).to.be.calledWith( + 'This is an alert message {goToHome} with a {relativePath}. You can go to {goToOtherProject}. {neverShowItAgain}' + ); + }); + cy.get('#dismissAlert') + .click() + .then(() => { + cy.get(containerSelector) + .shadow() + .get('#closeAlertResponse') + .should('have.text', 'Callback called on wc neverShowItAgain from wc'); }); }); diff --git a/container/package-lock.json b/container/package-lock.json index 5b20aaad9c..a1884d6e09 100644 --- a/container/package-lock.json +++ b/container/package-lock.json @@ -30,13 +30,13 @@ "github-api": "^3.4.0", "jest": "29.7.0", "jest-environment-jsdom": "29.7.0", - "rollup": "4.28.1", + "rollup": "4.34.8", "rollup-plugin-copy": "^3.5.0", "rollup-plugin-livereload": "2.0.5", "rollup-plugin-svelte": "7.2.2", "sirv-cli": "^2.0.0", - "svelte": "^5.14.4", - "svelte-check": "^4.1.1", + "svelte": "^5.20.2", + "svelte-check": "^4.1.4", "tslib": "2.6.1", "typescript": "^5.5.0", "typescript-eslint": "^8.18.1" @@ -2843,9 +2843,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.28.1.tgz", - "integrity": "sha512-2aZp8AES04KI2dy3Ss6/MDjXbwBzj+i0GqKtWXgw2/Ma6E4jJvujryO6gJAghIRVz7Vwr9Gtl/8na3nDUKpraQ==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.8.tgz", + "integrity": "sha512-q217OSE8DTp8AFHuNHXo0Y86e1wtlfVrXiAlwkIvGRQv9zbc6mE3sjIVfwI8sYUyNxwOg0j/Vm1RKM04JcWLJw==", "cpu": [ "arm" ], @@ -2857,9 +2857,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.28.1.tgz", - "integrity": "sha512-EbkK285O+1YMrg57xVA+Dp0tDBRB93/BZKph9XhMjezf6F4TpYjaUSuPt5J0fZXlSag0LmZAsTmdGGqPp4pQFA==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.34.8.tgz", + "integrity": "sha512-Gigjz7mNWaOL9wCggvoK3jEIUUbGul656opstjaUSGC3eT0BM7PofdAJaBfPFWWkXNVAXbaQtC99OCg4sJv70Q==", "cpu": [ "arm64" ], @@ -2871,9 +2871,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.28.1.tgz", - "integrity": "sha512-prduvrMKU6NzMq6nxzQw445zXgaDBbMQvmKSJaxpaZ5R1QDM8w+eGxo6Y/jhT/cLoCvnZI42oEqf9KQNYz1fqQ==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.34.8.tgz", + "integrity": "sha512-02rVdZ5tgdUNRxIUrFdcMBZQoaPMrxtwSb+/hOfBdqkatYHR3lZ2A2EGyHq2sGOd0Owk80oV3snlDASC24He3Q==", "cpu": [ "arm64" ], @@ -2885,9 +2885,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.28.1.tgz", - "integrity": "sha512-WsvbOunsUk0wccO/TV4o7IKgloJ942hVFK1CLatwv6TJspcCZb9umQkPdvB7FihmdxgaKR5JyxDjWpCOp4uZlQ==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.34.8.tgz", + "integrity": "sha512-qIP/elwR/tq/dYRx3lgwK31jkZvMiD6qUtOycLhTzCvrjbZ3LjQnEM9rNhSGpbLXVJYQ3rq39A6Re0h9tU2ynw==", "cpu": [ "x64" ], @@ -2899,9 +2899,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.28.1.tgz", - "integrity": "sha512-HTDPdY1caUcU4qK23FeeGxCdJF64cKkqajU0iBnTVxS8F7H/7BewvYoG+va1KPSL63kQ1PGNyiwKOfReavzvNA==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.34.8.tgz", + "integrity": "sha512-IQNVXL9iY6NniYbTaOKdrlVP3XIqazBgJOVkddzJlqnCpRi/yAeSOa8PLcECFSQochzqApIOE1GHNu3pCz+BDA==", "cpu": [ "arm64" ], @@ -2913,9 +2913,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.28.1.tgz", - "integrity": "sha512-m/uYasxkUevcFTeRSM9TeLyPe2QDuqtjkeoTpP9SW0XxUWfcYrGDMkO/m2tTw+4NMAF9P2fU3Mw4ahNvo7QmsQ==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.34.8.tgz", + "integrity": "sha512-TYXcHghgnCqYFiE3FT5QwXtOZqDj5GmaFNTNt3jNC+vh22dc/ukG2cG+pi75QO4kACohZzidsq7yKTKwq/Jq7Q==", "cpu": [ "x64" ], @@ -2927,9 +2927,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.28.1.tgz", - "integrity": "sha512-QAg11ZIt6mcmzpNE6JZBpKfJaKkqTm1A9+y9O+frdZJEuhQxiugM05gnCWiANHj4RmbgeVJpTdmKRmH/a+0QbA==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.34.8.tgz", + "integrity": "sha512-A4iphFGNkWRd+5m3VIGuqHnG3MVnqKe7Al57u9mwgbyZ2/xF9Jio72MaY7xxh+Y87VAHmGQr73qoKL9HPbXj1g==", "cpu": [ "arm" ], @@ -2941,9 +2941,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.28.1.tgz", - "integrity": "sha512-dRP9PEBfolq1dmMcFqbEPSd9VlRuVWEGSmbxVEfiq2cs2jlZAl0YNxFzAQS2OrQmsLBLAATDMb3Z6MFv5vOcXg==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.34.8.tgz", + "integrity": "sha512-S0lqKLfTm5u+QTxlFiAnb2J/2dgQqRy/XvziPtDd1rKZFXHTyYLoVL58M/XFwDI01AQCDIevGLbQrMAtdyanpA==", "cpu": [ "arm" ], @@ -2955,9 +2955,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.28.1.tgz", - "integrity": "sha512-uGr8khxO+CKT4XU8ZUH1TTEUtlktK6Kgtv0+6bIFSeiSlnGJHG1tSFSjm41uQ9sAO/5ULx9mWOz70jYLyv1QkA==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.34.8.tgz", + "integrity": "sha512-jpz9YOuPiSkL4G4pqKrus0pn9aYwpImGkosRKwNi+sJSkz+WU3anZe6hi73StLOQdfXYXC7hUfsQlTnjMd3s1A==", "cpu": [ "arm64" ], @@ -2969,9 +2969,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.28.1.tgz", - "integrity": "sha512-QF54q8MYGAqMLrX2t7tNpi01nvq5RI59UBNx+3+37zoKX5KViPo/gk2QLhsuqok05sSCRluj0D00LzCwBikb0A==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.34.8.tgz", + "integrity": "sha512-KdSfaROOUJXgTVxJNAZ3KwkRc5nggDk+06P6lgi1HLv1hskgvxHUKZ4xtwHkVYJ1Rep4GNo+uEfycCRRxht7+Q==", "cpu": [ "arm64" ], @@ -2983,9 +2983,9 @@ ] }, "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.28.1.tgz", - "integrity": "sha512-vPul4uodvWvLhRco2w0GcyZcdyBfpfDRgNKU+p35AWEbJ/HPs1tOUrkSueVbBS0RQHAf/A+nNtDpvw95PeVKOA==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.34.8.tgz", + "integrity": "sha512-NyF4gcxwkMFRjgXBM6g2lkT58OWztZvw5KkV2K0qqSnUEqCVcqdh2jN4gQrTn/YUpAcNKyFHfoOZEer9nwo6uQ==", "cpu": [ "loong64" ], @@ -2997,9 +2997,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.28.1.tgz", - "integrity": "sha512-pTnTdBuC2+pt1Rmm2SV7JWRqzhYpEILML4PKODqLz+C7Ou2apEV52h19CR7es+u04KlqplggmN9sqZlekg3R1A==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.34.8.tgz", + "integrity": "sha512-LMJc999GkhGvktHU85zNTDImZVUCJ1z/MbAJTnviiWmmjyckP5aQsHtcujMjpNdMZPT2rQEDBlJfubhs3jsMfw==", "cpu": [ "ppc64" ], @@ -3011,9 +3011,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.28.1.tgz", - "integrity": "sha512-vWXy1Nfg7TPBSuAncfInmAI/WZDd5vOklyLJDdIRKABcZWojNDY0NJwruY2AcnCLnRJKSaBgf/GiJfauu8cQZA==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.34.8.tgz", + "integrity": "sha512-xAQCAHPj8nJq1PI3z8CIZzXuXCstquz7cIOL73HHdXiRcKk8Ywwqtx2wrIy23EcTn4aZ2fLJNBB8d0tQENPCmw==", "cpu": [ "riscv64" ], @@ -3025,9 +3025,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.28.1.tgz", - "integrity": "sha512-/yqC2Y53oZjb0yz8PVuGOQQNOTwxcizudunl/tFs1aLvObTclTwZ0JhXF2XcPT/zuaymemCDSuuUPXJJyqeDOg==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.34.8.tgz", + "integrity": "sha512-DdePVk1NDEuc3fOe3dPPTb+rjMtuFw89gw6gVWxQFAuEqqSdDKnrwzZHrUYdac7A7dXl9Q2Vflxpme15gUWQFA==", "cpu": [ "s390x" ], @@ -3039,9 +3039,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.28.1.tgz", - "integrity": "sha512-fzgeABz7rrAlKYB0y2kSEiURrI0691CSL0+KXwKwhxvj92VULEDQLpBYLHpF49MSiPG4sq5CK3qHMnb9tlCjBw==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.34.8.tgz", + "integrity": "sha512-8y7ED8gjxITUltTUEJLQdgpbPh1sUQ0kMTmufRF/Ns5tI9TNMNlhWtmPKKHCU0SilX+3MJkZ0zERYYGIVBYHIA==", "cpu": [ "x64" ], @@ -3053,9 +3053,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.28.1.tgz", - "integrity": "sha512-xQTDVzSGiMlSshpJCtudbWyRfLaNiVPXt1WgdWTwWz9n0U12cI2ZVtWe/Jgwyv/6wjL7b66uu61Vg0POWVfz4g==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.34.8.tgz", + "integrity": "sha512-SCXcP0ZpGFIe7Ge+McxY5zKxiEI5ra+GT3QRxL0pMMtxPfpyLAKleZODi1zdRHkz5/BhueUrYtYVgubqe9JBNQ==", "cpu": [ "x64" ], @@ -3067,9 +3067,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.28.1.tgz", - "integrity": "sha512-wSXmDRVupJstFP7elGMgv+2HqXelQhuNf+IS4V+nUpNVi/GUiBgDmfwD0UGN3pcAnWsgKG3I52wMOBnk1VHr/A==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.34.8.tgz", + "integrity": "sha512-YHYsgzZgFJzTRbth4h7Or0m5O74Yda+hLin0irAIobkLQFRQd1qWmnoVfwmKm9TXIZVAD0nZ+GEb2ICicLyCnQ==", "cpu": [ "arm64" ], @@ -3081,9 +3081,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.28.1.tgz", - "integrity": "sha512-ZkyTJ/9vkgrE/Rk9vhMXhf8l9D+eAhbAVbsGsXKy2ohmJaWg0LPQLnIxRdRp/bKyr8tXuPlXhIoGlEB5XpJnGA==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.34.8.tgz", + "integrity": "sha512-r3NRQrXkHr4uWy5TOjTpTYojR9XmF0j/RYgKCef+Ag46FWUTltm5ziticv8LdNsDMehjJ543x/+TJAek/xBA2w==", "cpu": [ "ia32" ], @@ -3095,9 +3095,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.28.1.tgz", - "integrity": "sha512-ZvK2jBafvttJjoIdKm/Q/Bh7IJ1Ose9IBOwpOXcOvW3ikGTQGmKDgxTC6oCAzW6PynbkKP8+um1du81XJHZ0JA==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.34.8.tgz", + "integrity": "sha512-U0FaE5O1BCpZSeE6gBl3c5ObhePQSfk9vDRToMmTkbhCOgW4jqvtS5LGyQ76L1fH8sM0keRp4uDTsbjiUyjk0g==", "cpu": [ "x64" ], @@ -4742,6 +4742,16 @@ "node": ">=6" } }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -6005,14 +6015,13 @@ } }, "node_modules/esrap": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/esrap/-/esrap-1.3.1.tgz", - "integrity": "sha512-KpAH3+QsDmtOP1KOW04CbD1PgzWsIHjB8tOCk3PCb8xzNGn8XkjI8zl80i09fmXdzQyaS8tcsKCCDzHF7AcowA==", + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/esrap/-/esrap-1.4.5.tgz", + "integrity": "sha512-CjNMjkBWWZeHn+VX+gS8YvFwJ5+NDhg8aWZBSFJPR8qQduDNjbJodA2WcwCm7uQa5Rjqj+nZvVmceg1RbHFB9g==", "dev": true, "license": "MIT", "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15", - "@typescript-eslint/types": "^8.2.0" + "@jridgewell/sourcemap-codec": "^1.4.15" } }, "node_modules/esrecurse": { @@ -10472,9 +10481,9 @@ "license": "MIT" }, "node_modules/rollup": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.28.1.tgz", - "integrity": "sha512-61fXYl/qNVinKmGSTHAZ6Yy8I3YIJC/r2m9feHo6SwVAVcLT5MPwOUFe7EuURA/4m0NR8lXG4BBXuo/IZEsjMg==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.34.8.tgz", + "integrity": "sha512-489gTVMzAYdiZHFVA/ig/iYFllCcWFHMvUHI1rpFmkoUtRlQxqh6/yiNqnYibjMZ2b/+FUQwldG+aLsEt6bglQ==", "dev": true, "license": "MIT", "dependencies": { @@ -10488,25 +10497,25 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.28.1", - "@rollup/rollup-android-arm64": "4.28.1", - "@rollup/rollup-darwin-arm64": "4.28.1", - "@rollup/rollup-darwin-x64": "4.28.1", - "@rollup/rollup-freebsd-arm64": "4.28.1", - "@rollup/rollup-freebsd-x64": "4.28.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.28.1", - "@rollup/rollup-linux-arm-musleabihf": "4.28.1", - "@rollup/rollup-linux-arm64-gnu": "4.28.1", - "@rollup/rollup-linux-arm64-musl": "4.28.1", - "@rollup/rollup-linux-loongarch64-gnu": "4.28.1", - "@rollup/rollup-linux-powerpc64le-gnu": "4.28.1", - "@rollup/rollup-linux-riscv64-gnu": "4.28.1", - "@rollup/rollup-linux-s390x-gnu": "4.28.1", - "@rollup/rollup-linux-x64-gnu": "4.28.1", - "@rollup/rollup-linux-x64-musl": "4.28.1", - "@rollup/rollup-win32-arm64-msvc": "4.28.1", - "@rollup/rollup-win32-ia32-msvc": "4.28.1", - "@rollup/rollup-win32-x64-msvc": "4.28.1", + "@rollup/rollup-android-arm-eabi": "4.34.8", + "@rollup/rollup-android-arm64": "4.34.8", + "@rollup/rollup-darwin-arm64": "4.34.8", + "@rollup/rollup-darwin-x64": "4.34.8", + "@rollup/rollup-freebsd-arm64": "4.34.8", + "@rollup/rollup-freebsd-x64": "4.34.8", + "@rollup/rollup-linux-arm-gnueabihf": "4.34.8", + "@rollup/rollup-linux-arm-musleabihf": "4.34.8", + "@rollup/rollup-linux-arm64-gnu": "4.34.8", + "@rollup/rollup-linux-arm64-musl": "4.34.8", + "@rollup/rollup-linux-loongarch64-gnu": "4.34.8", + "@rollup/rollup-linux-powerpc64le-gnu": "4.34.8", + "@rollup/rollup-linux-riscv64-gnu": "4.34.8", + "@rollup/rollup-linux-s390x-gnu": "4.34.8", + "@rollup/rollup-linux-x64-gnu": "4.34.8", + "@rollup/rollup-linux-x64-musl": "4.34.8", + "@rollup/rollup-win32-arm64-msvc": "4.34.8", + "@rollup/rollup-win32-ia32-msvc": "4.34.8", + "@rollup/rollup-win32-x64-msvc": "4.34.8", "fsevents": "~2.3.2" } }, @@ -11310,9 +11319,9 @@ } }, "node_modules/svelte": { - "version": "5.14.4", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.14.4.tgz", - "integrity": "sha512-2iR/UHHA2Dsldo4JdXDcdqT+spueuh+uNYw1FoTKBbpnFEECVISeqSo0uubPS4AfBE0xI6u7DGHxcdq3DTDmoQ==", + "version": "5.20.2", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.20.2.tgz", + "integrity": "sha512-aYXJreNUiyTob0QOzRZeBXZMGeFZDch6SrSRV8QTncZb6zj0O3BEdUzPpojuHQ1pTvk+KX7I6rZCXPUf8pTPxA==", "dev": true, "license": "MIT", "dependencies": { @@ -11323,8 +11332,9 @@ "acorn-typescript": "^1.4.13", "aria-query": "^5.3.1", "axobject-query": "^4.1.0", + "clsx": "^2.1.1", "esm-env": "^1.2.1", - "esrap": "^1.3.1", + "esrap": "^1.4.3", "is-reference": "^3.0.3", "locate-character": "^3.0.0", "magic-string": "^0.30.11", @@ -11335,9 +11345,9 @@ } }, "node_modules/svelte-check": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.1.1.tgz", - "integrity": "sha512-NfaX+6Qtc8W/CyVGS/F7/XdiSSyXz+WGYA9ZWV3z8tso14V2vzjfXviKaTFEzB7g8TqfgO2FOzP6XT4ApSTUTw==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.1.4.tgz", + "integrity": "sha512-v0j7yLbT29MezzaQJPEDwksybTE2Ups9rUxEXy92T06TiA0cbqcO8wAOwNUVkFW6B0hsYHA+oAX3BS8b/2oHtw==", "dev": true, "license": "MIT", "dependencies": { diff --git a/container/package.json b/container/package.json index f7c55d66c9..e5b56eeb00 100644 --- a/container/package.json +++ b/container/package.json @@ -55,13 +55,13 @@ "github-api": "^3.4.0", "jest": "29.7.0", "jest-environment-jsdom": "29.7.0", - "rollup": "4.28.1", + "rollup": "4.34.8", "rollup-plugin-copy": "^3.5.0", "rollup-plugin-livereload": "2.0.5", "rollup-plugin-svelte": "7.2.2", "sirv-cli": "^2.0.0", - "svelte": "^5.14.4", - "svelte-check": "^4.1.1", + "svelte": "^5.20.2", + "svelte-check": "^4.1.4", "tslib": "2.6.1", "typescript": "^5.5.0", "typescript-eslint": "^8.18.1" diff --git a/container/public/dist/custom-elements.json b/container/public/dist/custom-elements.json index c2c2927285..d89157c20a 100644 --- a/container/public/dist/custom-elements.json +++ b/container/public/dist/custom-elements.json @@ -224,6 +224,10 @@ "kind": "method", "name": "closeAlert" }, + { + "kind": "method", + "name": "notifyAlertClosed" + }, { "kind": "method", "name": "init" diff --git a/container/public/package.json b/container/public/package.json index 01d4c2af6b..4dc318cd33 100644 --- a/container/public/package.json +++ b/container/public/package.json @@ -20,5 +20,5 @@ "micro-frontends", "microfrontends" ], - "version": "1.5.0" + "version": "1.6.0" } \ No newline at end of file diff --git a/container/run-container-e2e.sh b/container/run-container-e2e.sh index 41c113fc6e..d2199341a5 100755 --- a/container/run-container-e2e.sh +++ b/container/run-container-e2e.sh @@ -19,13 +19,12 @@ killWebserver 2222 || true npm run start-examples-test & WS_FID_PID=$! - # Start the second server for 'test-app' in the background npm run start & EXAMPLES_FID_PID=$! -# sleep for 3 seconds to wait for both servers to be fired up -sleep 3 +# sleep for 30 seconds to wait for both servers to be fired up +sleep 30 if [ "$USE_CYPRESS_DASHBOARD" == "true" ]; then echo "Running tests with recording" @@ -41,4 +40,3 @@ kill $WS_FID_PID kill $EXAMPLES_FID_PID exit $? - diff --git a/container/src/LuigiContainer.svelte b/container/src/LuigiContainer.svelte index c719d3aca4..6fb6857a61 100644 --- a/container/src/LuigiContainer.svelte +++ b/container/src/LuigiContainer.svelte @@ -37,6 +37,7 @@ updateContext = notInitFn('updateContext'); updateViewUrl = notInitFn('updateViewUrl'); closeAlert = notInitFn('closeAlert'); + notifyAlertClosed = notInitFn('notifyAlertClosed'); attributeChangedCallback(name, oldValue, newValue) { if (this.containerInitialized) { if (name === 'context') { @@ -155,10 +156,21 @@ } }; - thisComponent.closeAlert = (id: string, dismissKey: string) => { - ContainerAPI.closeAlert(id, dismissKey, iframeHandle); + thisComponent.closeAlert = (id: string, dismissKey?: string) => { + thisComponent.notifyAlertClosed(id, dismissKey); }; + thisComponent.notifyAlertClosed = (id: string, dismissKey?: string) => { + // check if thisComponent is in dom + if (thisComponent.isConnected) { + if (webcomponent) { + webcomponentService.resolveAlert(id, dismissKey); + } else { + ContainerAPI.notifyAlertClosed(id, dismissKey, iframeHandle); + } + } + } + containerService.registerContainer(thisComponent); webcomponentService.thisComponent = thisComponent; @@ -192,7 +204,7 @@ ); } else { if (!thisComponent.getNoShadow()) { - // removing mainComponent + // removeing mainComponent thisComponent.innerHTML = ''; const shadow = thisComponent.attachShadow({ mode: 'open' }); diff --git a/container/src/api/container-api.ts b/container/src/api/container-api.ts index 6183408e81..71dcb17d07 100644 --- a/container/src/api/container-api.ts +++ b/container/src/api/container-api.ts @@ -100,11 +100,12 @@ export class ContainerAPIFunctions { /** * Send a message to the microfrontend notifying the alert has been closed * @param id the id of the alert being closed - * @param dismissKey the dismiss key being sent if any - * @param iframeHandle the handle of the iframe to send the message to + * @param dismissKey the dismiss key being sent if any (optional) + * @param iframeHandle the handle of the iframe to send the message to (optional) */ - closeAlert(id: string, dismissKey: string, iframeHandle: IframeHandle) { - containerService.sendCustomMessageToIframe(iframeHandle, { id, dismissKey }, LuigiInternalMessageID.ALERT_CLOSED); + notifyAlertClosed(id: string, dismissKey?: string, iframeHandle?: IframeHandle) { + const message = dismissKey ? { id, dismissKey } : { id }; + containerService.sendCustomMessageToIframe(iframeHandle, message, LuigiInternalMessageID.ALERT_CLOSED); } } diff --git a/container/src/services/container.service.ts b/container/src/services/container.service.ts index 34857232b9..b3b88cf389 100644 --- a/container/src/services/container.service.ts +++ b/container/src/services/container.service.ts @@ -21,10 +21,10 @@ export class ContainerService { * @param msg the message to be sent * @param msgName the optional message name */ - sendCustomMessageToIframe(iframeHandle: IframeHandle, msg: object, msgName?: string) { + sendCustomMessageToIframe(iframeHandle: IframeHandle | undefined, msg: object, msgName?: string) { const messageName = msgName || 'custom'; - if (iframeHandle.iframe.contentWindow) { + if (iframeHandle?.iframe?.contentWindow) { const iframeUrl = new URL(iframeHandle.iframe.src); if (messageName === 'custom') { @@ -133,7 +133,10 @@ export class ContainerService { disabled: targetCnt.skipCookieCheck === 'true' } }, - authData: targetCnt.authData || {} + authData: targetCnt.authData || {}, + nodeParams: targetCnt.nodeParams || {}, + searchParams: targetCnt.searchParams || {}, + pathParams: targetCnt.pathParams || {} }, event.origin ); diff --git a/container/src/services/webcomponents.service.ts b/container/src/services/webcomponents.service.ts index feb43c54b4..3a71f4689a 100644 --- a/container/src/services/webcomponents.service.ts +++ b/container/src/services/webcomponents.service.ts @@ -18,6 +18,8 @@ import type { export class WebComponentService { containerService: ContainerService; thisComponent!: ContainerElement; + alertResolvers: Record void) | undefined> = {}; + alertIndex = 0; constructor() { this.containerService = new ContainerService(); @@ -237,8 +239,13 @@ export class WebComponentService { }, uxManager: () => { return { - showAlert: (alertSettings: object) => { - this.dispatchLuigiEvent(Events.ALERT_REQUEST, alertSettings); + showAlert: (alertSettings: Record) => { + alertSettings.id = this.alertIndex++; + + return new Promise((resolve) => { + this.alertResolvers[alertSettings.id] = resolve; + this.dispatchLuigiEvent(Events.ALERT_REQUEST, alertSettings); + }); }, showConfirmationModal: (settings: object) => { return new Promise((resolve, reject) => { @@ -745,4 +752,25 @@ export class WebComponentService { }); }); } + + /** + * Resolves an alert by invoking the corresponding resolver function for the given alert ID. + * This method attempts to resolve an alert associated with the specified `id` by calling its resolver function, + * if one exists in the `alertResolvers` object. If the resolver exists, it is invoked with `dismissKey` as its argument, + * and then the resolver is removed from the `alertResolvers` object to avoid future invocations. If no resolver is found + * for the provided `id`, a message is logged to the console indicating that no matching promise is in the list. + * @param {string} id - The unique identifier for the alert to resolve. + * @param {dismissKey} [dismissKey=true] - An optional key or value passed to the resolver. Defaults to `true` if not provided. + * + * @returns {void} + * + */ + resolveAlert(id: string, dismissKey = true): void { + if (this.alertResolvers[id]) { + this.alertResolvers[id](dismissKey); + this.alertResolvers[id] = undefined; + } else { + console.log('Promise is not in the list.'); + } + } } diff --git a/container/test-app/compound/compoundClientAPI.html b/container/test-app/compound/compoundClientAPI.html index f90d882885..4b30ee8519 100644 --- a/container/test-app/compound/compoundClientAPI.html +++ b/container/test-app/compound/compoundClientAPI.html @@ -47,11 +47,14 @@

-
+
@@ -79,6 +82,9 @@

compoundContainer.addEventListener(MFEventID.CUSTOM_MESSAGE, (e) => { console.debug('CUSTOM_MESSAGE Listener picked up: ', e.detail); + if (event.detail.id !== 'timer') { + alert(MFEventID.CUSTOM_MESSAGE + ': ' + event.detail.id); + } }); compoundContainer.compoundConfig = { @@ -119,7 +125,7 @@

name: 'sendInput', action: 'update', dataConverter: (data) => { - console.log( + console.info( 'dataConverter(): Received Custom Message from "input1" MF ' + data, ); return 'new text: ' + data; @@ -199,12 +205,6 @@

} }, ); - compoundContainer.addEventListener(MFEventID.CUSTOM_MESSAGE, (event) => { - if (event.detail.id !== 'timer') { - alert(MFEventID.CUSTOM_MESSAGE + ': ' + event.detail.id); - } - }); - compoundContainer.addEventListener( MFEventID.RUNTIME_ERROR_HANDLING_REQUEST, (event) => { @@ -314,6 +314,10 @@

children: [ { viewUrl: './compound/luigi-client-init-wc/luigi-client-init-wc.js', + layoutConfig: { + row: '1', + column: '1 / -1', + }, }, ], }; diff --git a/container/test-app/compound/luigi-client-init-wc/luigi-client-init-wc.js b/container/test-app/compound/luigi-client-init-wc/luigi-client-init-wc.js index afbb815eb1..88f66251cf 100644 --- a/container/test-app/compound/luigi-client-init-wc/luigi-client-init-wc.js +++ b/container/test-app/compound/luigi-client-init-wc/luigi-client-init-wc.js @@ -2,29 +2,79 @@ import { LuigiElement } from './../luigi-element.js'; export default class extends LuigiElement { constructor() { super({ openShadow: 'open', deferLuigiClientWCInit: false }); + const template = document.createElement('template'); - //remove buttons after review/AC template.innerHTML = ` -
+
+
-
header
-
- content - -
-
footer
-
- `; + + + + + + + + +

+
header
+
+ content + +
+
footer
+ + `; this._shadowRoot.appendChild(template.content.cloneNode(true)); + this.$button = this._shadowRoot.querySelector('#addNodeParams'); this.$button.addEventListener('click', () => { this.LuigiClient.addNodeParams({ Luigi: 'rocks' }, true); + console.log('addNodeParams has been called with no effect'); }); this.$button2 = this._shadowRoot.querySelector('#getNodeParams'); this.$button2.addEventListener('click', () => { - console.log('getNodeParams', this.LuigiClient.getNodeParams()); + console.log('getNodeParams: ' + JSON.stringify(this.LuigiClient.getNodeParams())); + }); + this.$button3 = this._shadowRoot.querySelector('#getCurrentTheme'); + this.$button3.addEventListener('click', () => { + console.log('getCurrentTheme: ' + this.LuigiClient.uxManager().getCurrentTheme()); + }); + this.$button4 = this._shadowRoot.querySelector('#getDirtyStatus'); + this.$button4.addEventListener('click', () => { + console.log('getDirtyStatus: ' + this.LuigiClient.uxManager().getDirtyStatus()); + }); + this.$button5 = this._shadowRoot.querySelector('#removeBackdrop'); + this.$button5.addEventListener('click', () => { + this.LuigiClient.uxManager().removeBackdrop(); + console.log('removeBackdrop has been called'); + }); + this.$button6 = this._shadowRoot.querySelector('#getAnchor'); + this.$button6.addEventListener('click', () => { + console.log('getAnchor: ' + this.LuigiClient.getAnchor()); + }); + this.$button7 = this._shadowRoot.querySelector('#getUserSettings'); + this.$button7.addEventListener('click', () => { + console.log('getUserSettings: ' + JSON.stringify(this.LuigiClient.getUserSettings())); + }); + this.$button8 = this._shadowRoot.querySelector('#setViewGroupData'); + this.$button8.addEventListener('click', () => { + const data = { vg: 'some data' }; + this.LuigiClient.setViewGroupData(data); + console.log('setViewGroupData has been called with ' + JSON.stringify(data)); + }); + this.$button9 = this._shadowRoot.querySelector('#navigateToIntent'); + this.$button9.addEventListener('click', () => { + const param = 'sales-setting'; + this.LuigiClient.linkManager().navigateToIntent(param); + console.log('navigateToIntent has been called with "' + param + '"'); + }); + this.$button10 = this._shadowRoot.querySelector('#fromParent'); + this.$button10.addEventListener('click', () => { + this.LuigiClient.linkManager().fromParent().getCurrentRoute(); + console.log('fromParent has been called'); }); } diff --git a/container/test-app/iframe/iframeContainer.html b/container/test-app/iframe/iframeContainer.html index a66f30c45f..a63f0bf88f 100644 --- a/container/test-app/iframe/iframeContainer.html +++ b/container/test-app/iframe/iframeContainer.html @@ -32,6 +32,10 @@

'[data-test-id="iframe-based-container-test"]', ); + luigiContainer.searchParams = { search: 'param' }; + luigiContainer.pathParams = { path: 'param' }; + luigiContainer.nodeParams = { node: 'params' }; + luigiContainer.addEventListener(Events.NAVIGATION_REQUEST, (event) => { console.log(event.detail); window.location.hash = event.detail.link; @@ -85,13 +89,24 @@

popup.appendChild(text); var dismissButton = document.createElement('BUTTON'); - var buttonText = document.createTextNode('Close Alert'); + if (alertSettings.settings.notifyAlertClosed) { + var buttonText = document.createTextNode('Close Alert using notifyAlertClosed'); + } else { + var buttonText = document.createTextNode('Close Alert'); + } dismissButton.addEventListener('click', () => { console.log( 'Dismiss clicked core side. Sending close message to mf of id =', alertSettings.settings.id, ); - luigiContainer.closeAlert(alertSettings.settings.id, 'neverShowItAgain'); + if (alertSettings.settings.notifyAlertClosed) { + luigiContainer.notifyAlertClosed( + alertSettings.settings.id, + 'neverShowItAgain', + ); + } else { + luigiContainer.closeAlert(alertSettings.settings.id, 'neverShowItAgain'); + } popup.style.display = 'none'; }); dismissButton.appendChild(buttonText); diff --git a/container/test-app/iframe/microfrontend.html b/container/test-app/iframe/microfrontend.html index ac80c3f96f..577eb60645 100644 --- a/container/test-app/iframe/microfrontend.html +++ b/container/test-app/iframe/microfrontend.html @@ -41,6 +41,7 @@

Multi purpose demo page

+ @@ -60,14 +61,19 @@

Multi purpose demo page

+ + + - +