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

Add profile link

parent 0644956a
No related branches found
No related tags found
No related merge requests found
{ {
"login": "Einloggen", "login": "Einloggen",
"logout": "Ausloggen" "logout": "Ausloggen",
"profile": "Profil"
} }
{ {
"login": "Login", "login": "Login",
"logout": "Logout" "logout": "Logout",
"profile": "Profile"
} }
...@@ -38,6 +38,7 @@ class VPUAuth extends LitElement { ...@@ -38,6 +38,7 @@ class VPUAuth extends LitElement {
// Create the events // Create the events
this.initEvent = new CustomEvent("vpu-auth-init", { "detail": "KeyCloak init event", bubbles: true, composed: true }); this.initEvent = new CustomEvent("vpu-auth-init", { "detail": "KeyCloak init event", bubbles: true, composed: true });
this.personInitEvent = new CustomEvent("vpu-auth-person-init", { "detail": "KeyCloak person init event", bubbles: true, composed: true }); this.personInitEvent = new CustomEvent("vpu-auth-person-init", { "detail": "KeyCloak person init event", bubbles: true, composed: true });
this.profileEvent = new CustomEvent("vpu-auth-profile", { "detail": "Profile event", bubbles: true, composed: true });
this.keycloakDataUpdateEvent = new CustomEvent("vpu-auth-keycloak-data-update", { "detail": "KeyCloak data was updated", bubbles: true, composed: true }); this.keycloakDataUpdateEvent = new CustomEvent("vpu-auth-keycloak-data-update", { "detail": "KeyCloak data was updated", bubbles: true, composed: true });
this.closeDropdown = this.closeDropdown.bind(this); this.closeDropdown = this.closeDropdown.bind(this);
...@@ -194,6 +195,13 @@ class VPUAuth extends LitElement { ...@@ -194,6 +195,13 @@ class VPUAuth extends LitElement {
this.dispatchEvent(this.personInitEvent); this.dispatchEvent(this.personInitEvent);
} }
/**
* Dispatches the profile event
*/
dispatchProfileEvent() {
this.dispatchEvent(this.profileEvent);
}
/** /**
* Dispatches the keycloak data update event * Dispatches the keycloak data update event
*/ */
...@@ -275,9 +283,8 @@ class VPUAuth extends LitElement { ...@@ -275,9 +283,8 @@ class VPUAuth extends LitElement {
<div class="dropdown-menu" id="dropdown-menu2" role="menu"> <div class="dropdown-menu" id="dropdown-menu2" role="menu">
<div class="dropdown-content"> <div class="dropdown-content">
${imageURL ? html`<img src="${imageURL}" width="40%" height="40%" class="dropdown-item">` : ''} ${imageURL ? html`<img src="${imageURL}" width="40%" height="40%" class="dropdown-item">` : ''}
<a href="#" @click="${this.logout}" class="dropdown-item"> <a href="#" @click="${this.dispatchProfileEvent}" class="dropdown-item">${i18n.t('profile')}</a>
${i18n.t('logout')} <a href="#" @click="${this.logout}" class="dropdown-item">${i18n.t('logout')}</a>
</a>
</div> </div>
</div> </div>
</div> </div>
......
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