Add visitor settings, rework logged-in dropdown (#2514)
[oweals/peertube.git] / client / src / app / shared / shared.module.ts
1 import { CommonModule } from '@angular/common'
2 import { HttpClientModule } from '@angular/common/http'
3 import { NgModule } from '@angular/core'
4 import { FormsModule, ReactiveFormsModule } from '@angular/forms'
5 import { RouterModule } from '@angular/router'
6 import { MarkdownTextareaComponent } from '@app/shared/forms/markdown-textarea.component'
7 import { HelpComponent } from '@app/shared/misc/help.component'
8 import { ListOverflowComponent } from '@app/shared/misc/list-overflow.component'
9 import { InfiniteScrollerDirective } from '@app/shared/video/infinite-scroller.directive'
10 import { BytesPipe, KeysPipe, NgPipesModule } from 'ngx-pipes'
11 import { SharedModule as PrimeSharedModule } from 'primeng/api'
12 import { AUTH_INTERCEPTOR_PROVIDER } from './auth'
13 import { ButtonComponent } from './buttons/button.component'
14 import { DeleteButtonComponent } from './buttons/delete-button.component'
15 import { EditButtonComponent } from './buttons/edit-button.component'
16 import { LoaderComponent } from './misc/loader.component'
17 import { RestExtractor, RestService } from './rest'
18 import { UserService } from './users'
19 import { VideoAbuseService } from './video-abuse'
20 import { VideoBlacklistService } from './video-blacklist'
21 import { VideoOwnershipService } from './video-ownership'
22 import { VideoMiniatureComponent } from './video/video-miniature.component'
23 import { FeedComponent } from './video/feed.component'
24 import { VideoThumbnailComponent } from './video/video-thumbnail.component'
25 import { VideoService } from './video/video.service'
26 import { AccountService } from '@app/shared/account/account.service'
27 import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
28 import { I18n } from '@ngx-translate/i18n-polyfill'
29 import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
30 import {
31   CustomConfigValidatorsService,
32   InstanceValidatorsService,
33   LoginValidatorsService,
34   ReactiveFileComponent,
35   ResetPasswordValidatorsService,
36   TextareaAutoResizeDirective,
37   UserValidatorsService,
38   VideoAbuseValidatorsService,
39   VideoAcceptOwnershipValidatorsService,
40   VideoBlacklistValidatorsService,
41   VideoChangeOwnershipValidatorsService,
42   VideoChannelValidatorsService,
43   VideoCommentValidatorsService,
44   VideoPlaylistValidatorsService,
45   VideoValidatorsService
46 } from '@app/shared/forms'
47 import { I18nPrimengCalendarService } from '@app/shared/i18n/i18n-primeng-calendar'
48 import { InputMaskModule } from 'primeng/inputmask'
49 import { ScreenService } from '@app/shared/misc/screen.service'
50 import { LocalStorageService, SessionStorageService } from '@app/shared/misc/storage.service'
51 import { VideoCaptionsValidatorsService } from '@app/shared/forms/form-validators/video-captions-validators.service'
52 import { VideoCaptionService } from '@app/shared/video-caption'
53 import { PeertubeCheckboxComponent } from '@app/shared/forms/peertube-checkbox.component'
54 import { VideoImportService } from '@app/shared/video-import/video-import.service'
55 import { ActionDropdownComponent } from '@app/shared/buttons/action-dropdown.component'
56 import {
57   NgbCollapseModule,
58   NgbDropdownModule,
59   NgbModalModule,
60   NgbPopoverModule,
61   NgbTabsetModule,
62   NgbTooltipModule
63 } from '@ng-bootstrap/ng-bootstrap'
64 import { RemoteSubscribeComponent, SubscribeButtonComponent, UserSubscriptionService } from '@app/shared/user-subscription'
65 import { InstanceFeaturesTableComponent } from '@app/shared/instance/instance-features-table.component'
66 import { InstanceStatisticsComponent } from '@app/shared/instance/instance-statistics.component'
67 import { OverviewService } from '@app/shared/overview'
68 import { UserBanModalComponent } from '@app/shared/moderation'
69 import { UserModerationDropdownComponent } from '@app/shared/moderation/user-moderation-dropdown.component'
70 import { BlocklistService } from '@app/shared/blocklist'
71 import { AvatarComponent } from '@app/shared/channel/avatar.component'
72 import { TopMenuDropdownComponent } from '@app/shared/menu/top-menu-dropdown.component'
73 import { UserHistoryService } from '@app/shared/users/user-history.service'
74 import { UserNotificationService } from '@app/shared/users/user-notification.service'
75 import { UserNotificationsComponent } from '@app/shared/users/user-notifications.component'
76 import { InstanceService } from '@app/shared/instance/instance.service'
77 import { HtmlRendererService, LinkifierService, MarkdownService } from '@app/shared/renderer'
78 import { ConfirmComponent } from '@app/shared/confirm/confirm.component'
79 import { DateToggleComponent } from '@app/shared/date/date-toggle.component'
80 import { SmallLoaderComponent } from '@app/shared/misc/small-loader.component'
81 import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service'
82 import { PreviewUploadComponent } from '@app/shared/images/preview-upload.component'
83 import { GlobalIconComponent } from '@app/shared/images/global-icon.component'
84 import { VideoPlaylistMiniatureComponent } from '@app/shared/video-playlist/video-playlist-miniature.component'
85 import { VideoAddToPlaylistComponent } from '@app/shared/video-playlist/video-add-to-playlist.component'
86 import { TimestampInputComponent } from '@app/shared/forms/timestamp-input.component'
87 import { VideoPlaylistElementMiniatureComponent } from '@app/shared/video-playlist/video-playlist-element-miniature.component'
88 import { VideosSelectionComponent } from '@app/shared/video/videos-selection.component'
89 import { NumberFormatterPipe } from '@app/shared/angular/number-formatter.pipe'
90 import { VideoDurationPipe } from '@app/shared/angular/video-duration-formatter.pipe'
91 import { ObjectLengthPipe } from '@app/shared/angular/object-length.pipe'
92 import { FromNowPipe } from '@app/shared/angular/from-now.pipe'
93 import { HighlightPipe } from '@app/shared/angular/highlight.pipe'
94 import { PeerTubeTemplateDirective } from '@app/shared/angular/peertube-template.directive'
95 import { VideoActionsDropdownComponent } from '@app/shared/video/video-actions-dropdown.component'
96 import { VideoBlacklistComponent } from '@app/shared/video/modals/video-blacklist.component'
97 import { VideoDownloadComponent } from '@app/shared/video/modals/video-download.component'
98 import { VideoReportComponent } from '@app/shared/video/modals/video-report.component'
99 import { FollowService } from '@app/shared/instance/follow.service'
100 import { MultiSelectModule } from 'primeng/multiselect'
101 import { FeatureBooleanComponent } from '@app/shared/instance/feature-boolean.component'
102 import { InputReadonlyCopyComponent } from '@app/shared/forms/input-readonly-copy.component'
103 import { RedundancyService } from '@app/shared/video/redundancy.service'
104 import { ClipboardModule } from '@angular/cdk/clipboard'
105 import { InputSwitchModule } from 'primeng/inputswitch'
106
107 import { MyAccountVideoSettingsComponent } from '@app/+my-account/my-account-settings/my-account-video-settings'
108 import { MyAccountInterfaceSettingsComponent } from '@app/+my-account/my-account-settings/my-account-interface'
109
110 @NgModule({
111   imports: [
112     CommonModule,
113     FormsModule,
114     ReactiveFormsModule,
115     RouterModule,
116     HttpClientModule,
117
118     NgbDropdownModule,
119     NgbModalModule,
120     NgbPopoverModule,
121     NgbTabsetModule,
122     NgbTooltipModule,
123     NgbCollapseModule,
124
125     ClipboardModule,
126
127     PrimeSharedModule,
128     InputMaskModule,
129     NgPipesModule,
130     MultiSelectModule,
131     InputSwitchModule
132   ],
133
134   declarations: [
135     LoaderComponent,
136     SmallLoaderComponent,
137
138     VideoThumbnailComponent,
139     VideoMiniatureComponent,
140     VideoPlaylistMiniatureComponent,
141     VideoAddToPlaylistComponent,
142     VideoPlaylistElementMiniatureComponent,
143     VideosSelectionComponent,
144     VideoActionsDropdownComponent,
145
146     VideoDownloadComponent,
147     VideoReportComponent,
148     VideoBlacklistComponent,
149
150     FeedComponent,
151
152     ButtonComponent,
153     DeleteButtonComponent,
154     EditButtonComponent,
155
156     NumberFormatterPipe,
157     ObjectLengthPipe,
158     FromNowPipe,
159     HighlightPipe,
160     PeerTubeTemplateDirective,
161     VideoDurationPipe,
162
163     ActionDropdownComponent,
164     MarkdownTextareaComponent,
165     InfiniteScrollerDirective,
166     TextareaAutoResizeDirective,
167     HelpComponent,
168     ListOverflowComponent,
169
170     ReactiveFileComponent,
171     PeertubeCheckboxComponent,
172     TimestampInputComponent,
173     InputReadonlyCopyComponent,
174
175     AvatarComponent,
176     SubscribeButtonComponent,
177     RemoteSubscribeComponent,
178     InstanceFeaturesTableComponent,
179     InstanceStatisticsComponent,
180     FeatureBooleanComponent,
181     UserBanModalComponent,
182     UserModerationDropdownComponent,
183     TopMenuDropdownComponent,
184     UserNotificationsComponent,
185     ConfirmComponent,
186     DateToggleComponent,
187
188     GlobalIconComponent,
189     PreviewUploadComponent,
190
191     MyAccountVideoSettingsComponent,
192     MyAccountInterfaceSettingsComponent
193   ],
194
195   exports: [
196     CommonModule,
197     FormsModule,
198     ReactiveFormsModule,
199     RouterModule,
200     HttpClientModule,
201
202     NgbDropdownModule,
203     NgbModalModule,
204     NgbPopoverModule,
205     NgbTabsetModule,
206     NgbTooltipModule,
207     NgbCollapseModule,
208
209     ClipboardModule,
210
211     PrimeSharedModule,
212     InputMaskModule,
213     BytesPipe,
214     KeysPipe,
215     MultiSelectModule,
216
217     LoaderComponent,
218     SmallLoaderComponent,
219
220     VideoThumbnailComponent,
221     VideoMiniatureComponent,
222     VideoPlaylistMiniatureComponent,
223     VideoAddToPlaylistComponent,
224     VideoPlaylistElementMiniatureComponent,
225     VideosSelectionComponent,
226     VideoActionsDropdownComponent,
227
228     VideoDownloadComponent,
229     VideoReportComponent,
230     VideoBlacklistComponent,
231
232     FeedComponent,
233
234     ButtonComponent,
235     DeleteButtonComponent,
236     EditButtonComponent,
237
238     ActionDropdownComponent,
239     MarkdownTextareaComponent,
240     InfiniteScrollerDirective,
241     TextareaAutoResizeDirective,
242     HelpComponent,
243     ListOverflowComponent,
244     InputReadonlyCopyComponent,
245
246     ReactiveFileComponent,
247     PeertubeCheckboxComponent,
248     TimestampInputComponent,
249
250     AvatarComponent,
251     SubscribeButtonComponent,
252     RemoteSubscribeComponent,
253     InstanceFeaturesTableComponent,
254     InstanceStatisticsComponent,
255     UserBanModalComponent,
256     UserModerationDropdownComponent,
257     TopMenuDropdownComponent,
258     UserNotificationsComponent,
259     ConfirmComponent,
260     DateToggleComponent,
261
262     GlobalIconComponent,
263     PreviewUploadComponent,
264
265     NumberFormatterPipe,
266     ObjectLengthPipe,
267     FromNowPipe,
268     HighlightPipe,
269     PeerTubeTemplateDirective,
270     VideoDurationPipe,
271
272     MyAccountVideoSettingsComponent,
273     MyAccountInterfaceSettingsComponent
274   ],
275
276   providers: [
277     AUTH_INTERCEPTOR_PROVIDER,
278     RestExtractor,
279     RestService,
280     VideoAbuseService,
281     VideoBlacklistService,
282     VideoOwnershipService,
283     UserService,
284     VideoService,
285     AccountService,
286     VideoChannelService,
287     VideoPlaylistService,
288     VideoCaptionService,
289     VideoImportService,
290     UserSubscriptionService,
291
292     FormValidatorService,
293     CustomConfigValidatorsService,
294     LoginValidatorsService,
295     ResetPasswordValidatorsService,
296     UserValidatorsService,
297     VideoPlaylistValidatorsService,
298     VideoAbuseValidatorsService,
299     VideoChannelValidatorsService,
300     VideoCommentValidatorsService,
301     VideoValidatorsService,
302     VideoCaptionsValidatorsService,
303     VideoBlacklistValidatorsService,
304     OverviewService,
305     VideoChangeOwnershipValidatorsService,
306     VideoAcceptOwnershipValidatorsService,
307     InstanceValidatorsService,
308     BlocklistService,
309     UserHistoryService,
310     InstanceService,
311
312     MarkdownService,
313     LinkifierService,
314     HtmlRendererService,
315
316     I18nPrimengCalendarService,
317     ScreenService,
318     LocalStorageService, SessionStorageService,
319
320     UserNotificationService,
321
322     FollowService,
323     RedundancyService,
324
325     I18n
326   ]
327 })
328 export class SharedModule { }