aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-27 09:36:37 +0200
committerChocobozzz <chocobozzz@cpy.re>2021-10-29 11:48:21 +0200
commit00004f7f6b966a975498612117212b5373f4103c (patch)
tree4899b77da3c55bf1fbb77f927d9da5cd873e2c2a /client/src/app/+admin
parentbd898dd76babf6ab33a0040297bfb40a69a69dda (diff)
downloadPeerTube-00004f7f6b966a975498612117212b5373f4103c.tar.gz
PeerTube-00004f7f6b966a975498612117212b5373f4103c.tar.zst
PeerTube-00004f7f6b966a975498612117212b5373f4103c.zip
Put admin users in overview tab
Diffstat (limited to 'client/src/app/+admin')
-rw-r--r--client/src/app/+admin/admin-routing.module.ts5
-rw-r--r--client/src/app/+admin/admin.component.ts15
-rw-r--r--client/src/app/+admin/admin.module.ts3
-rw-r--r--client/src/app/+admin/overview/index.ts2
-rw-r--r--client/src/app/+admin/overview/overview.routes.ts6
-rw-r--r--client/src/app/+admin/overview/users/index.ts (renamed from client/src/app/+admin/users/index.ts)1
-rw-r--r--client/src/app/+admin/overview/users/user-edit/index.ts (renamed from client/src/app/+admin/users/user-edit/index.ts)0
-rw-r--r--client/src/app/+admin/overview/users/user-edit/user-create.component.ts (renamed from client/src/app/+admin/users/user-edit/user-create.component.ts)0
-rw-r--r--client/src/app/+admin/overview/users/user-edit/user-edit.component.html (renamed from client/src/app/+admin/users/user-edit/user-edit.component.html)0
-rw-r--r--client/src/app/+admin/overview/users/user-edit/user-edit.component.scss (renamed from client/src/app/+admin/users/user-edit/user-edit.component.scss)0
-rw-r--r--client/src/app/+admin/overview/users/user-edit/user-edit.ts (renamed from client/src/app/+admin/users/user-edit/user-edit.ts)2
-rw-r--r--client/src/app/+admin/overview/users/user-edit/user-password.component.html (renamed from client/src/app/+admin/users/user-edit/user-password.component.html)0
-rw-r--r--client/src/app/+admin/overview/users/user-edit/user-password.component.scss (renamed from client/src/app/+admin/users/user-edit/user-password.component.scss)0
-rw-r--r--client/src/app/+admin/overview/users/user-edit/user-password.component.ts (renamed from client/src/app/+admin/users/user-edit/user-password.component.ts)0
-rw-r--r--client/src/app/+admin/overview/users/user-edit/user-update.component.ts (renamed from client/src/app/+admin/users/user-edit/user-update.component.ts)0
-rw-r--r--client/src/app/+admin/overview/users/user-list/index.ts (renamed from client/src/app/+admin/users/user-list/index.ts)0
-rw-r--r--client/src/app/+admin/overview/users/user-list/user-list.component.html (renamed from client/src/app/+admin/users/user-list/user-list.component.html)5
-rw-r--r--client/src/app/+admin/overview/users/user-list/user-list.component.scss (renamed from client/src/app/+admin/users/user-list/user-list.component.scss)0
-rw-r--r--client/src/app/+admin/overview/users/user-list/user-list.component.ts (renamed from client/src/app/+admin/users/user-list/user-list.component.ts)0
-rw-r--r--client/src/app/+admin/overview/users/users.routes.ts (renamed from client/src/app/+admin/users/users.routes.ts)2
-rw-r--r--client/src/app/+admin/users/users.component.ts7
21 files changed, 32 insertions, 16 deletions
diff --git a/client/src/app/+admin/admin-routing.module.ts b/client/src/app/+admin/admin-routing.module.ts
index d029661d3..bd08b8287 100644
--- a/client/src/app/+admin/admin-routing.module.ts
+++ b/client/src/app/+admin/admin-routing.module.ts
@@ -6,7 +6,7 @@ import { PluginsRoutes } from '@app/+admin/plugins/plugins.routes'
6import { SystemRoutes } from '@app/+admin/system' 6import { SystemRoutes } from '@app/+admin/system'
7import { AdminComponent } from './admin.component' 7import { AdminComponent } from './admin.component'
8import { FollowsRoutes } from './follows' 8import { FollowsRoutes } from './follows'
9import { UsersRoutes } from './users' 9import { OverviewRoutes } from './overview'
10 10
11const adminRoutes: Routes = [ 11const adminRoutes: Routes = [
12 { 12 {
@@ -18,8 +18,9 @@ const adminRoutes: Routes = [
18 redirectTo: 'users', 18 redirectTo: 'users',
19 pathMatch: 'full' 19 pathMatch: 'full'
20 }, 20 },
21
21 ...FollowsRoutes, 22 ...FollowsRoutes,
22 ...UsersRoutes, 23 ...OverviewRoutes,
23 ...ModerationRoutes, 24 ...ModerationRoutes,
24 ...SystemRoutes, 25 ...SystemRoutes,
25 ...ConfigRoutes, 26 ...ConfigRoutes,
diff --git a/client/src/app/+admin/admin.component.ts b/client/src/app/+admin/admin.component.ts
index 15739f8d3..27d5e0a10 100644
--- a/client/src/app/+admin/admin.component.ts
+++ b/client/src/app/+admin/admin.component.ts
@@ -31,8 +31,21 @@ export class AdminComponent implements OnInit {
31 } 31 }
32 32
33 private buildOverviewItems () { 33 private buildOverviewItems () {
34 const overviewItems: TopMenuDropdownParam = {
35 label: $localize`Overview`,
36 children: []
37 }
38
34 if (this.hasUsersRight()) { 39 if (this.hasUsersRight()) {
35 this.menuEntries.push({ label: $localize`Users`, routerLink: '/admin/users' }) 40 overviewItems.children.push({
41 label: $localize`Users`,
42 routerLink: '/admin/users',
43 iconName: 'user'
44 })
45 }
46
47 if (overviewItems.children.length !== 0) {
48 this.menuEntries.push(overviewItems)
36 } 49 }
37 } 50 }
38 51
diff --git a/client/src/app/+admin/admin.module.ts b/client/src/app/+admin/admin.module.ts
index 1ea7b9784..a2bd88880 100644
--- a/client/src/app/+admin/admin.module.ts
+++ b/client/src/app/+admin/admin.module.ts
@@ -33,6 +33,7 @@ import { AbuseListComponent, VideoBlockListComponent } from './moderation'
33import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from './moderation/instance-blocklist' 33import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from './moderation/instance-blocklist'
34import { ModerationComponent } from './moderation/moderation.component' 34import { ModerationComponent } from './moderation/moderation.component'
35import { VideoCommentListComponent } from './moderation/video-comment-list' 35import { VideoCommentListComponent } from './moderation/video-comment-list'
36import { UserCreateComponent, UserListComponent, UserPasswordComponent, UserUpdateComponent } from './overview'
36import { PluginListInstalledComponent } from './plugins/plugin-list-installed/plugin-list-installed.component' 37import { PluginListInstalledComponent } from './plugins/plugin-list-installed/plugin-list-installed.component'
37import { PluginSearchComponent } from './plugins/plugin-search/plugin-search.component' 38import { PluginSearchComponent } from './plugins/plugin-search/plugin-search.component'
38import { PluginShowInstalledComponent } from './plugins/plugin-show-installed/plugin-show-installed.component' 39import { PluginShowInstalledComponent } from './plugins/plugin-show-installed/plugin-show-installed.component'
@@ -41,7 +42,6 @@ import { PluginApiService } from './plugins/shared/plugin-api.service'
41import { JobService, LogsComponent, LogsService, SystemComponent } from './system' 42import { JobService, LogsComponent, LogsService, SystemComponent } from './system'
42import { DebugComponent, DebugService } from './system/debug' 43import { DebugComponent, DebugService } from './system/debug'
43import { JobsComponent } from './system/jobs/jobs.component' 44import { JobsComponent } from './system/jobs/jobs.component'
44import { UserCreateComponent, UserListComponent, UserPasswordComponent, UsersComponent, UserUpdateComponent } from './users'
45 45
46@NgModule({ 46@NgModule({
47 imports: [ 47 imports: [
@@ -73,7 +73,6 @@ import { UserCreateComponent, UserListComponent, UserPasswordComponent, UsersCom
73 VideoRedundanciesListComponent, 73 VideoRedundanciesListComponent,
74 VideoRedundancyInformationComponent, 74 VideoRedundancyInformationComponent,
75 75
76 UsersComponent,
77 UserCreateComponent, 76 UserCreateComponent,
78 UserUpdateComponent, 77 UserUpdateComponent,
79 UserPasswordComponent, 78 UserPasswordComponent,
diff --git a/client/src/app/+admin/overview/index.ts b/client/src/app/+admin/overview/index.ts
new file mode 100644
index 000000000..b71a6a45f
--- /dev/null
+++ b/client/src/app/+admin/overview/index.ts
@@ -0,0 +1,2 @@
1export * from './users'
2export * from './overview.routes'
diff --git a/client/src/app/+admin/overview/overview.routes.ts b/client/src/app/+admin/overview/overview.routes.ts
new file mode 100644
index 000000000..cb5986072
--- /dev/null
+++ b/client/src/app/+admin/overview/overview.routes.ts
@@ -0,0 +1,6 @@
1import { Routes } from '@angular/router'
2import { UsersRoutes } from './users'
3
4export const OverviewRoutes: Routes = [
5 ...UsersRoutes
6]
diff --git a/client/src/app/+admin/users/index.ts b/client/src/app/+admin/overview/users/index.ts
index 156e54d89..6f15ab578 100644
--- a/client/src/app/+admin/users/index.ts
+++ b/client/src/app/+admin/overview/users/index.ts
@@ -1,4 +1,3 @@
1export * from './user-edit' 1export * from './user-edit'
2export * from './user-list' 2export * from './user-list'
3export * from './users.component'
4export * from './users.routes' 3export * from './users.routes'
diff --git a/client/src/app/+admin/users/user-edit/index.ts b/client/src/app/+admin/overview/users/user-edit/index.ts
index ec734ef92..ec734ef92 100644
--- a/client/src/app/+admin/users/user-edit/index.ts
+++ b/client/src/app/+admin/overview/users/user-edit/index.ts
diff --git a/client/src/app/+admin/users/user-edit/user-create.component.ts b/client/src/app/+admin/overview/users/user-edit/user-create.component.ts
index b61b22fd0..b61b22fd0 100644
--- a/client/src/app/+admin/users/user-edit/user-create.component.ts
+++ b/client/src/app/+admin/overview/users/user-edit/user-create.component.ts
diff --git a/client/src/app/+admin/users/user-edit/user-edit.component.html b/client/src/app/+admin/overview/users/user-edit/user-edit.component.html
index 772ebf272..772ebf272 100644
--- a/client/src/app/+admin/users/user-edit/user-edit.component.html
+++ b/client/src/app/+admin/overview/users/user-edit/user-edit.component.html
diff --git a/client/src/app/+admin/users/user-edit/user-edit.component.scss b/client/src/app/+admin/overview/users/user-edit/user-edit.component.scss
index d7932154b..d7932154b 100644
--- a/client/src/app/+admin/users/user-edit/user-edit.component.scss
+++ b/client/src/app/+admin/overview/users/user-edit/user-edit.component.scss
diff --git a/client/src/app/+admin/users/user-edit/user-edit.ts b/client/src/app/+admin/overview/users/user-edit/user-edit.ts
index af5e674a7..069b62a53 100644
--- a/client/src/app/+admin/users/user-edit/user-edit.ts
+++ b/client/src/app/+admin/overview/users/user-edit/user-edit.ts
@@ -4,7 +4,7 @@ import { AuthService, ScreenService, ServerService, User } from '@app/core'
4import { FormReactive } from '@app/shared/shared-forms' 4import { FormReactive } from '@app/shared/shared-forms'
5import { USER_ROLE_LABELS } from '@shared/core-utils/users' 5import { USER_ROLE_LABELS } from '@shared/core-utils/users'
6import { HTMLServerConfig, UserAdminFlag, UserRole, VideoResolution } from '@shared/models' 6import { HTMLServerConfig, UserAdminFlag, UserRole, VideoResolution } from '@shared/models'
7import { SelectOptionsItem } from '../../../../types/select-options-item.model' 7import { SelectOptionsItem } from '../../../../../types/select-options-item.model'
8 8
9@Directive() 9@Directive()
10// eslint-disable-next-line @angular-eslint/directive-class-suffix 10// eslint-disable-next-line @angular-eslint/directive-class-suffix
diff --git a/client/src/app/+admin/users/user-edit/user-password.component.html b/client/src/app/+admin/overview/users/user-edit/user-password.component.html
index 1238d1839..1238d1839 100644
--- a/client/src/app/+admin/users/user-edit/user-password.component.html
+++ b/client/src/app/+admin/overview/users/user-edit/user-password.component.html
diff --git a/client/src/app/+admin/users/user-edit/user-password.component.scss b/client/src/app/+admin/overview/users/user-edit/user-password.component.scss
index acb680682..acb680682 100644
--- a/client/src/app/+admin/users/user-edit/user-password.component.scss
+++ b/client/src/app/+admin/overview/users/user-edit/user-password.component.scss
diff --git a/client/src/app/+admin/users/user-edit/user-password.component.ts b/client/src/app/+admin/overview/users/user-edit/user-password.component.ts
index 42bf20de1..42bf20de1 100644
--- a/client/src/app/+admin/users/user-edit/user-password.component.ts
+++ b/client/src/app/+admin/overview/users/user-edit/user-password.component.ts
diff --git a/client/src/app/+admin/users/user-edit/user-update.component.ts b/client/src/app/+admin/overview/users/user-edit/user-update.component.ts
index 42599a17e..42599a17e 100644
--- a/client/src/app/+admin/users/user-edit/user-update.component.ts
+++ b/client/src/app/+admin/overview/users/user-edit/user-update.component.ts
diff --git a/client/src/app/+admin/users/user-list/index.ts b/client/src/app/+admin/overview/users/user-list/index.ts
index 1826a4abe..1826a4abe 100644
--- a/client/src/app/+admin/users/user-list/index.ts
+++ b/client/src/app/+admin/overview/users/user-list/index.ts
diff --git a/client/src/app/+admin/users/user-list/user-list.component.html b/client/src/app/+admin/overview/users/user-list/user-list.component.html
index c82f3c06f..a96dbd7f8 100644
--- a/client/src/app/+admin/users/user-list/user-list.component.html
+++ b/client/src/app/+admin/overview/users/user-list/user-list.component.html
@@ -1,3 +1,8 @@
1<h1>
2 <my-global-icon iconName="user" aria-hidden="true"></my-global-icon>
3 <ng-container i18n>Users</ng-container>
4</h1>
5
1<p-table 6<p-table
2 [value]="users" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions" 7 [value]="users" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
3 [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id" [resizableColumns]="true" [(selection)]="selectedUsers" 8 [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id" [resizableColumns]="true" [(selection)]="selectedUsers"
diff --git a/client/src/app/+admin/users/user-list/user-list.component.scss b/client/src/app/+admin/overview/users/user-list/user-list.component.scss
index e425306b5..e425306b5 100644
--- a/client/src/app/+admin/users/user-list/user-list.component.scss
+++ b/client/src/app/+admin/overview/users/user-list/user-list.component.scss
diff --git a/client/src/app/+admin/users/user-list/user-list.component.ts b/client/src/app/+admin/overview/users/user-list/user-list.component.ts
index 548e6e80f..548e6e80f 100644
--- a/client/src/app/+admin/users/user-list/user-list.component.ts
+++ b/client/src/app/+admin/overview/users/user-list/user-list.component.ts
diff --git a/client/src/app/+admin/users/users.routes.ts b/client/src/app/+admin/overview/users/users.routes.ts
index 9175be067..8b63f5bc7 100644
--- a/client/src/app/+admin/users/users.routes.ts
+++ b/client/src/app/+admin/overview/users/users.routes.ts
@@ -3,12 +3,10 @@ import { UserRightGuard } from '@app/core'
3import { UserRight } from '@shared/models' 3import { UserRight } from '@shared/models'
4import { UserCreateComponent, UserUpdateComponent } from './user-edit' 4import { UserCreateComponent, UserUpdateComponent } from './user-edit'
5import { UserListComponent } from './user-list' 5import { UserListComponent } from './user-list'
6import { UsersComponent } from './users.component'
7 6
8export const UsersRoutes: Routes = [ 7export const UsersRoutes: Routes = [
9 { 8 {
10 path: 'users', 9 path: 'users',
11 component: UsersComponent,
12 canActivate: [ UserRightGuard ], 10 canActivate: [ UserRightGuard ],
13 data: { 11 data: {
14 userRight: UserRight.MANAGE_USERS 12 userRight: UserRight.MANAGE_USERS
diff --git a/client/src/app/+admin/users/users.component.ts b/client/src/app/+admin/users/users.component.ts
deleted file mode 100644
index e9c8f6b0d..000000000
--- a/client/src/app/+admin/users/users.component.ts
+++ /dev/null
@@ -1,7 +0,0 @@
1import { Component } from '@angular/core'
2
3@Component({
4 template: '<router-outlet></router-outlet>'
5})
6export class UsersComponent {
7}