diff --git a/src/Ombi/ClientApp/app/usermanagement/addplexuser.component.html b/src/Ombi/ClientApp/app/usermanagement/addplexuser.component.html deleted file mode 100644 index 5f56ee710..000000000 --- a/src/Ombi/ClientApp/app/usermanagement/addplexuser.component.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/Ombi/ClientApp/app/usermanagement/addplexuser.component.ts b/src/Ombi/ClientApp/app/usermanagement/addplexuser.component.ts deleted file mode 100644 index 1c77a0181..000000000 --- a/src/Ombi/ClientApp/app/usermanagement/addplexuser.component.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { Component, Input, OnInit } from "@angular/core"; -import { FormBuilder, FormGroup, Validators } from "@angular/forms"; -import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap"; - -import { NotificationService, PlexService } from "../services"; - -import { IPlexSection, IPlexServersAdd } from "../interfaces"; - -@Component({ - selector: "ngbd-modal-content", - templateUrl: "./addplexuser.component.html", -}) -export class AddPlexUserComponent implements OnInit { - - @Input() public name: string; - - public plexServers: IPlexServersAdd[]; - public plexLibs: IPlexSection[]; - - public libsSelected: number[] = []; - - public form: FormGroup; - - constructor(public activeModal: NgbActiveModal, - private plexService: PlexService, - private notificationService: NotificationService, - private fb: FormBuilder) { - } - - public ngOnInit(): void { - this.form = this.fb.group({ - selectedServer: [null, Validators.required], - allLibsSelected: [true], - username:[null, Validators.required], - }); - this.getServers(); - } - - public getServers() { - this.plexService.getServersFromSettings().subscribe(x => { - if (x.success) { - this.plexServers = x.servers; - } - }); - } - - public getPlexLibs(machineId: string) { - this.plexService.getLibrariesFromSettings(machineId).subscribe(x => { - if (x.successful) { - this.plexLibs = x.data; - } - }); - } - - public selected() { - this.getPlexLibs(this.form.value.selectedServer); - } - - public checkedLib(checked: boolean, value: number) { - if(checked) { - this.libsSelected.push(value); - } else { - this.libsSelected = this.libsSelected.filter(v => v !== value); - } - } - - public onSubmit(form: FormGroup) { - if (form.invalid) { - this.notificationService.error("Please check your entered values"); - return; - } - const libs = form.value.allLibsSelected ? [] : this.libsSelected; - - this.plexService.addUserToServer({ username: form.value.username, machineIdentifier: form.value.selectedServer, libsSelected: libs }).subscribe(x => { - if (x.success) { - this.notificationService.success("User added to Plex"); - } else { - this.notificationService.error(x.error); - } - this.activeModal.close(); - }); - - } -} diff --git a/src/Ombi/ClientApp/app/usermanagement/usermanagement.component.html b/src/Ombi/ClientApp/app/usermanagement/usermanagement.component.html index b8a89c2b3..5040e53a9 100644 --- a/src/Ombi/ClientApp/app/usermanagement/usermanagement.component.html +++ b/src/Ombi/ClientApp/app/usermanagement/usermanagement.component.html @@ -5,9 +5,7 @@ -
- -
+ diff --git a/src/Ombi/ClientApp/app/usermanagement/usermanagement.component.ts b/src/Ombi/ClientApp/app/usermanagement/usermanagement.component.ts index 082a6086c..98ec35081 100644 --- a/src/Ombi/ClientApp/app/usermanagement/usermanagement.component.ts +++ b/src/Ombi/ClientApp/app/usermanagement/usermanagement.component.ts @@ -1,9 +1,7 @@ import { Component, OnInit } from "@angular/core"; -import { NgbModal } from "@ng-bootstrap/ng-bootstrap"; import { ICheckbox, ICustomizationSettings, IEmailNotificationSettings, IUser } from "../interfaces"; import { IdentityService, NotificationService, SettingsService } from "../services"; -import { AddPlexUserComponent } from "./addplexuser.component"; @Component({ templateUrl: "./usermanagement.component.html", @@ -27,8 +25,7 @@ export class UserManagementComponent implements OnInit { constructor(private identityService: IdentityService, private settingsService: SettingsService, private notificationService: NotificationService, - private plexSettings: SettingsService, - private modalService: NgbModal) { } + private plexSettings: SettingsService) { } public ngOnInit() { this.users = []; @@ -43,11 +40,6 @@ export class UserManagementComponent implements OnInit { this.settingsService.getEmailNotificationSettings().subscribe(x => this.emailSettings = x); } - public open() { - const modalRef = this.modalService.open(AddPlexUserComponent, {container:"ombi", backdropClass:"custom-modal-backdrop", windowClass:"window"}); - modalRef.componentInstance.name = "World"; - } - public welcomeEmail(user: IUser) { if (!user.emailAddress) { this.notificationService.error("The user needs an email address.");