@dbp-toolkit/check-in-place-select
Advanced tools
Comparing version 0.1.3 to 0.2.0
@@ -1,4 +0,4 @@ | ||
import { d as defineCustomElement, C as CheckInPlaceSelect } from './shared/check-in-place-select.16fef2f9.es.js'; | ||
import { d as defineCustomElement, C as CheckInPlaceSelect } from './shared/check-in-place-select.99e9e210.es.js'; | ||
defineCustomElement('dbp-check-in-place-select', CheckInPlaceSelect); | ||
//# sourceMappingURL=dbp-check-in-place-select.js.map |
{ | ||
"name": "@dbp-toolkit/check-in-place-select", | ||
"homepage": "https://gitlab.tugraz.at/dbp/web-components/toolkit/-/tree/master/packages/check-in-place-select", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"main": "src/index.js", | ||
@@ -38,7 +38,7 @@ "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", | ||
"jquery": "^3.4.1", | ||
"lit-element": "^2.3.1", | ||
"lit-element": "^2.4.0", | ||
"select2": "^4.0.10" | ||
@@ -61,3 +61,3 @@ }, | ||
}, | ||
"gitHead": "0e9ed70222d27095f46d05bcf62377846cfadf86" | ||
"gitHead": "6bae679f905cfbd07883cd2de3a3cce7b44b1ba2" | ||
} |
@@ -35,2 +35,5 @@ # Check-in place select web component | ||
- example `<dbp-check-in-place-select show-reload-button reload-button-text="Reload result list"></dbp-check-in-place-select>` | ||
- `auth` object: you need to set that object property for the auth token | ||
- example auth property: `{token: "THE_BEARER_TOKEN"}` | ||
- note: most often this should be an attribute that is not set directly, but subscribed at a provider | ||
@@ -37,0 +40,0 @@ ## Local development |
@@ -42,2 +42,3 @@ import {findObjectInApiResults} from './utils.js'; | ||
this.showCapacity = false; | ||
this.auth = {}; | ||
@@ -61,3 +62,4 @@ this._onDocumentClicked = this._onDocumentClicked.bind(this); | ||
static get properties() { | ||
return this.getProperties({ | ||
return { | ||
...super.properties, | ||
lang: { type: String }, | ||
@@ -71,3 +73,4 @@ active: { type: Boolean, attribute: false }, | ||
showCapacity: { type: Boolean, attribute: 'show-capacity' }, | ||
}); | ||
auth: { type: Object }, | ||
}; | ||
} | ||
@@ -168,3 +171,3 @@ | ||
beforeSend: function (jqXHR) { | ||
jqXHR.setRequestHeader('Authorization', 'Bearer ' + window.DBPAuthToken); | ||
jqXHR.setRequestHeader('Authorization', 'Bearer ' + that.auth.token); | ||
that.isSearching = true; | ||
@@ -241,3 +244,3 @@ }, | ||
'Content-Type': 'application/ld+json', | ||
'Authorization': 'Bearer ' + window.DBPAuthToken, | ||
'Authorization': 'Bearer ' + this.auth.token, | ||
}, | ||
@@ -313,2 +316,5 @@ }) | ||
break; | ||
case "auth": | ||
JSONLD.doInitializationOnce(this.entryPointUrl, this.auth.token); | ||
break; | ||
} | ||
@@ -315,0 +321,0 @@ }); |
@@ -27,7 +27,8 @@ import {i18n} from './i18n.js'; | ||
static get properties() { | ||
return this.getProperties({ | ||
return { | ||
...super.properties, | ||
lang: { type: String }, | ||
entryPointUrl: { type: String, attribute: 'entry-point-url' }, | ||
noAuth: { type: Boolean, attribute: 'no-auth' }, | ||
}); | ||
}; | ||
} | ||
@@ -56,8 +57,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> | ||
@@ -79,3 +80,3 @@ `; | ||
<div class="control"> | ||
<dbp-check-in-place-select lang="${this.lang}" entry-point-url="${this.entryPointUrl}"></dbp-check-in-place-select> | ||
<dbp-check-in-place-select lang="${this.lang}" entry-point-url="${this.entryPointUrl}" subscribe="auth"></dbp-check-in-place-select> | ||
</div> | ||
@@ -86,3 +87,3 @@ </div> | ||
<div class="control"> | ||
<dbp-check-in-place-select lang="${this.lang}" entry-point-url="${this.entryPointUrl}" show-reload-button reload-button-title="Click me"></dbp-check-in-place-select> | ||
<dbp-check-in-place-select lang="${this.lang}" entry-point-url="${this.entryPointUrl}" subscribe="auth" show-reload-button reload-button-title="Click me"></dbp-check-in-place-select> | ||
</div> | ||
@@ -89,0 +90,0 @@ </div> |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
3001081
23337
60
+ 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