Created
October 8, 2018 07:06
-
-
Save LironHazan/43dc3780b4a57ae2deca05e775c6377b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Component, Inject, OnInit} from '@angular/core'; | |
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material"; | |
import {SelectedValueModel} from "../../incident.model"; | |
import {UsersShareService} from "../../../../../services/store/users-share.service"; | |
import {Subscription} from "rxjs/internal/Subscription"; | |
import {IncidentService} from "../../incident.service"; | |
@Component({ | |
selector: 'app-more-info-dialog', | |
styleUrls: ['./more-info-dialog.component.scss'], | |
templateUrl: './more-info-dialog.component.html' | |
}) | |
export class MoreInfoDialogComponent implements OnInit { | |
public users: SelectedValueModel[]; | |
private assignedToSubscription: Subscription; | |
private editableFields; | |
constructor(@Inject(MAT_DIALOG_DATA) public data, | |
private usersShareService: UsersShareService, | |
private incidentService: IncidentService, | |
private dialogRef: MatDialogRef<MoreInfoDialogComponent>) { } | |
ngOnInit() { | |
this.assignedToSubscription = this.usersShareService.getUsers() | |
.subscribe(users => { | |
this.users = this.incidentService.transformUsersToAssignees(users); | |
this.editableFields = {email: this.data.data.email, poc: this.data.data.contactPerson}; | |
}, err => console.log(err)); | |
} | |
onSave() { | |
this.dialogRef.close(this.editableFields); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment