From 1eff9f6434f572d4b919c54d1124a1129d868450 Mon Sep 17 00:00:00 2001 From: "Doberer, Johannes" Date: Thu, 6 Jun 2024 08:39:19 +0200 Subject: [PATCH] revert current theming --- core/src/services/web-components.js | 9 +----- .../examples/microfrontends/helloWorld.js | 30 ------------------- .../0-js-test-app/js-test-app-theming.cy.js | 27 ----------------- 3 files changed, 1 insertion(+), 65 deletions(-) delete mode 100644 test/e2e-js-test-application/public/examples/microfrontends/helloWorld.js diff --git a/core/src/services/web-components.js b/core/src/services/web-components.js index 78281faffb..93d8d9ba1d 100644 --- a/core/src/services/web-components.js +++ b/core/src/services/web-components.js @@ -65,14 +65,7 @@ class WebComponentSvcClass { } const clientAPI = { linkManager: window.Luigi.navigation, - uxManager: () => { - return { - ...window.Luigi.ux, - getCurrentTheme: () => { - return window.Luigi.theming().getCurrentTheme(); - } - }; - }, + uxManager: window.Luigi.ux, getCurrentLocale: () => window.Luigi.i18n().getCurrentLocale(), publishEvent: ev => { if (eventBusElement.eventBus) { diff --git a/test/e2e-js-test-application/public/examples/microfrontends/helloWorld.js b/test/e2e-js-test-application/public/examples/microfrontends/helloWorld.js deleted file mode 100644 index 111832d236..0000000000 --- a/test/e2e-js-test-application/public/examples/microfrontends/helloWorld.js +++ /dev/null @@ -1,30 +0,0 @@ -export default class ExampleWC extends HTMLElement { - constructor() { - super(); - const getCurrentThemeBtn = document.createElement('template'); - getCurrentThemeBtn.innerHTML = ''; - - const templateSpan = document.createElement('template'); - templateSpan.innerHTML = ''; - - this._shadowRoot = this.attachShadow({ - mode: 'open', - delegatesFocus: false - }); - this._shadowRoot.appendChild(getCurrentThemeBtn.content.cloneNode(true)); - this._shadowRoot.appendChild(templateSpan.content.cloneNode(true)); - - this.$currentTheme = this._shadowRoot.querySelector('#getCurrentTheme'); - this.$currentTheme.addEventListener('click', async () => { - if (this.LuigiClient) { - try { - this._shadowRoot.querySelector('span').innerHTML = JSON.stringify( - this.LuigiClient.uxManager().getCurrentTheme() - ); - } catch (err) { - console.log(err); - } - } - }); - } -} diff --git a/test/e2e-test-application/cypress/e2e/tests/0-js-test-app/js-test-app-theming.cy.js b/test/e2e-test-application/cypress/e2e/tests/0-js-test-app/js-test-app-theming.cy.js index b5bd3cd392..16334700ff 100644 --- a/test/e2e-test-application/cypress/e2e/tests/0-js-test-app/js-test-app-theming.cy.js +++ b/test/e2e-test-application/cypress/e2e/tests/0-js-test-app/js-test-app-theming.cy.js @@ -75,33 +75,6 @@ describe('JS-TEST-APP 2', () => { ); }); }); - - it.only('Get current theme for a webcomponent', () => { - newConfig.navigation.nodes[0].children.push({ - pathSegment: 'wc', - label: 'WC', - viewUrl: '/examples/microfrontends/helloWorld.js', - webcomponent: true - }); - cy.visitTestApp('/home/wc', newConfig); - cy.get( - 'luigi-wc-687474703a2f2f6c6f63616c686f73743a343530302f6578616d706c65732f6d6963726f66726f6e74656e64732f68656c6c6f576f726c642e6a73' - ) - .shadow() - .contains('light') - .should('not.exist'); - cy.get( - 'luigi-wc-687474703a2f2f6c6f63616c686f73743a343530302f6578616d706c65732f6d6963726f66726f6e74656e64732f68656c6c6f576f726c642e6a73' - ) - .shadow() - .contains('getCurrentTheme') - .click(); - cy.get( - 'luigi-wc-687474703a2f2f6c6f63616c686f73743a343530302f6578616d706c65732f6d6963726f66726f6e74656e64732f68656c6c6f576f726c642e6a73' - ) - .shadow() - .contains('light'); - }); }); describe('semiCollapsible settings of Left Side Navigation', () => {