refactor: routes service sorting logic

pull/4513/head
mehmet-erim 5 years ago
parent cdae51ba1a
commit 926fc0a5b0

@ -132,7 +132,12 @@ export abstract class AbstractNavTreeService<T extends ABP.Nav> extends Abstract
readonly id = 'name';
readonly parentId = 'parentName';
readonly hide = (item: T) => item.invisible || !this.isGranted(item);
readonly sort = (a: T, b: T) => a.order - b.order;
readonly sort = (a: T, b: T) => {
if (!a.order) return 1;
if (!b.order) return -1;
return a.order - b.order;
};
constructor(protected actions: Actions, protected store: Store) {
super();

@ -24,7 +24,7 @@ export function configureRoutes(routes: RoutesService) {
parentName: eThemeSharedRouteNames.Administration,
requiredPolicy: eSettingManagementPolicyNames.Settings,
layout: eLayoutType.application,
order: 6,
order: 100,
iconClass: 'fa fa-cog',
},
]);

@ -45,5 +45,5 @@ function sortItems(a: NavItem, b: NavItem) {
if (!a.order) return 1;
if (!b.order) return -1;
return a.order < b.order ? -1 : 1;
return a.order - b.order;
}

Loading…
Cancel
Save