Edge: menu order changes

This commit is contained in:
Artem Babak 2021-05-26 21:02:35 +03:00
parent fa8a47a59f
commit f81413112c
10 changed files with 49 additions and 29 deletions

View File

@ -291,26 +291,26 @@ export class MenuService {
);
if (authState.edgesSupportEnabled) {
sections.push(
{
id: guid(),
name: 'edge.management',
type: 'toggle',
path: '/edges',
height: '80px',
icon: 'router',
pages: [
{
id: guid(),
name: 'edge.edge-instances',
type: 'link',
path: '/edges',
path: '/edgeInstances',
icon: 'router'
},
{
id: guid(),
name: 'edge.management',
type: 'toggle',
path: '/edgeManagement',
height: '40px',
icon: 'settings_input_antenna',
pages: [
{
id: guid(),
name: 'edge.rulechain-templates',
type: 'link',
path: '/edges/ruleChains',
path: '/edgeManagement/ruleChains',
icon: 'settings_ethernet'
}
]
@ -448,12 +448,12 @@ export class MenuService {
{
name: 'edge.edge-instances',
icon: 'router',
path: '/edges'
path: '/edgeInstances'
},
{
name: 'edge.rulechain-templates',
icon: 'settings_ethernet',
path: '/edges/ruleChains'
path: '/edgeManagement/ruleChains'
}
]
}
@ -548,7 +548,7 @@ export class MenuService {
id: guid(),
name: 'edge.edge-instances',
type: 'link',
path: '/edges',
path: '/edgeInstances',
icon: 'router'
}
);
@ -606,8 +606,8 @@ export class MenuService {
places: [
{
name: 'edge.edge-instances',
icon: 'router',
path: '/edges'
icon: 'settings_input_antenna',
path: '/edgeInstances'
}
]
}

View File

@ -98,7 +98,7 @@ const routes: Routes = [
}
},
{
path: ':customerId/edges',
path: ':customerId/edgeInstances',
component: EntitiesTableComponent,
data: {
auth: [Authority.TENANT_ADMIN],

View File

@ -169,7 +169,7 @@ export class CustomersTableConfigResolver implements Resolve<EntityTableConfig<C
if ($event) {
$event.stopPropagation();
}
this.router.navigateByUrl(`customers/${customer.id.id}/edges`);
this.router.navigateByUrl(`customers/${customer.id.id}/edgeInstances`);
}
onCustomerAction(action: EntityAction<Customer>): boolean {

View File

@ -362,7 +362,7 @@ export class DashboardsTableConfigResolver implements Resolve<EntityTableConfig<
if (this.config.componentsData.dashboardScope === 'customer') {
this.router.navigateByUrl(`customers/${this.config.componentsData.customerId}/dashboards/${dashboard.id.id}`);
} else if (this.config.componentsData.dashboardScope === 'edge') {
this.router.navigateByUrl(`edges/${this.config.componentsData.edgeId}/dashboards/${dashboard.id.id}`);
this.router.navigateByUrl(`edgeInstances/${this.config.componentsData.edgeId}/dashboards/${dashboard.id.id}`);
} else {
this.router.navigateByUrl(`dashboards/${dashboard.id.id}`);
}

View File

@ -39,10 +39,11 @@ import {
RuleNodeComponentsResolver,
TooltipsterResolver
} from '@home/pages/rulechain/rulechain-routing.module';
import { CustomersTableConfigResolver } from '@home/pages/customer/customers-table-config.resolver';
const routes: Routes = [
{
path: 'edges',
path: 'edgeInstances',
data: {
breadcrumb: {
label: 'edge.edge-instances',
@ -55,7 +56,7 @@ const routes: Routes = [
component: EntitiesTableComponent,
data: {
auth: [Authority.TENANT_ADMIN, Authority.CUSTOMER_USER],
edgesType: 'tenant'
edgesType: 'tenant',
},
resolve: {
entitiesTableConfig: EdgesTableConfigResolver
@ -187,6 +188,24 @@ const routes: Routes = [
}
}
]
}
]
},
{
path: 'edgeManagement',
data: {
breadcrumb: {
label: 'edge.management',
icon: 'settings_input_antenna'
}
},
children: [
{
path: '',
data: {
auth: [Authority.TENANT_ADMIN, Authority.CUSTOMER_USER],
redirectTo: '/edgeManagement/ruleChains'
}
},
{
path: 'ruleChains',
@ -253,7 +272,8 @@ const routes: Routes = [
]
}
]
}];
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],

View File

@ -417,7 +417,7 @@ export class EdgesTableConfigResolver implements Resolve<EntityTableConfig<EdgeI
suffix = 'ruleChains';
break;
}
this.router.navigateByUrl(`edges/${edge.id.id}/${suffix}`);
this.router.navigateByUrl(`edgeInstances/${edge.id.id}/${suffix}`);
}
assignToCustomer($event: Event, edgesIds: Array<EdgeId>) {

View File

@ -152,7 +152,7 @@ export class RuleNodeDetailsComponent extends PageComponent implements OnInit, O
}
if (this.ruleNode.targetRuleChainId) {
if (this.ruleChainType === RuleChainType.EDGE) {
this.router.navigateByUrl(`/edges/ruleChains/${this.ruleNode.targetRuleChainId}`);
this.router.navigateByUrl(`/edgeManagement/ruleChains/${this.ruleNode.targetRuleChainId}`);
} else {
this.router.navigateByUrl(`/ruleChains/${this.ruleNode.targetRuleChainId}`);
}

View File

@ -1289,7 +1289,7 @@ export class RuleChainPageComponent extends PageComponent
if (this.ruleChainType !== RuleChainType.EDGE) {
this.router.navigateByUrl(`ruleChains/${this.ruleChain.id.id}`);
} else {
this.router.navigateByUrl(`edges/ruleChains/${this.ruleChain.id.id}`);
this.router.navigateByUrl(`edgeManagement/ruleChains/${this.ruleChain.id.id}`);
}
} else {
this.createRuleChainModel();

View File

@ -285,7 +285,7 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
if (ruleChainImport) {
this.itembuffer.storeRuleChainImport(ruleChainImport);
if (this.config.componentsData.ruleChainScope === 'edges') {
this.router.navigateByUrl(`edges/ruleChains/ruleChain/import`);
this.router.navigateByUrl(`edgeManagement/ruleChains/ruleChain/import`);
} else {
this.router.navigateByUrl(`ruleChains/ruleChain/import`);
}
@ -298,9 +298,9 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
$event.stopPropagation();
}
if (this.config.componentsData.ruleChainScope === 'edges') {
this.router.navigateByUrl(`edges/ruleChains/${ruleChain.id.id}`);
this.router.navigateByUrl(`edgeManagement/ruleChains/${ruleChain.id.id}`);
} else if (this.config.componentsData.ruleChainScope === 'edge') {
this.router.navigateByUrl(`edges/${this.config.componentsData.edgeId}/ruleChains/${ruleChain.id.id}`);
this.router.navigateByUrl(`edgeInstances/${this.config.componentsData.edgeId}/ruleChains/${ruleChain.id.id}`);
} else {
this.router.navigateByUrl(`ruleChains/${ruleChain.id.id}`);
}

View File

@ -50,7 +50,7 @@ export class RuleNodeComponent extends FcNodeComponent implements OnInit {
}
if (node.targetRuleChainId) {
if (node.ruleChainType === RuleChainType.EDGE) {
this.router.navigateByUrl(`/edges/ruleChains/${node.targetRuleChainId}`);
this.router.navigateByUrl(`/edgeManagement/ruleChains/${node.targetRuleChainId}`);
} else {
this.router.navigateByUrl(`/ruleChains/${node.targetRuleChainId}`);
}