57 lines
1.4 KiB
TypeScript
57 lines
1.4 KiB
TypeScript
import { Component, Inject, OnInit } from '@angular/core';
|
|
import { FormBuilder, FormGroup, UntypedFormGroup, Validators } from '@angular/forms';
|
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
|
|
|
@Component({
|
|
selector: 'app-add-account-dialog-component',
|
|
templateUrl: 'add-account-dialog.component.html',
|
|
styleUrls: ['./add-account-dialog.component.scss'],
|
|
})
|
|
export class AddAccountDialogComponent implements OnInit {
|
|
|
|
//TODO: refactor
|
|
datasetProfileDefinitionModel: any;
|
|
datasetProfileDefinitionFormGroup: UntypedFormGroup;
|
|
progressIndication = false;
|
|
form: FormGroup;
|
|
// public hasEmail = true;
|
|
//TODO: refactor
|
|
// private request: any;
|
|
|
|
constructor(
|
|
private formBuilder: FormBuilder,
|
|
public dialogRef: MatDialogRef<AddAccountDialogComponent>,
|
|
@Inject(MAT_DIALOG_DATA) public data: any
|
|
) { }
|
|
|
|
ngOnInit(): void {
|
|
this.form = this.formBuilder.group({
|
|
email: [this.data.email, [Validators.required, Validators.email]]
|
|
});
|
|
|
|
//TODO refactor
|
|
// this.mergeLoginService.getObservable().subscribe(result => {
|
|
// if (result !== undefined) {
|
|
// if (!(result.email !== undefined && result.email !== null)) {
|
|
// this.request = result;
|
|
// this.hasEmail = false;
|
|
// } else {
|
|
// this.dialogRef.close(result);
|
|
// }
|
|
// }
|
|
// });
|
|
}
|
|
|
|
add(): void {
|
|
this.closeDialog(this.form.value);
|
|
}
|
|
|
|
cancel(): void {
|
|
this.closeDialog();
|
|
}
|
|
|
|
closeDialog(data?: any): void {
|
|
this.dialogRef.close(data);
|
|
}
|
|
}
|