Skip to content

Commit

Permalink
fix(4616): 🐛 fixed mandatory fields
Browse files Browse the repository at this point in the history
  • Loading branch information
tidusjar committed Apr 24, 2022
1 parent 1027fcf commit d8f2260
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand All @@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
16 changes: 15 additions & 1 deletion src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.ts
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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()
Expand Down Expand Up @@ -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();
}))
}
});

}


Expand Down

0 comments on commit d8f2260

Please sign in to comment.