remove individual sort handling

This commit is contained in:
Mads Rasmussen
2022-10-11 10:16:59 +02:00
parent 346585e5a0
commit 62966ce12c
6 changed files with 14 additions and 33 deletions

View File

@@ -116,13 +116,7 @@ export class UmbEditorEntityLayout extends UmbContextConsumerMixin(LitElement) {
this._editorViewsSubscription = this._extensionRegistry
?.extensionsOfType('editorView')
.pipe(
map((extensions) =>
extensions
.filter((extension) => extension.meta.editors.includes(this.alias))
.sort((a, b) => b.meta.weight - a.meta.weight)
)
)
.pipe(map((extensions) => extensions.filter((extension) => extension.meta.editors.includes(this.alias))))
.subscribe((editorViews) => {
this._editorViews = editorViews;
this._createRoutes();

View File

@@ -92,9 +92,7 @@ export class UmbSectionDashboards extends UmbContextConsumerMixin(LitElement) {
?.extensionsOfType('dashboard')
.pipe(
map((extensions) =>
extensions
.filter((extension) => extension.meta.sections.includes(this._currentSectionAlias))
.sort((a, b) => b.meta.weight - a.meta.weight)
extensions.filter((extension) => extension.meta.sections.includes(this._currentSectionAlias))
)
)
.subscribe((dashboards) => {

View File

@@ -48,14 +48,13 @@ export class UmbSectionTrees extends UmbContextConsumerMixin(LitElement) {
if (!section) return EMPTY;
return (
this._extensionStore?.extensionsOfType('tree').pipe(
map((trees) =>
trees
.filter((tree) => tree.meta.sections.includes(section.alias))
.sort((a, b) => b.meta.weight - a.meta.weight)
.map((tree) => tree.alias)
)
) ?? of([])
this._extensionStore
?.extensionsOfType('tree')
.pipe(
map((trees) =>
trees.filter((tree) => tree.meta.sections.includes(section.alias)).map((tree) => tree.alias)
)
) ?? of([])
);
})
)

View File

@@ -72,13 +72,7 @@ export class UmbSectionElement extends UmbContextConsumerMixin(LitElement) {
return (
this._extensionRegistry
?.extensionsOfType('tree')
.pipe(
map((trees) =>
trees
.filter((tree) => tree.meta.sections.includes(section.alias))
.sort((a, b) => b.meta.weight - a.meta.weight)
)
) ?? of([])
.pipe(map((trees) => trees.filter((tree) => tree.meta.sections.includes(section.alias)))) ?? of([])
);
})
)

View File

@@ -90,11 +90,9 @@ export class UmbTreeContextMenuPageActionListElement extends UmbContextConsumerM
}
private _renderActions() {
return this._actions
.sort((a, b) => a.meta.weight - b.meta.weight)
.map((action) => {
return html`<umb-tree-item-action-extension .treeAction=${action}></umb-tree-item-action-extension> `;
});
return this._actions.map((action) => {
return html`<umb-tree-item-action-extension .treeAction=${action}></umb-tree-item-action-extension> `;
});
}
disconnectedCallback(): void {

View File

@@ -20,9 +20,7 @@ export class UmbSectionStore {
this._allowedSection = data.sections;
*/
return this._extensionRegistry
?.extensionsOfType('section')
.pipe(map((extensions) => extensions.sort((a, b) => b.meta.weight - a.meta.weight)));
return this._extensionRegistry?.extensionsOfType('section');
}
public setCurrent(alias: string) {