thingsboard/ui-ngx/src/app/modules/home/pages/notification/notification-routing.module.ts

141 lines
4.5 KiB
TypeScript
Raw Normal View History

2023-02-13 19:09:05 +02:00
///
/// Copyright © 2016-2023 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
2023-03-21 17:56:12 +02:00
import { RouterModule, Routes } from '@angular/router';
2023-02-13 19:09:05 +02:00
import { Authority } from '@shared/models/authority.enum';
2023-03-21 17:56:12 +02:00
import { NgModule } from '@angular/core';
2023-02-13 19:09:05 +02:00
import { RouterTabsComponent } from '@home/components/router-tabs.component';
2023-03-21 17:56:12 +02:00
import { EntitiesTableComponent } from '@home/components/entity/entities-table.component';
import { InboxTableConfigResolver } from '@home/pages/notification/inbox/inbox-table-config.resolver';
import { SentTableConfigResolver } from '@home/pages/notification/sent/sent-table-config.resolver';
import { RecipientTableConfigResolver } from '@home/pages/notification/recipient/recipient-table-config.resolver';
import { TemplateTableConfigResolver } from '@home/pages/notification/template/template-table-config.resolver';
import { RuleTableConfigResolver } from '@home/pages/notification/rule/rule-table-config.resolver';
import { SendNotificationButtonComponent } from '@home/components/notification/send-notification-button.component';
2023-02-13 19:09:05 +02:00
const routes: Routes = [
{
path: 'notification',
component: RouterTabsComponent,
data: {
2023-03-21 17:56:12 +02:00
auth: [Authority.TENANT_ADMIN, Authority.CUSTOMER_USER, Authority.SYS_ADMIN],
2023-02-13 19:09:05 +02:00
breadcrumb: {
label: 'notification.notification-center',
icon: 'mdi:message-badge'
},
routerTabsHeaderComponent: SendNotificationButtonComponent
2023-02-13 19:09:05 +02:00
},
children: [
{
path: '',
children: [],
data: {
2023-03-21 17:56:12 +02:00
auth: [Authority.TENANT_ADMIN, Authority.CUSTOMER_USER, Authority.SYS_ADMIN],
2023-02-13 19:09:05 +02:00
redirectTo: '/notification/inbox'
}
},
{
path: 'inbox',
2023-03-21 17:56:12 +02:00
component: EntitiesTableComponent,
2023-02-13 19:09:05 +02:00
data: {
2023-03-21 17:56:12 +02:00
auth: [Authority.TENANT_ADMIN, Authority.CUSTOMER_USER, Authority.SYS_ADMIN],
2023-02-13 19:09:05 +02:00
title: 'notification.inbox',
breadcrumb: {
label: 'notification.inbox',
icon: 'inbox'
2023-03-21 17:56:12 +02:00
}
},
resolve: {
entitiesTableConfig: InboxTableConfigResolver
2023-02-13 19:09:05 +02:00
}
},
{
path: 'sent',
2023-03-21 17:56:12 +02:00
component: EntitiesTableComponent,
2023-02-13 19:09:05 +02:00
data: {
2023-03-21 17:56:12 +02:00
auth: [Authority.TENANT_ADMIN, Authority.SYS_ADMIN],
2023-02-13 19:09:05 +02:00
title: 'notification.sent',
breadcrumb: {
label: 'notification.sent',
icon: 'outbox'
2023-03-21 17:56:12 +02:00
}
},
resolve: {
entitiesTableConfig: SentTableConfigResolver
2023-02-13 19:09:05 +02:00
}
},
{
path: 'templates',
2023-03-21 17:56:12 +02:00
component: EntitiesTableComponent,
2023-02-13 19:09:05 +02:00
data: {
2023-03-21 17:56:12 +02:00
auth: [Authority.TENANT_ADMIN, Authority.SYS_ADMIN],
2023-02-13 19:09:05 +02:00
title: 'notification.templates',
breadcrumb: {
label: 'notification.templates',
icon: 'mdi:message-draw'
2023-03-21 17:56:12 +02:00
}
},
resolve: {
entitiesTableConfig: TemplateTableConfigResolver
2023-02-13 19:09:05 +02:00
}
},
{
path: 'recipients',
2023-03-21 17:56:12 +02:00
component: EntitiesTableComponent,
2023-02-13 19:09:05 +02:00
data: {
2023-03-21 17:56:12 +02:00
auth: [Authority.TENANT_ADMIN, Authority.SYS_ADMIN],
2023-02-13 19:09:05 +02:00
title: 'notification.recipients',
breadcrumb: {
label: 'notification.recipients',
icon: 'contacts'
},
2023-03-21 17:56:12 +02:00
},
resolve: {
entitiesTableConfig: RecipientTableConfigResolver
2023-02-13 19:09:05 +02:00
}
},
{
path: 'rules',
2023-03-21 17:56:12 +02:00
component: EntitiesTableComponent,
2023-02-13 19:09:05 +02:00
data: {
2023-03-21 17:56:12 +02:00
auth: [Authority.TENANT_ADMIN, Authority.SYS_ADMIN],
2023-02-13 19:09:05 +02:00
title: 'notification.rules',
breadcrumb: {
label: 'notification.rules',
icon: 'mdi:message-cog'
2023-03-21 17:56:12 +02:00
}
},
resolve: {
entitiesTableConfig: RuleTableConfigResolver
2023-02-13 19:09:05 +02:00
}
}
]
}
];
@NgModule({
2023-03-21 17:56:12 +02:00
providers: [
InboxTableConfigResolver,
SentTableConfigResolver,
RecipientTableConfigResolver,
TemplateTableConfigResolver,
RuleTableConfigResolver
],
2023-02-13 19:09:05 +02:00
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class NotificationRoutingModule { }