Skip to content
Snippets Groups Projects
Commit c551cdff authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire: Committed by Reiter, Christoph
Browse files

Implement noAuth parameter

parent 2738058f
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,7 @@ class PersonProfileDemo extends VPULitElement { ...@@ -14,6 +14,7 @@ class PersonProfileDemo extends VPULitElement {
this.lang = 'de'; this.lang = 'de';
this.person = ''; this.person = '';
this.selectedPerson = ''; this.selectedPerson = '';
this.noAuth = false;
} }
static get properties() { static get properties() {
...@@ -21,6 +22,7 @@ class PersonProfileDemo extends VPULitElement { ...@@ -21,6 +22,7 @@ class PersonProfileDemo extends VPULitElement {
lang: { type: String }, lang: { type: String },
person: { type: String, attribute: false }, person: { type: String, attribute: false },
selectedPerson: { type: String, attribute: false }, selectedPerson: { type: String, attribute: false },
noAuth: { type: Boolean, attribute: 'no-auth' },
}; };
} }
...@@ -31,7 +33,7 @@ class PersonProfileDemo extends VPULitElement { ...@@ -31,7 +33,7 @@ class PersonProfileDemo extends VPULitElement {
this.updateComplete.then(()=>{ this.updateComplete.then(()=>{
window.addEventListener("vpu-auth-person-init", () => { window.addEventListener("vpu-auth-person-init", () => {
that.person = that._('vpu-auth').person.identifier; that.person = window.VPUPersonId;
}); });
const personSelect = that._('vpu-person-select'); const personSelect = that._('vpu-person-select');
...@@ -42,16 +44,22 @@ class PersonProfileDemo extends VPULitElement { ...@@ -42,16 +44,22 @@ class PersonProfileDemo extends VPULitElement {
}); });
} }
render() { getAuthComponentHtml() {
const bulmaCSS = getAssetURL(bulmaCSSPath); return this.noAuth ? html`` : html`
return html`
<link rel="stylesheet" href="${bulmaCSS}">
<header> <header>
<div class="container"> <div class="container">
<vpu-auth lang="${this.lang}" client-id="${commonUtils.setting('keyCloakClientId')}" load-person remember-login style="float:right"></vpu-auth> <vpu-auth lang="${this.lang}" client-id="${commonUtils.setting('keyCloakClientId')}" load-person remember-login style="float:right"></vpu-auth>
</div> </div>
</header> </header>
`;
}
render() {
const bulmaCSS = getAssetURL(bulmaCSSPath);
return html`
<link rel="stylesheet" href="${bulmaCSS}">
${this.getAuthComponentHtml()}
<section class="section"> <section class="section">
<div class="container"> <div class="container">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment