Skip to content

Commit

Permalink
wc: Undo using dashboard as an app #TASK-7216 #TASK-7100
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjuanes committed Nov 25, 2024
1 parent bad0d67 commit c63dbd1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/webcomponents/commons/layout/layout-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class LayoutSidebar extends LitElement {
`;
}

renderAppButton(app) {
renderButton(app) {
const active = this.currentUrl.startsWith(`#${app.id}`); // url always start with the app ID
return html`
<a
Expand All @@ -49,17 +49,14 @@ export default class LayoutSidebar extends LitElement {
}

render() {
// Note: dashboard app is always the first one and is not included in the Apps section of the sidebar
const dashboardApp = this.config?.apps?.find(app => app.id === "dashboard");
const otherApps = (this.config?.apps || []).filter(app => app.id !== "dashboard");
return html`
<div class="d-flex flex-column justify-content-between flex-shrink-0 border-end bg-gray-100 position-relative h-full" style="width:72px">
<div class="d-flex flex-column">
<div class="d-flex flex-column gap-1 user-select-none p-2">
${dashboardApp ? this.renderAppButton(dashboardApp) : nothing}
${otherApps.length > 0 ? html`
${this.renderButton({id: "dashboard", name: "Dashboard", icon: "fa-home"})}
${this.config?.apps?.length > 0 ? html`
${this.renderSectionSeparator("Apps")}
${otherApps.map(app => this.renderAppButton(app))}
${this.config.apps.map(app => this.renderButton(app))}
`: nothing}
<!--
<div class="mt-2 text-gray-500 fw-bold small">Favourites</div>
Expand Down

0 comments on commit c63dbd1

Please sign in to comment.