From 19933f81865ed8df4171cf45133b065cd049ec3d Mon Sep 17 00:00:00 2001 From: tidusjar Date: Fri, 6 Nov 2020 22:18:18 +0000 Subject: [PATCH] Sorted out the user management bulk edit --- src/Ombi/ClientApp/angular.json | 1 + src/Ombi/ClientApp/package.json | 4 +- src/Ombi/ClientApp/src/app/app.component.html | 2 +- src/Ombi/ClientApp/src/app/app.component.ts | 34 +++++++-------- .../usermanagement.component.html | 42 ++++++++++--------- .../usermanagement.component.scss | 7 +++- .../usermanagement.component.ts | 5 +++ src/Ombi/ClientApp/src/tsconfig.app.json | 2 +- src/Ombi/ClientApp/yarn.lock | 23 ++++++---- 9 files changed, 69 insertions(+), 51 deletions(-) diff --git a/src/Ombi/ClientApp/angular.json b/src/Ombi/ClientApp/angular.json index 0d3e21b27..4038c9a56 100644 --- a/src/Ombi/ClientApp/angular.json +++ b/src/Ombi/ClientApp/angular.json @@ -28,6 +28,7 @@ "./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css", "src/styles/_imports.scss", "node_modules/bootstrap/scss/bootstrap.scss", + "node_modules/primeng/resources/themes/md-dark-deeppurple/theme.css", "node_modules/font-awesome/scss/font-awesome.scss", "node_modules/primeng/resources/primeng.min.css", "node_modules/primeicons/primeicons.css", diff --git a/src/Ombi/ClientApp/package.json b/src/Ombi/ClientApp/package.json index b795819d9..388815c78 100644 --- a/src/Ombi/ClientApp/package.json +++ b/src/Ombi/ClientApp/package.json @@ -50,8 +50,8 @@ "ngx-order-pipe": "^2.0.1", "please-wait": "^0.0.5", "popper.js": "^1.14.3", - "primeicons": "^1.0.0", - "primeng": "^9.0.6", + "primeicons": "^4.0.0", + "primeng": "^10.0.3", "rxjs": "^6.5.2", "spinkit": "^1.2.5", "store": "^2.0.12", diff --git a/src/Ombi/ClientApp/src/app/app.component.html b/src/Ombi/ClientApp/src/app/app.component.html index 5f074e17e..c9f18a210 100644 --- a/src/Ombi/ClientApp/src/app/app.component.html +++ b/src/Ombi/ClientApp/src/app/app.component.html @@ -170,7 +170,7 @@
- + diff --git a/src/Ombi/ClientApp/src/app/app.component.ts b/src/Ombi/ClientApp/src/app/app.component.ts index 9b12be5ef..6324f60d7 100644 --- a/src/Ombi/ClientApp/src/app/app.component.ts +++ b/src/Ombi/ClientApp/src/app/app.component.ts @@ -56,7 +56,6 @@ export class AppComponent implements OnInit { if (this.authService.loggedIn()) { this.identity.getUser().subscribe(u => { - this.username = u.userName; if (u.language) { this.translate.use(u.language); } @@ -107,28 +106,27 @@ export class AppComponent implements OnInit { this.currentUrl = event.url; if (event instanceof NavigationStart) { this.user = this.authService.claims(); + this.username = this.user.name; this.isAdmin = this.authService.hasRole("admin"); this.showNav = this.authService.loggedIn(); - // tslint:disable-next-line:no-string-literal - // if (this.user !== null && this.user.name && !this.checkedForUpdate && this.isAdmin) { - // this.checkedForUpdate = true; - // this.jobService.getCachedUpdate().subscribe(x => { - // this.updateAvailable = x; - // }, - // err => this.checkedForUpdate = true); - // } - - if (this.authService.loggedIn() && !this.hubConnected) { - this.signalrNotification.initialize(); - this.hubConnected = true; - - this.signalrNotification.Notification.subscribe(data => { - this.snackBar.open(data, "OK", { - duration: 3000 + if (this.authService.loggedIn()) { + + if (!this.isAdmin) { + // let's get the remaining requests etc + } + + if (!this.hubConnected) { + this.signalrNotification.initialize(); + this.hubConnected = true; + + this.signalrNotification.Notification.subscribe(data => { + this.snackBar.open(data, "OK", { + duration: 3000 + }); }); - }); + } } } }); diff --git a/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.html b/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.html index 40c9e9f6c..4b64e2f45 100644 --- a/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.html +++ b/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.html @@ -121,33 +121,35 @@ - +

Bulk Edit


+
-
- - +
+ + {{c.value | humanize}} +
-
-
-
- -
- -
-
+
-
- -
- -
-
- - + + Movie Request Limit + + + + Episode Request Limit + + + + Music Request Limit + + + + + diff --git a/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.scss b/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.scss index fc18d7781..19dab627d 100644 --- a/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.scss +++ b/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.scss @@ -35,6 +35,10 @@ opacity: 1; } +.full { + width: 100%; +} + .content { margin-top: 2em; } @@ -52,7 +56,8 @@ ::ng-deep .dark & button { background: $accent-dark !important; color: #303030 !important; - }/* + } + /* &:hover{ box-shadow: 0 1em 1em -0.8em #fff; transform: translateY(-0.50em); diff --git a/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.ts b/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.ts index 8ab01f665..4071c6b8f 100644 --- a/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.ts +++ b/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.ts @@ -26,6 +26,7 @@ export class UserManagementComponent implements OnInit, AfterViewInit { public availableClaims: ICheckbox[]; public bulkMovieLimit?: number; public bulkEpisodeLimit?: number; + public bulkMusicLimit?: number; public plexEnabled: boolean; constructor(private identityService: IdentityService, @@ -84,6 +85,9 @@ export class UserManagementComponent implements OnInit, AfterViewInit { if (this.bulkMovieLimit) { x.movieRequestLimit = this.bulkMovieLimit; } + if (this.bulkMusicLimit) { + x.musicRequestLimit = this.bulkMusicLimit; + } this.identityService.updateUser(x).subscribe(y => { if (!y.successful) { this.notificationService.error(`Could not update user ${x.userName}. Reason ${y.errors[0]}`); @@ -95,6 +99,7 @@ export class UserManagementComponent implements OnInit, AfterViewInit { this.showBulkEdit = false; this.bulkMovieLimit = undefined; this.bulkEpisodeLimit = undefined; + this.bulkMusicLimit = undefined; } public isAllSelected() { diff --git a/src/Ombi/ClientApp/src/tsconfig.app.json b/src/Ombi/ClientApp/src/tsconfig.app.json index 1a0bba757..aef5c882b 100644 --- a/src/Ombi/ClientApp/src/tsconfig.app.json +++ b/src/Ombi/ClientApp/src/tsconfig.app.json @@ -9,7 +9,7 @@ "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, - "target": "es5", + "target": "es2015", "types": ["node"], "resolveJsonModule":true, "allowSyntheticDefaultImports":true, diff --git a/src/Ombi/ClientApp/yarn.lock b/src/Ombi/ClientApp/yarn.lock index b80bf9ef1..113ad95c3 100644 --- a/src/Ombi/ClientApp/yarn.lock +++ b/src/Ombi/ClientApp/yarn.lock @@ -6981,15 +6981,17 @@ prepend-http@^1.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= -primeicons@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/primeicons/-/primeicons-1.0.0.tgz#90061f168ef6227f21f0a7db8204ffa85cd27aec" - integrity sha512-p/hzIjUVccW4eJPhuORHI3AUkDpqfvCQVrjxbFEejnTEdWY4C8fomVfjiaA9jCu83fSQnBHuRIGB96iAR8R6uA== +primeicons@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/primeicons/-/primeicons-4.0.0.tgz#a3594b3af213dcf8c4c3d6fc99eea05b7c92f57c" + integrity sha512-JQBIswGSItn8I0Pq21RchENpKJxSi1MjfBDfggMQpXtoKNKblJoHmol/7tCV3CAV2Dlb94ht8TD8qdIAW01pGg== -primeng@^9.0.6: - version "9.0.6" - resolved "https://registry.yarnpkg.com/primeng/-/primeng-9.0.6.tgz#b0d8350428722aaab2f5d4a65d3d06b5d4f673e0" - integrity sha512-RGVTkXwHTb7609zTU/uJFYdbJV124kOwrMiwnHjFn6UkwmS3yTX0Kkr21v8KOTJqsKLq3OWVYhkOwvUklipAAg== +primeng@^10.0.3: + version "10.0.3" + resolved "https://registry.yarnpkg.com/primeng/-/primeng-10.0.3.tgz#e9d0ea425b9c5023bc9eef2cb014941939d0c35e" + integrity sha512-Nsiwpmy3RlFPBlxabdzeAYxFn4fXEyZjj7iAi1X5J4RRGD7NoB67+NbnOInE1rXTnNVHYxCca91OvaNiHSWWrg== + dependencies: + tslib "^2.0.0" private@^0.1.8: version "0.1.8" @@ -8745,6 +8747,11 @@ tslib@^1.8.0, tslib@^1.8.1: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" +tslib@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c" + integrity sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ== + tslint-angular@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/tslint-angular/-/tslint-angular-1.1.2.tgz#5ce7020968e3b9dc7a40b6d15dadd6da34787309"