From 0af3511e819d24e0f4edf6f33931e61bba743224 Mon Sep 17 00:00:00 2001 From: Jamie Rees Date: Tue, 3 Sep 2024 16:14:16 +0100 Subject: [PATCH] fix(radarr): :bug: Enable validation on the radarr settings page --- src/Ombi/ClientApp/angular.json | 1 - .../components/carousel-list/carousel-list.component.ts | 1 - .../settings/radarr/components/radarr-form.component.html | 7 +++++++ .../settings/radarr/components/radarr-form.component.ts | 7 ++++--- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Ombi/ClientApp/angular.json b/src/Ombi/ClientApp/angular.json index 38136c921..b139c4bdb 100644 --- a/src/Ombi/ClientApp/angular.json +++ b/src/Ombi/ClientApp/angular.json @@ -105,7 +105,6 @@ "options": { "tsConfig": [ "src/tsconfig.json" - "src/tsconfig.json" ], "exclude": [ "**/node_modules/**" diff --git a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.ts b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.ts index 2aacd4bd6..36b8122ff 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.ts +++ b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.ts @@ -293,7 +293,6 @@ export class CarouselListComponent implements OnInit { } this.discoverResults.push(...tempResults); - this.carousel.ngAfterContentInit(); this.finishLoading(); } diff --git a/src/Ombi/ClientApp/src/app/settings/radarr/components/radarr-form.component.html b/src/Ombi/ClientApp/src/app/settings/radarr/components/radarr-form.component.html index 3857a22d2..8a73368c0 100644 --- a/src/Ombi/ClientApp/src/app/settings/radarr/components/radarr-form.component.html +++ b/src/Ombi/ClientApp/src/app/settings/radarr/components/radarr-form.component.html @@ -28,10 +28,12 @@ Hostname or IP + Please enter a valid hostname or ip address Port + Please enter a valid port number SSL @@ -42,6 +44,7 @@ API key + Please enter an API Key
@@ -65,6 +68,7 @@ {{quality.name}} + Please select a value
@@ -80,6 +84,7 @@ {{folder.path}} + Please select a value @@ -95,6 +100,7 @@ {{tag.label}} + Please select a value @@ -107,6 +113,7 @@ {{min.name}} + Please select a value diff --git a/src/Ombi/ClientApp/src/app/settings/radarr/components/radarr-form.component.ts b/src/Ombi/ClientApp/src/app/settings/radarr/components/radarr-form.component.ts index a4f12760f..cfa214e59 100644 --- a/src/Ombi/ClientApp/src/app/settings/radarr/components/radarr-form.component.ts +++ b/src/Ombi/ClientApp/src/app/settings/radarr/components/radarr-form.component.ts @@ -63,14 +63,14 @@ export class RadarrFormComponent implements OnInit { } public toggleValidators() { - debugger; const enabled = this.form.controls.enabled.value as boolean; this.form.controls.apiKey.setValidators(enabled ? [Validators.required] : null); - this.form.controls.defaultQualityProfile.setValidators(enabled ? [Validators.required] : null); + this.form.controls.defaultQualityProfile.setValidators(enabled ? [Validators.required, Validators.min(1)] : null); this.form.controls.defaultRootPath.setValidators(enabled ? [Validators.required] : null); this.form.controls.ip.setValidators(enabled ? [Validators.required] : null); - this.form.controls.port.setValidators(enabled ? [Validators.required] : null); + this.form.controls.port.setValidators(enabled ? [Validators.required, Validators.min(1)] : null); this.form.controls.minimumAvailability.setValidators(enabled ? [Validators.required] : null); + enabled ? this.form.markAllAsTouched() : this.form.markAsUntouched(); } public getProfiles(form: UntypedFormGroup) { @@ -120,6 +120,7 @@ export class RadarrFormComponent implements OnInit { this.notificationService.success("Successfully connected to Radarr!"); } else if (result.expectedSubDir) { this.notificationService.error("Your Radarr Base URL must be set to " + result.expectedSubDir); + form.controls.subDir.setValue(result.expectedSubDir); } else { this.notificationService.error("We could not connect to Radarr!"); }