Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export class UmbBackofficeHeaderSectionsElement extends UmbLitElement {
);
}

#getSectionName(section: UmbExtensionManifestInitializer<ManifestSection>) {
return section.manifest?.meta.label ? this.localize.string(section.manifest?.meta.label) : section.manifest?.name;
}

#getSectionPath(manifest: ManifestSection | undefined) {
return `section/${manifest?.meta.pathname}`;
}
Expand Down Expand Up @@ -108,12 +112,10 @@ export class UmbBackofficeHeaderSectionsElement extends UmbLitElement {
?active="${this._currentSectionAlias === section.alias}"
@click=${(event: PointerEvent) => this.#onSectionClick(event, section.manifest)}
href="${this.#getSectionPath(section.manifest)}"
label="${ifDefined(
section.manifest?.meta.label
? this.localize.string(section.manifest?.meta.label)
: section.manifest?.name,
)}"
data-mark="section-link:${section.alias}"></uui-tab>
label="${ifDefined(this.#getSectionName(section))}"
data-mark="section-link:${section.alias}"
>${this.#getSectionName(section)}</uui-tab
>
`,
)}
</uui-tab-group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ export class UmbSectionMainViewElement extends UmbLitElement {
: nothing;
}

#getDashboardName(dashboard: ManifestDashboard) {
return dashboard.meta?.label ? this.localize.string(dashboard.meta.label) : (dashboard.name ?? dashboard.alias);
}

#renderDashboards() {
// Only show dashboards if there are more than one dashboard or if there are both dashboards and views
return (this._dashboards.length > 0 && this._views.length > 0) || this._dashboards.length > 1
Expand All @@ -124,10 +128,10 @@ export class UmbSectionMainViewElement extends UmbLitElement {
return html`
<uui-tab
href="${this._routerPath}/${dashboardPath}"
label="${dashboard.meta.label
? this.localize.string(dashboard.meta.label)
: (dashboard.name ?? dashboard.alias)}"
?active="${isActive}"></uui-tab>
label="${this.#getDashboardName(dashboard)}"
?active="${isActive}"
>${this.#getDashboardName(dashboard)}</uui-tab
>
`;
})}
</uui-tab-group>
Expand Down
Loading