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

Use AdapterLitElement and integrate entry-point-url attribute

parent fefb27ae
No related branches found
No related tags found
No related merge requests found
Pipeline #16204 passed
import {i18n} from './i18n.js';
import {css, html, LitElement} from 'lit-element';
import {css, html} from 'lit-element';
import {ScopedElementsMixin} from '@open-wc/scoped-elements';
import {CheckInPlaceSelect} from './check-in-place-select.js';
import {AuthKeycloak, LoginButton} from '@dbp-toolkit/auth';
import * as commonUtils from '@dbp-toolkit/common/utils';
import * as tugUtils from '@dbp-toolkit/common/tug-utils';
import * as commonStyles from '@dbp-toolkit/common/styles';
import * as tugUtils from '@dbp-toolkit/common/tug-utils';
import DBPLitElement from "@dbp-toolkit/common/dbp-lit-element";
export class CheckInPlaceSelectDemo extends ScopedElementsMixin(LitElement) {
export class CheckInPlaceSelectDemo extends ScopedElementsMixin(DBPLitElement) {
constructor() {
super();
this.lang = 'de';
// TODO: for this to get out we would need the emitEJS rollup module to inject variables
this.entryPointUrl = tugUtils.getAPiUrl();
this.noAuth = false;
}
......@@ -23,10 +26,11 @@ export class CheckInPlaceSelectDemo extends ScopedElementsMixin(LitElement) {
}
static get properties() {
return {
return this.getProperties({
lang: { type: String },
entryPointUrl: { type: String, attribute: 'entry-point-url' },
noAuth: { type: Boolean, attribute: 'no-auth' },
};
});
}
connectedCallback() {
......@@ -72,13 +76,13 @@ export class CheckInPlaceSelectDemo extends ScopedElementsMixin(LitElement) {
<div class="field">
<label class="label">Check-In-Place 1</label>
<div class="control">
<dbp-check-in-place-select lang="${this.lang}" entry-point-url="${tugUtils.getAPiUrl()}"></dbp-check-in-place-select>
<dbp-check-in-place-select lang="${this.lang}" entry-point-url="${this.entryPointUrl}"></dbp-check-in-place-select>
</div>
</div>
<div class="field">
<label class="label">Check-In-Place 2</label>
<div class="control">
<dbp-check-in-place-select lang="${this.lang}" entry-point-url="${tugUtils.getAPiUrl()}" 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}" show-reload-button reload-button-title="Click me"></dbp-check-in-place-select>
</div>
</div>
</form>
......
import {i18n} from './i18n';
import {css, html, LitElement} from 'lit-element';
import {css, html} from 'lit-element';
import {ScopedElementsMixin} from '@open-wc/scoped-elements';
import {AuthKeycloak, LoginButton} from '@dbp-toolkit/auth';
import {KnowledgeBaseWebPageElementView} from './knowledge-base-web-page-element-view.js';
import * as commonUtils from '@dbp-toolkit/common/utils';
import * as commonStyles from '@dbp-toolkit/common/styles';
import * as tugUtils from '@dbp-toolkit/common/tug-utils';
import DBPLitElement from "@dbp-toolkit/common/dbp-lit-element";
export class KnowledgeBaseWebPageElementViewDemo extends ScopedElementsMixin(LitElement) {
export class KnowledgeBaseWebPageElementViewDemo extends ScopedElementsMixin(DBPLitElement) {
constructor() {
super();
this.lang = 'de';
// TODO: for this to get out we would need the emitEJS rollup module to inject variables
this.entryPointUrl = tugUtils.getAPiUrl();
this.noAuth = false;
}
......@@ -23,10 +26,11 @@ export class KnowledgeBaseWebPageElementViewDemo extends ScopedElementsMixin(Lit
}
static get properties() {
return {
return this.getProperties({
lang: { type: String },
entryPointUrl: { type: String, attribute: 'entry-point-url' },
noAuth: { type: Boolean, attribute: 'no-auth' },
};
});
}
update(changedProperties) {
......@@ -83,12 +87,12 @@ export class KnowledgeBaseWebPageElementViewDemo extends ScopedElementsMixin(Lit
<div class="container">
<h2 class="subtitle">Deutsch</h2>
<p>Ein erster Schritt</p>
<dbp-knowledge-base-web-page-element-view lang="de" entry-point-url="${tugUtils.getAPiUrl()}" value="bedienstete/bibliothek/buch-ausleihen" text="Ein Buch ausleihen"></dbp-knowledge-base-web-page-element-view>
<dbp-knowledge-base-web-page-element-view lang="de" entry-point-url="${this.entryPointUrl}" value="bedienstete/bibliothek/buch-ausleihen" text="Ein Buch ausleihen"></dbp-knowledge-base-web-page-element-view>
</div>
<div class="container">
<h2 class="subtitle">Englisch</h2>
<p>A first step</p>
<dbp-knowledge-base-web-page-element-view lang="en" entry-point-url="${tugUtils.getAPiUrl()}" value="bedienstete/bibliothek/buch-ausleihen" text="Borrow a book"></dbp-knowledge-base-web-page-element-view>
<dbp-knowledge-base-web-page-element-view lang="en" entry-point-url="${this.entryPointUrl}" value="bedienstete/bibliothek/buch-ausleihen" text="Borrow a book"></dbp-knowledge-base-web-page-element-view>
</div>
<hr>
<div class="container">
......
......@@ -14,6 +14,8 @@ export class PersonProfileDemo extends ScopedElementsMixin(DBPLitElement) {
constructor() {
super();
this.lang = 'de';
// TODO: for this to get out we would need the emitEJS rollup module to inject variables
this.entryPointUrl = tugUtils.getAPiUrl();
this.person = '';
this.selectedPerson = '';
this.noAuth = false;
......@@ -29,12 +31,13 @@ export class PersonProfileDemo extends ScopedElementsMixin(DBPLitElement) {
}
static get properties() {
return {
return this.getProperties({
lang: { type: String },
entryPointUrl: { type: String, attribute: 'entry-point-url' },
person: { type: String, attribute: false },
selectedPerson: { type: String, attribute: false },
noAuth: { type: Boolean, attribute: 'no-auth' },
};
});
}
connectedCallback() {
......@@ -86,7 +89,7 @@ export class PersonProfileDemo extends ScopedElementsMixin(DBPLitElement) {
<h1 class="title">Person-Profile-Demo</h1>
</div>
<div class="container">
<dbp-person-profile lang="${this.lang}" entry-point-url="${tugUtils.getAPiUrl()}" value="${this.person}"></dbp-person-profile>
<dbp-person-profile lang="${this.lang}" entry-point-url="${this.entryPointUrl}" value="${this.person}"></dbp-person-profile>
</div>
</section>
<section class="section">
......@@ -94,10 +97,10 @@ export class PersonProfileDemo extends ScopedElementsMixin(DBPLitElement) {
<h1 class="title">Select-Profile-Demo</h1>
</div>
<div class="container">
<dbp-person-select lang="${this.lang}" entry-point-url="${tugUtils.getAPiUrl()}"></dbp-person-select>
<dbp-person-select lang="${this.lang}" entry-point-url="${this.entryPointUrl}"></dbp-person-select>
</div>
<div class="container">
<dbp-person-profile lang="${this.lang}" entry-point-url="${tugUtils.getAPiUrl()}" value="${this.selectedPerson}"></dbp-person-profile>
<dbp-person-profile lang="${this.lang}" entry-point-url="${this.entryPointUrl}" value="${this.selectedPerson}"></dbp-person-profile>
</div>
</section>
`;
......
import {i18n} from './i18n.js';
import {css, html, LitElement} from 'lit-element';
import {css, html} from 'lit-element';
import {ScopedElementsMixin} from '@open-wc/scoped-elements';
import {PersonSelect} from './person-select.js';
import {AuthKeycloak, LoginButton} from '@dbp-toolkit/auth';
import * as commonUtils from '@dbp-toolkit/common/utils';
import * as commonStyles from '@dbp-toolkit/common/styles';
import * as tugUtils from '@dbp-toolkit/common/tug-utils';
import DBPLitElement from "@dbp-toolkit/common/dbp-lit-element";
export class PersonSelectDemo extends ScopedElementsMixin(LitElement) {
export class PersonSelectDemo extends ScopedElementsMixin(DBPLitElement) {
constructor() {
super();
this.lang = 'de';
// TODO: for this to get out we would need the emitEJS rollup module to inject variables
this.entryPointUrl = tugUtils.getAPiUrl();
this.noAuth = false;
}
......@@ -23,10 +26,11 @@ export class PersonSelectDemo extends ScopedElementsMixin(LitElement) {
}
static get properties() {
return {
return this.getProperties({
lang: { type: String },
entryPointUrl: { type: String, attribute: 'entry-point-url' },
noAuth: { type: Boolean, attribute: 'no-auth' },
};
});
}
connectedCallback() {
......@@ -72,13 +76,13 @@ export class PersonSelectDemo extends ScopedElementsMixin(LitElement) {
<div class="field">
<label class="label">Person 1</label>
<div class="control">
<dbp-person-select lang="${this.lang}" entry-point-url="${tugUtils.getAPiUrl()}"></dbp-person-select>
<dbp-person-select lang="${this.lang}" entry-point-url="${this.entryPointUrl}"></dbp-person-select>
</div>
</div>
<div class="field">
<label class="label">Person 2</label>
<div class="control">
<dbp-person-select lang="${this.lang}" entry-point-url="${tugUtils.getAPiUrl()}" show-reload-button reload-button-title="Click me"></dbp-person-select>
<dbp-person-select lang="${this.lang}" entry-point-url="${this.entryPointUrl}" show-reload-button reload-button-title="Click me"></dbp-person-select>
</div>
</div>
</form>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment