]>
Commit | Line | Data |
---|---|---|
1 | import { NgModule } from '@angular/core' | |
2 | import { RouterModule, Routes } from '@angular/router' | |
3 | import { MetaGuard } from '@ngx-meta/core' | |
4 | import { LoginGuard } from '../core' | |
5 | import { MyAccountComponent } from './my-account.component' | |
6 | import { MyAccountSettingsComponent } from './my-account-settings/my-account-settings.component' | |
7 | import { MyAccountVideosComponent } from './my-account-videos/my-account-videos.component' | |
8 | import { MyAccountVideoImportsComponent } from '@app/+my-account/my-account-video-imports/my-account-video-imports.component' | |
9 | import { MyAccountSubscriptionsComponent } from '@app/+my-account/my-account-subscriptions/my-account-subscriptions.component' | |
10 | import { MyAccountOwnershipComponent } from '@app/+my-account/my-account-ownership/my-account-ownership.component' | |
11 | import { MyAccountBlocklistComponent } from '@app/+my-account/my-account-blocklist/my-account-blocklist.component' | |
12 | import { MyAccountServerBlocklistComponent } from '@app/+my-account/my-account-blocklist/my-account-server-blocklist.component' | |
13 | import { MyAccountHistoryComponent } from '@app/+my-account/my-account-history/my-account-history.component' | |
14 | import { MyAccountNotificationsComponent } from '@app/+my-account/my-account-notifications/my-account-notifications.component' | |
15 | import { MyAccountVideoPlaylistsComponent } from '@app/+my-account/my-account-video-playlists/my-account-video-playlists.component' | |
16 | import { | |
17 | MyAccountVideoPlaylistCreateComponent | |
18 | } from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component' | |
19 | import { | |
20 | MyAccountVideoPlaylistUpdateComponent | |
21 | } from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component' | |
22 | import { | |
23 | MyAccountVideoPlaylistElementsComponent | |
24 | } from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component' | |
25 | ||
26 | const myAccountRoutes: Routes = [ | |
27 | { | |
28 | path: '', | |
29 | component: MyAccountComponent, | |
30 | canActivateChild: [ MetaGuard, LoginGuard ], | |
31 | children: [ | |
32 | { | |
33 | path: '', | |
34 | redirectTo: 'settings', | |
35 | pathMatch: 'full' | |
36 | }, | |
37 | { | |
38 | path: 'settings', | |
39 | component: MyAccountSettingsComponent, | |
40 | data: { | |
41 | meta: { | |
42 | title: 'Account settings' | |
43 | } | |
44 | } | |
45 | }, | |
46 | ||
47 | { | |
48 | path: 'video-channels', | |
49 | loadChildren: () => import('./my-account-video-channels/my-account-video-channels.module').then(m => m.MyAccountVideoChannelsModule) | |
50 | }, | |
51 | ||
52 | { | |
53 | path: 'video-playlists', | |
54 | component: MyAccountVideoPlaylistsComponent, | |
55 | data: { | |
56 | meta: { | |
57 | title: 'Account playlists' | |
58 | } | |
59 | } | |
60 | }, | |
61 | { | |
62 | path: 'video-playlists/create', | |
63 | component: MyAccountVideoPlaylistCreateComponent, | |
64 | data: { | |
65 | meta: { | |
66 | title: 'Create new playlist' | |
67 | } | |
68 | } | |
69 | }, | |
70 | { | |
71 | path: 'video-playlists/:videoPlaylistId', | |
72 | component: MyAccountVideoPlaylistElementsComponent, | |
73 | data: { | |
74 | meta: { | |
75 | title: 'Playlist elements' | |
76 | } | |
77 | } | |
78 | }, | |
79 | { | |
80 | path: 'video-playlists/update/:videoPlaylistId', | |
81 | component: MyAccountVideoPlaylistUpdateComponent, | |
82 | data: { | |
83 | meta: { | |
84 | title: 'Update playlist' | |
85 | } | |
86 | } | |
87 | }, | |
88 | ||
89 | { | |
90 | path: 'videos', | |
91 | component: MyAccountVideosComponent, | |
92 | data: { | |
93 | meta: { | |
94 | title: 'Account videos' | |
95 | }, | |
96 | reuse: { | |
97 | enabled: true, | |
98 | key: 'my-account-videos-list' | |
99 | } | |
100 | } | |
101 | }, | |
102 | { | |
103 | path: 'video-imports', | |
104 | component: MyAccountVideoImportsComponent, | |
105 | data: { | |
106 | meta: { | |
107 | title: 'Account video imports' | |
108 | } | |
109 | } | |
110 | }, | |
111 | { | |
112 | path: 'subscriptions', | |
113 | component: MyAccountSubscriptionsComponent, | |
114 | data: { | |
115 | meta: { | |
116 | title: 'Account subscriptions' | |
117 | } | |
118 | } | |
119 | }, | |
120 | { | |
121 | path: 'ownership', | |
122 | component: MyAccountOwnershipComponent, | |
123 | data: { | |
124 | meta: { | |
125 | title: 'Ownership changes' | |
126 | } | |
127 | } | |
128 | }, | |
129 | { | |
130 | path: 'blocklist/accounts', | |
131 | component: MyAccountBlocklistComponent, | |
132 | data: { | |
133 | meta: { | |
134 | title: 'Muted accounts' | |
135 | } | |
136 | } | |
137 | }, | |
138 | { | |
139 | path: 'blocklist/servers', | |
140 | component: MyAccountServerBlocklistComponent, | |
141 | data: { | |
142 | meta: { | |
143 | title: 'Muted instances' | |
144 | } | |
145 | } | |
146 | }, | |
147 | { | |
148 | path: 'history/videos', | |
149 | component: MyAccountHistoryComponent, | |
150 | data: { | |
151 | meta: { | |
152 | title: 'Videos history' | |
153 | }, | |
154 | reuse: { | |
155 | enabled: true, | |
156 | key: 'my-videos-history-list' | |
157 | } | |
158 | } | |
159 | }, | |
160 | { | |
161 | path: 'notifications', | |
162 | component: MyAccountNotificationsComponent, | |
163 | data: { | |
164 | meta: { | |
165 | title: 'Notifications' | |
166 | } | |
167 | } | |
168 | } | |
169 | ] | |
170 | } | |
171 | ] | |
172 | ||
173 | @NgModule({ | |
174 | imports: [ RouterModule.forChild(myAccountRoutes) ], | |
175 | exports: [ RouterModule ] | |
176 | }) | |
177 | export class MyAccountRoutingModule {} |