@dbp-toolkit/matomo
Advanced tools
Comparing version 0.1.3 to 0.2.0
{ | ||
"name": "@dbp-toolkit/matomo", | ||
"homepage": "https://gitlab.tugraz.at/dbp/web-components/toolkit/-/tree/master/packages/matomo", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"main": "src/index.js", | ||
@@ -37,6 +37,6 @@ "license": "LGPL-2.1-or-later", | ||
"dependencies": { | ||
"@dbp-toolkit/auth": "^0.1.6", | ||
"@dbp-toolkit/common": "^0.1.4", | ||
"@dbp-toolkit/auth": "^0.2.0", | ||
"@dbp-toolkit/common": "^0.2.0", | ||
"@open-wc/scoped-elements": "^1.3.2", | ||
"lit-element": "^2.3.1" | ||
"lit-element": "^2.4.0" | ||
}, | ||
@@ -57,3 +57,3 @@ "scripts": { | ||
}, | ||
"gitHead": "0e9ed70222d27095f46d05bcf62377846cfadf86" | ||
"gitHead": "6bae679f905cfbd07883cd2de3a3cce7b44b1ba2" | ||
} |
@@ -31,3 +31,4 @@ import {i18n} from './i18n.js'; | ||
static get properties() { | ||
return this.getProperties({ | ||
return { | ||
...super.properties, | ||
lang: { type: String }, | ||
@@ -38,3 +39,3 @@ entryPointUrl: { type: String, attribute: 'entry-point-url' }, | ||
noAuth: { type: Boolean, attribute: 'no-auth' }, | ||
}); | ||
}; | ||
} | ||
@@ -73,8 +74,8 @@ | ||
getAuthComponentHtml() { | ||
return this.noAuth ? html`<dbp-login-button lang="${this.lang}" show-image></dbp-login-button>` : html` | ||
return this.noAuth ? html`<dbp-login-button subscribe="auth" lang="${this.lang}" show-image></dbp-login-button>` : html` | ||
<div class="container"> | ||
<dbp-auth-keycloak lang="${this.lang}" entry-point-url="${this.entryPointUrl}" silent-check-sso-redirect-uri="/dist/silent-check-sso.html" | ||
<dbp-auth-keycloak subscribe="requested-login-status" lang="${this.lang}" entry-point-url="${this.entryPointUrl}" silent-check-sso-redirect-uri="/dist/silent-check-sso.html" | ||
url="https://auth-dev.tugraz.at/auth" realm="tugraz" | ||
client-id="auth-dev-mw-frontend-local" load-person try-login></dbp-auth-keycloak> | ||
<dbp-login-button lang="${this.lang}" show-image></dbp-login-button> | ||
<dbp-login-button subscribe="auth" lang="${this.lang}" show-image></dbp-login-button> | ||
</div> | ||
@@ -81,0 +82,0 @@ `; |
import DBPLitElement from '@dbp-toolkit/common/dbp-lit-element'; | ||
import {EventBus} from '@dbp-toolkit/common'; | ||
import {LoginStatus} from "@dbp-toolkit/auth/src/util"; | ||
@@ -18,2 +18,4 @@ function pushEvent(event) { | ||
this.gitInfo = ''; | ||
this.auth = {}; | ||
this.loginStatus = ''; | ||
} | ||
@@ -27,17 +29,23 @@ | ||
gitInfo: { type: Number, attribute: 'git-info' }, | ||
auth: { type: Object }, | ||
}; | ||
} | ||
connectedCallback() { | ||
super.connectedCallback(); | ||
update(changedProperties) { | ||
changedProperties.forEach((oldValue, propName) => { | ||
switch (propName) { | ||
case 'auth': | ||
{ | ||
const loginStatus = this.auth['login-status']; | ||
this._bus = new EventBus(); | ||
this._bus.subscribe('auth-update', (data) => { | ||
this.setupMatomo(data.status === 'logged-in'); | ||
if (this.loginStatus !== loginStatus) { | ||
this.setupMatomo(loginStatus === LoginStatus.LOGGED_IN); | ||
this.loginStatus = loginStatus; | ||
} | ||
} | ||
break; | ||
} | ||
}); | ||
} | ||
disconnectedCallback() { | ||
this._bus.close(); | ||
super.disconnectedCallback(); | ||
super.update(changedProperties); | ||
} | ||
@@ -44,0 +52,0 @@ |
Sorry, the diff of this file is not supported yet
45936
346
+ Added@dbp-toolkit/auth@0.2.7(transitive)
+ Added@dbp-toolkit/common@0.2.13(transitive)
+ Added@lit-labs/ssr-dom-shim@1.3.0(transitive)
+ Added@lit/reactive-element@1.6.32.0.4(transitive)
+ Added@open-wc/scoped-elements@2.2.4(transitive)
+ Added@sentry/browser@6.19.7(transitive)
+ Added@sentry/core@6.19.7(transitive)
+ Added@sentry/hub@6.19.7(transitive)
+ Added@sentry/minimal@6.19.7(transitive)
+ Added@sentry/types@6.19.7(transitive)
+ Added@sentry/utils@6.19.7(transitive)
+ Added@types/trusted-types@2.0.7(transitive)
+ Addedi18next@20.6.1(transitive)
+ Addedlit@2.8.0(transitive)
+ Addedlit-element@3.3.3(transitive)
+ Addedlit-html@2.8.0(transitive)
- Removed@dbp-toolkit/auth@0.1.6(transitive)
- Removed@dbp-toolkit/common@0.1.4(transitive)
- Removed@sentry/browser@5.30.0(transitive)
- Removed@sentry/core@5.30.0(transitive)
- Removed@sentry/hub@5.30.0(transitive)
- Removed@sentry/minimal@5.30.0(transitive)
- Removed@sentry/types@5.30.0(transitive)
- Removed@sentry/utils@5.30.0(transitive)
- Removedi18next@19.9.2(transitive)
Updated@dbp-toolkit/auth@^0.2.0
Updated@dbp-toolkit/common@^0.2.0
Updatedlit-element@^2.4.0