Skip to content
Snippets Groups Projects
Commit d421e76c authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Remove the user profile from the app shell

parent e4f3bc2a
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,6 @@ import * as events from 'vpu-common/events.js';
import {BuildInfo} from './build-info.js';
import {TUGrazLogo} from './tugraz-logo.js';
import {send as notify} from 'vpu-common/notification';
import {userProfileMeta} from './vpu-app-shell-user-profile.js';
import {appWelcomeMeta} from './vpu-app-shell-welcome.js';
......@@ -133,11 +132,9 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
}
}
// Inject the user profile and welcome activity
routes.push("user-profile");
// Inject the welcome activity
routes.unshift("welcome");
metadata = Object.assign(metadata, {
"user-profile": userProfileMeta,
"welcome": appWelcomeMeta,
});
customElements.get("vpu-app-shell-welcome").app = this;
......@@ -248,11 +245,6 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
this.fetchMetadata(this.src);
this.initRouter();
// listen to the vpu-auth-profile event to switch to the person profile
window.addEventListener("vpu-auth-profile", () => {
this.switchComponent('user-profile');
});
this._subscriber.subscribe(this._updateAuth);
}
......@@ -685,7 +677,7 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
<div class="hd1-middle">
</div>
<div class="hd1-right">
<vpu-auth lang="${this.lang}" show-profile keycloak-config="${JSON.stringify(this.keycloakConfig)}" load-person try-login></vpu-auth>
<vpu-auth lang="${this.lang}" keycloak-config="${JSON.stringify(this.keycloakConfig)}" load-person try-login></vpu-auth>
</div>
<div class="hd2-left">
<div class="header">
......
import {createI18nInstance} from './i18n.js';
import {css, html, LitElement} from 'lit-element';
import * as commonUtils from 'vpu-common/utils';
import * as commonStyles from 'vpu-common/styles';
import {ScopedElementsMixin} from '@open-wc/scoped-elements';
import {PersonProfile} from 'vpu-person-profile';
const i18n = createI18nInstance();
class AppShellUserProfile extends ScopedElementsMixin(LitElement) {
constructor() {
super();
this.lang = i18n.language;
this._personId = window.VPUPersonId;
this.entryPointUrl = commonUtils.getAPiUrl();
}
static get scopedElements() {
return {
'vpu-person-profile': PersonProfile,
};
}
static get properties() {
return {
lang: { type: String },
entryPointUrl: { type: String, attribute: 'entry-point-url' },
_personId: {type: String, attribute: false},
};
}
connectedCallback() {
super.connectedCallback();
window.addEventListener("vpu-auth-person-init", () => {
this._personId = window.VPUPersonId;
});
}
static get styles() {
// language=css
return css`
${commonStyles.getThemeCSS()}
${commonStyles.getGeneralCSS()}
`;
}
render() {
return html`
<vpu-person-profile value="${this._personId}" entry-point-url="${this.entryPointUrl}" lang="${this.lang}"></vpu-person-profile>
`;
}
}
export const userProfileMeta = {
"element": "vpu-app-shell-user-profile",
"module_src": "",
"routing_name": "user-profile",
"name": {
"de": "Benutzerprofil",
"en": "User profile"
},
"short_name": {
"de": "Profil",
"en": "Profile"
},
"description": {
"de": "Zeigt informationen über den Benutzer an",
"en": "Shows information about the user"
},
visible: false
};
commonUtils.defineCustomElement('vpu-app-shell-user-profile', AppShellUserProfile);
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