From 1566495a4b614ea64143ee9011997cee4d36e4d9 Mon Sep 17 00:00:00 2001
From: Patrizio Bekerle <patrizio.bekerle@tugraz.at>
Date: Wed, 25 Sep 2019 10:30:02 +0200
Subject: [PATCH] Implement noAuth parameter

---
 packages/person-select/src/person-select-demo.js | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/packages/person-select/src/person-select-demo.js b/packages/person-select/src/person-select-demo.js
index 649c76b7..91adc2bd 100644
--- a/packages/person-select/src/person-select-demo.js
+++ b/packages/person-select/src/person-select-demo.js
@@ -8,11 +8,13 @@ class PersonSelectDemo extends LitElement {
     constructor() {
         super();
         this.lang = 'de';
+        this.noAuth = false;
     }
 
     static get properties() {
         return {
             lang: { type: String },
+            noAuth: { type: Boolean, attribute: 'no-auth' },
         };
     }
 
@@ -24,6 +26,14 @@ class PersonSelectDemo extends LitElement {
         });
     }
 
+    getAuthComponentHtml() {
+        return this.noAuth ? html`` : html`
+            <div class="container">
+                <vpu-auth lang="${this.lang}" client-id="${commonUtils.setting('keyCloakClientId')}" load-person></vpu-auth>
+            </div>
+        `;
+    }
+
     render() {
         commonUtils.initAssetBaseURL('vpu-person-select-src');
         const bulmaCSS = commonUtils.getAssetURL(bulmaCSSPath);
@@ -34,9 +44,7 @@ class PersonSelectDemo extends LitElement {
                 <div class="container">
                     <h1 class="title">Person-Select-Demo</h1>
                 </div>
-                <div class="container">
-                    <vpu-auth lang="${this.lang}" client-id="${commonUtils.setting('keyCloakClientId')}" load-person></vpu-auth>
-                </div>
+                ${this.getAuthComponentHtml()}
                 <div class="container">
                     <form>
                         <div class="field">
-- 
GitLab