Skip to content
Snippets Groups Projects
Unverified Commit 0dcdc161 authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire:
Browse files

Fix lost auth and analytics-event attributes in AppShell

parent 957a4a65
No related branches found
No related tags found
No related merge requests found
Pipeline #48194 passed
...@@ -14,7 +14,6 @@ import {send as notify} from '@dbp-toolkit/common/notification'; ...@@ -14,7 +14,6 @@ import {send as notify} from '@dbp-toolkit/common/notification';
import {appWelcomeMeta} from './dbp-app-shell-welcome.js'; import {appWelcomeMeta} from './dbp-app-shell-welcome.js';
import {MatomoElement} from "@dbp-toolkit/matomo/src/matomo"; import {MatomoElement} from "@dbp-toolkit/matomo/src/matomo";
import DBPLitElement from "@dbp-toolkit/common/dbp-lit-element"; import DBPLitElement from "@dbp-toolkit/common/dbp-lit-element";
import {Provider} from "@dbp-toolkit/provider";
const i18n = createI18nInstance(); const i18n = createI18nInstance();
...@@ -70,6 +69,19 @@ export class AppShell extends ScopedElementsMixin(DBPLitElement) { ...@@ -70,6 +69,19 @@ export class AppShell extends ScopedElementsMixin(DBPLitElement) {
this._attrObserver = new MutationObserver(this.onAttributeObserved); this._attrObserver = new MutationObserver(this.onAttributeObserved);
this.auth = {}; this.auth = {};
// We need to "provider-terminate" these two attributes in the app-shell, but we
// don't want to force system integrators to add those attributes to the app-shell tag.
// Unfortunately we also need to be able to react to those properties outside the render() function,
// so we can't use a dbp-provider to terminate these attributes in the render() function.
this.setProperty('auth', {});
this.setProperty('analytics-event', {});
// We need to "provider-terminate" this attribute in the app-shell as well, and we also
// don't want to force system integrators to add this attribute to the app-shell tag.
// But for this attribute we could use a dbp-provider, because we only need it in the render() function,
// but we can also handle it like the two attributes above and spare us the use of a dbp-provider.
this.setProperty('requested-login-status', {});
} }
static get scopedElements() { static get scopedElements() {
...@@ -81,7 +93,6 @@ export class AppShell extends ScopedElementsMixin(DBPLitElement) { ...@@ -81,7 +93,6 @@ export class AppShell extends ScopedElementsMixin(DBPLitElement) {
'dbp-notification': Notification, 'dbp-notification': Notification,
'dbp-icon': Icon, 'dbp-icon': Icon,
'dbp-matomo': MatomoElement, 'dbp-matomo': MatomoElement,
'dbp-provider': Provider,
}; };
} }
...@@ -866,7 +877,6 @@ export class AppShell extends ScopedElementsMixin(DBPLitElement) { ...@@ -866,7 +877,6 @@ export class AppShell extends ScopedElementsMixin(DBPLitElement) {
return html` return html`
<slot class="${slotClassMap}"></slot> <slot class="${slotClassMap}"></slot>
<dbp-provider auth requested-login-status analytics-event>
<dbp-auth-keycloak subscribe="requested-login-status" lang="${this.lang}" entry-point-url="${this.entryPointUrl}" url="${kc.url}" realm="${kc.realm}" client-id="${kc.clientId}" silent-check-sso-redirect-uri="${kc.silentCheckSsoRedirectUri || ''}" scope="${kc.scope || ''}" idp-hint="${kc.idpHint || ''}" load-person ?force-login="${kc.forceLogin}" ?try-login="${!kc.forceLogin}"></dbp-auth-keycloak> <dbp-auth-keycloak subscribe="requested-login-status" lang="${this.lang}" entry-point-url="${this.entryPointUrl}" url="${kc.url}" realm="${kc.realm}" client-id="${kc.clientId}" silent-check-sso-redirect-uri="${kc.silentCheckSsoRedirectUri || ''}" scope="${kc.scope || ''}" idp-hint="${kc.idpHint || ''}" load-person ?force-login="${kc.forceLogin}" ?try-login="${!kc.forceLogin}"></dbp-auth-keycloak>
<dbp-matomo subscribe="auth,analytics-event" endpoint="${this.matomoUrl}" site-id="${this.matomoSiteId}" git-info="${this.gitInfo}"></dbp-matomo> <dbp-matomo subscribe="auth,analytics-event" endpoint="${this.matomoUrl}" site-id="${this.matomoSiteId}" git-info="${this.gitInfo}"></dbp-matomo>
<div class="${mainClassMap}"> <div class="${mainClassMap}">
...@@ -931,7 +941,6 @@ export class AppShell extends ScopedElementsMixin(DBPLitElement) { ...@@ -931,7 +941,6 @@ export class AppShell extends ScopedElementsMixin(DBPLitElement) {
</footer> </footer>
</div> </div>
</div> </div>
</dbp-provider>
`; `;
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment