2 * ========================LICENSE_START=================================
5 * Copyright (C) 2019 AT&T Intellectual Property and Nokia
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ========================LICENSE_END===================================
21 import { Component, Inject, OnInit } from '@angular/core';
22 import { FormControl, FormGroup, Validators } from '@angular/forms';
23 import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
24 import { DashboardService } from '../../services/dashboard/dashboard.service';
25 import { ErrorDialogService } from '../../services/ui/error-dialog.service';
29 selector: 'edit-app-dashboard-user-dialog',
30 templateUrl: './edit-dashboard-user-dialog.component.html',
31 styleUrls: ['./edit-dashboard-user-dialog.component.scss']
33 export class EditDashboardUserDialogComponent implements OnInit {
35 public editUserDialogForm: FormGroup;
38 @Inject(MAT_DIALOG_DATA) public data,
39 private dialogRef: MatDialogRef<EditDashboardUserDialogComponent>,
40 private dashSvc: DashboardService,
41 private errorService: ErrorDialogService) { }
44 this.editUserDialogForm = new FormGroup({
45 firstName: new FormControl(this.data.firstName , [Validators.required]),
46 lastName: new FormControl(this.data.lastName, [Validators.required]),
47 status: new FormControl(this.data.status, [Validators.required])
52 this.dialogRef.close(false);
55 public editUser = (FormValue) => {
56 if (this.editUserDialogForm.valid) {
57 // send the request to backend when it's ready
58 const aboutError = 'Not implemented yet';
59 this.errorService.displayError(aboutError);