Merge pull request #4621 from Ombi-app/bug/radarr-settings

fix(#4616): 🐛 fixed mandatory fields
pull/4623/head
Jamie 3 years ago committed by GitHub
commit 803a34d922
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -84,7 +84,7 @@
<th mat-header-cell *matHeaderCellDef> </th>
<td mat-cell *matCellDef="let element">
<a id="detailsButton{{element.id}}" mat-raised-button color="accent" [routerLink]="'/details/movie/' + element.theMovieDbId">{{ 'Requests.Details' | translate}}</a>
<button id="optionsButton{{element.id}}" mat-raised-button color="warn" (click)="openOptions(element)" *ngIf="isAdmin || ( manageOwnRequests && element.requestedUser?.userName == userName ) "> {{ 'Requests.Options' | translate}}</button>
<a id="optionsButton{{element.id}}" mat-raised-button color="warn" (click)="openOptions(element)" *ngIf="isAdmin || ( manageOwnRequests && element.requestedUser?.userName == userName ) "> {{ 'Requests.Options' | translate}}</a>
</td>
</ng-container>
@ -103,4 +103,4 @@
<button id="denyFabButton" mat-menu-item (click)="bulkDeny()">{{'Requests.RequestPanel.Deny' | translate}}</button>
<button *ngIf="is4kEnabled" id="deny4kFabButton" mat-menu-item (click)="bulkDeny4K()">{{'Requests.RequestPanel.Deny4K' | translate}}</button>
<button id="deleteFabButton" mat-menu-item (click)="bulkDelete()">{{'Requests.RequestPanel.Delete' | translate}}</button>
</mat-menu>
</mat-menu>

@ -9,7 +9,7 @@ import { TesterService, NotificationService, RadarrService } from "../../../serv
selector: "ombi-settings-radarr-form",
templateUrl: "./radarr-form.component.html",
styleUrls: ["./radarr-form.component.scss"],
// changeDetection: ChangeDetectionStrategy.OnPush
changeDetection: ChangeDetectionStrategy.OnPush
})
export class RadarrFormComponent implements OnInit {
@ -23,11 +23,11 @@ export class RadarrFormComponent implements OnInit {
constructor(private radarrService: RadarrService,
private notificationService: NotificationService,
private testerService: TesterService,
private controlContainer: ControlContainer) { }
private controlContainer: ControlContainer) {
}
public ngOnInit() {
this.form = <FormGroup>this.controlContainer.control;
// this.toggleValidators();
this.qualities = [];
this.qualities.push({ name: "Please Select", id: -1 });

@ -8,11 +8,13 @@
<mat-tab-group dynamicHeight>
<mat-tab label="Radarr">
<ombi-settings-radarr-form
#normalForm
formGroupName="radarr">
</ombi-settings-radarr-form>
</mat-tab>
<mat-tab *ngIf="is4kEnabled" label="Radarr 4K">
<ombi-settings-radarr-form
#4kForm
formGroupName="radarr4K">
</ombi-settings-radarr-form>
</mat-tab>

@ -1,9 +1,10 @@
import { Component, OnInit } from "@angular/core";
import { Component, OnInit, QueryList, ViewChild, ViewChildren } from "@angular/core";
import { FormBuilder, FormGroup } from "@angular/forms";
import { IMinimumAvailability, IRadarrCombined, IRadarrProfile, IRadarrRootFolder } from "../../interfaces";
import { NotificationService, SettingsService } from "../../services";
import { FeaturesFacade } from "../../state/features/features.facade";
import { RadarrFormComponent } from "./components/radarr-form.component";
@Component({
templateUrl: "./radarr.component.html",
@ -19,11 +20,15 @@ export class RadarrComponent implements OnInit {
public form: FormGroup;
public is4kEnabled: boolean = false;
@ViewChildren('4kForm') public form4k: QueryList<RadarrFormComponent>;
@ViewChildren('normalForm') public normalForm: QueryList<RadarrFormComponent>;
constructor(private settingsService: SettingsService,
private notificationService: NotificationService,
private featureFacade: FeaturesFacade,
private fb: FormBuilder) { }
public ngOnInit() {
this.is4kEnabled = this.featureFacade.is4kEnabled();
this.settingsService.getRadarr()
@ -56,7 +61,16 @@ export class RadarrComponent implements OnInit {
scanForAvailability: [x.radarr4K.scanForAvailability]
}),
});
this.normalForm.changes.forEach((comp => {
comp.first.toggleValidators();
}))
if (this.is4kEnabled) {
this.form4k.changes.forEach((comp => {
comp.first.toggleValidators();
}))
}
});
}

Loading…
Cancel
Save