Merge branches 'main' and 'main' of https://github.com/umbraco/Umbraco.CMS.Backoffice
This commit is contained in:
@@ -86,13 +86,13 @@ export class UmbBackofficeHeader extends UmbContextConsumerMixin(LitElement) {
|
||||
private _allowedSection: Array<string> = [];
|
||||
|
||||
@state()
|
||||
private _sections: Array<UmbExtensionManifest<UmbManifestSectionMeta>> = [];
|
||||
private _sections: Array<UmbExtensionManifest> = [];
|
||||
|
||||
@state()
|
||||
private _visibleSections: Array<UmbExtensionManifest<UmbManifestSectionMeta>> = [];
|
||||
private _visibleSections: Array<UmbExtensionManifest> = [];
|
||||
|
||||
@state()
|
||||
private _extraSections: Array<UmbExtensionManifest<UmbManifestSectionMeta>> = [];
|
||||
private _extraSections: Array<UmbExtensionManifest> = [];
|
||||
|
||||
@state()
|
||||
private _currentSectionAlias = '';
|
||||
@@ -124,7 +124,7 @@ export class UmbBackofficeHeader extends UmbContextConsumerMixin(LitElement) {
|
||||
this._open = !this._open;
|
||||
}
|
||||
|
||||
private _handleTabClick(e: PointerEvent, section: UmbExtensionManifest<UmbManifestSectionMeta>) {
|
||||
private _handleTabClick(e: PointerEvent, section: UmbExtensionManifest) {
|
||||
const tab = e.currentTarget as any;
|
||||
|
||||
// TODO: we need to be able to prevent the tab from setting the active state
|
||||
|
||||
@@ -55,7 +55,7 @@ export class UmbBackofficeMain extends UmbContextConsumerMixin(LitElement) {
|
||||
this._currentSectionSubscription?.unsubscribe();
|
||||
}
|
||||
|
||||
private async _createSectionElement(section: UmbExtensionManifest<UmbManifestSectionMeta>) {
|
||||
private async _createSectionElement(section: UmbExtensionManifest) {
|
||||
if (!section) return;
|
||||
|
||||
// TODO: How do we handle dynamic imports of our files?
|
||||
|
||||
@@ -4,8 +4,8 @@ import { UmbExtensionManifest, UmbExtensionRegistry, UmbManifestSectionMeta } fr
|
||||
export class UmbSectionContext {
|
||||
private _extensionRegistry!: UmbExtensionRegistry;
|
||||
|
||||
private _current: ReplaySubject<UmbExtensionManifest<UmbManifestSectionMeta>> = new ReplaySubject(1);
|
||||
public readonly current: Observable<UmbExtensionManifest<UmbManifestSectionMeta>> = this._current.asObservable();
|
||||
private _current: ReplaySubject<UmbExtensionManifest> = new ReplaySubject(1);
|
||||
public readonly current: Observable<UmbExtensionManifest> = this._current.asObservable();
|
||||
|
||||
constructor(_extensionRegistry: UmbExtensionRegistry) {
|
||||
this._extensionRegistry = _extensionRegistry;
|
||||
@@ -14,7 +14,7 @@ export class UmbSectionContext {
|
||||
getSections () {
|
||||
return this._extensionRegistry.extensions
|
||||
.pipe(
|
||||
map((extensions: Array<UmbExtensionManifest<unknown>>) => extensions
|
||||
map((extensions: Array<UmbExtensionManifest>) => extensions
|
||||
.filter(extension => extension.type === 'section')
|
||||
.sort((a: any, b: any) => b.meta.weight - a.meta.weight))
|
||||
);
|
||||
@@ -26,7 +26,7 @@ export class UmbSectionContext {
|
||||
|
||||
async setCurrent (sectionAlias: string) {
|
||||
const sections = await firstValueFrom(this.getSections());
|
||||
const matchedSection = sections.find(section => section.alias === sectionAlias) as UmbExtensionManifest<UmbManifestSectionMeta>;
|
||||
const matchedSection = sections.find(section => section.alias === sectionAlias) as UmbExtensionManifest;
|
||||
this._current.next(matchedSection);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user