<file_sep>export class LoginUser {
    mail : string;
    password :string;
}
<file_sep>import { Component, OnInit } from '@angular/core';
import { Task } from "../../model/task";
import { Router } from "@angular/router";
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
import { HttpServerService } from "../../service/http-server.service";
import { MatSnackBar } from "@angular/material/snack-bar";

@Component({
  selector: 'app-create-task',
  templateUrl: './create-task.component.html',
  styleUrls: ['./create-task.component.scss']
})
export class CreateTaskComponent implements OnInit {
  userTask: Task = new Task();
  taskForm: FormGroup;
  constructor(
    private formBuilder: FormBuilder,
    private router: Router,
    private http: HttpServerService,
    private snackBar: MatSnackBar,
  ) { }

  ngOnInit() {
    this.taskForm = this.formBuilder.group({
      'name': new FormControl(this.userTask.name, [Validators.required]),
      'description': new FormControl(this.userTask.description, [Validators.required])
    })
  }
  create() {
    console.log(this.userTask);
    this.http.post('createtask', this.userTask).subscribe(
      (response: any) => {
        if (response.ststusCode == 200) {
          this.snackBar.open(response.statusMessage, 'close', { duration: 3000 })
        } else {
          this.snackBar.open(response.statusMessage, 'close', { duration: 3000 })
        }
      }
    )

  }
}
<file_sep>import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LoginComponent } from "./component/login/login.component";
import { DashboardComponent } from "./component/dashboard/dashboard.component";
import { AddMemberComponent } from "./component/add-member/add-member.component";
import { ViewListComponent } from "./component/view-list/view-list.component";
import { BackgroundComponent } from "./component/background/background.component";
import { TLDashboardComponent } from "./component/tldashboard/tldashboard.component";
import { DdDashboardComponent } from "./component/dd-dashboard/dd-dashboard.component";
import { ResetPasswordComponent } from "./component/reset-password/reset-password.component";
import { CreateProjectComponent } from "./component/create-project/create-project.component";
import { ViewProjectsComponent } from "./component/view-projects/view-projects.component";
import { ViewTaskComponent } from "./component/view-task/view-task.component";
import { CreateTaskComponent } from "./component/create-task/create-task.component";
import { ViewMemberDetailComponent } from "./component/view-member-detail/view-member-detail.component";
import { ViewTlProjectComponent } from "./component/view-tl-project/view-tl-project.component";
import { AddTaskToProjectComponent } from "./component/add-task-to-project/add-task-to-project.component";
import { ViewDdTaskComponent } from "./component/view-dd-task/view-dd-task.component";
const routes: Routes = [
  { path: '', component: LoginComponent },
  {
    path: 'pmdashboard', component: DashboardComponent, children: [
      {
        path: '', component: BackgroundComponent

      }, {
        path: 'add', component: AddMemberComponent
      },
      {
        path: 'list', component: ViewListComponent
      },
      {
        path: 'create', component: CreateProjectComponent
      },
      {
        path: 'view', component: ViewProjectsComponent
      },
      {
        path: 'task', component: ViewTaskComponent
      },
      {
        path: 'createtask', component: CreateTaskComponent
      },
    ]
  },
  {
    path: 'tldashboard', component: TLDashboardComponent, children: [
      {
        path: 'list', component: ViewMemberDetailComponent
      },
      {
        path: 'viewProject', component: ViewTlProjectComponent
      },
      {
        path: 'addTask', component: AddTaskToProjectComponent
      },
    ]
  },
  {
    path: 'dddashboard', component: DdDashboardComponent, children: [
      {
        path: 'viewTask', component: ViewDdTaskComponent
      },
    ]
  },
  { path: 'reset', component: ResetPasswordComponent },

];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
<file_sep>import { Component, OnInit, Inject } from '@angular/core';
import { FormGroup, FormBuilder, FormControl, Validators } from "@angular/forms";
import { Task } from "../../model/task";
import { HttpServerService } from "../../service/http-server.service";
import { MatSnackBar } from "@angular/material/snack-bar";
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import { DataServiceService } from "src/app/service/data-service.service";

@Component({
  selector: 'app-dialog-edit-task',
  templateUrl: './dialog-edit-task.component.html',
  styleUrls: ['./dialog-edit-task.component.scss']
})
export class DialogEditTaskComponent implements OnInit {
  taskList: Task = new Task();
  addForm: FormGroup;
  message: any;
 // name : new FormControl(this.)
  constructor(
    @Inject(MAT_DIALOG_DATA) public data: any,
    private formBuilder: FormBuilder,
    private http: HttpServerService,
    private snackBar: MatSnackBar,
    private service: DataServiceService,

  ) { }

  ngOnInit() {
    this.service.currentMessage.subscribe(
      (message: any) => {
        this.message = message;
        this.taskList.name = this.data.element.name;
        this.taskList.description = this.data.element.description;

        this.addForm = this.formBuilder.group(
          {
            'name': new FormControl(this.taskList.name, [Validators.required]),
            'description': new FormControl(this.taskList.description, [Validators.required]),
          }
        )
      }
    )

  }

  updateTask() {
    this.http.put('updatetask/' + this.data.element.tid, this.taskList).subscribe(
      (response: any) => {
        if (response.statusCode == 200) {
          this.service.changeMessage(response.statusMessage);
          this.snackBar.open(response.statusMessage, 'close', { duration: 3000 });
        }else{
          this.service.changeMessage(response.statusMessage);
          this.snackBar.open(response.statusMessage, 'close', { duration: 3000 });
        }
      }
    )
  }

}
<file_sep>import { Component, OnInit } from '@angular/core';
import { Project } from "../../model/project";
import { Router } from "@angular/router";
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
import { HttpServerService } from "../../service/http-server.service";
import { MatSnackBar } from "@angular/material/snack-bar";

@Component({
  selector: 'app-create-project',
  templateUrl: './create-project.component.html',
  styleUrls: ['./create-project.component.scss']
})
export class CreateProjectComponent implements OnInit {
  userProject: Project = new Project();
  projForm: FormGroup;
  constructor(
    private formBuilder: FormBuilder,
    private router: Router,
    private http: HttpServerService,
    private snackBar: MatSnackBar,
  ) { }

  ngOnInit() {
    this.projForm = this.formBuilder.group({
      'name': new FormControl(this.userProject.name, [Validators.required]),
      'description': new FormControl(this.userProject.description, [Validators.required])
    })
  }

  create() {
    console.log(this.userProject);
    this.http.post('createProject', this.userProject).subscribe(
      (response: any) => {
        if (response.ststusCode == 200) {
          this.snackBar.open(response.statusMessage, 'close', { duration: 3000 })
        } else {
          this.snackBar.open(response.statusMessage, 'close', { duration: 3000 })
        }
      }
    )

  }

}
<file_sep>import { Component, OnInit } from '@angular/core';
import { Router } from "@angular/router";

@Component({
  selector: 'app-tldashboard',
  templateUrl: './tldashboard.component.html',
  styleUrls: ['./tldashboard.component.scss']
})
export class TLDashboardComponent implements OnInit {

  constructor(
    private router : Router ,
  ) { }

  ngOnInit() {
  }

  logout(){
    localStorage.clear();
    this.router.navigate(['/']);
  }

  reset(){
    this.router.navigate(['/reset'])
  }

}
<file_sep>import { Component, OnInit } from '@angular/core';
import { FormGroup, FormBuilder, FormControl, Validators } from "@angular/forms";
import { Router } from "@angular/router";
import { AddMember } from "../../model/add-member";
import { HttpServerService } from "../../service/http-server.service";
import { MatSnackBar } from "@angular/material/snack-bar";


@Component({
  selector: 'app-add-member',
  templateUrl: './add-member.component.html',
  styleUrls: ['./add-member.component.scss']
})
export class AddMemberComponent implements OnInit {
  member: AddMember = new AddMember();
  addForm: FormGroup;
  constructor(
    private formBuilder: FormBuilder,
    private router: Router,
    private http: HttpServerService,
    private snackBar: MatSnackBar,
  ) { }

  ngOnInit() {
    this.addForm = this.formBuilder.group(
      {
        'name': new FormControl(this.member.name, [Validators.required]),
        'desg': new FormControl(this.member.desg, [Validators.required]),
        'mobile': new FormControl(this.member.mobileNo, [Validators.required]),
        'email': new FormControl(this.member.mail, [Validators.required]),
        'password': new FormControl(<PASSWORD>, [Validators.required, Validators.minLength(6)]),

      }
    )
  }

  register() {
    console.log(this.member);
    this.http.post('register', this.member).subscribe(
      (response: any) => {
        if (response.statusCode == 200) {
          this.snackBar.open(response.statusMessage, "close", { duration: 3000 });
        } else {
          this.snackBar.open(response.statusMessage, "close", { duration: 3000 });
        }
      }
    )

  }
}
<file_sep>export class ResetPasswordModel {
    password : string;
    conformPassword : string;
}
<file_sep>import { Component, OnInit } from '@angular/core';
import { Router } from "@angular/router";
import { HttpServerService } from "../../service/http-server.service";
import { MatSnackBar } from "@angular/material/snack-bar";
import { MatDialog } from "@angular/material/dialog";

@Component({
  selector: 'app-add-task-to-project',
  templateUrl: './add-task-to-project.component.html',
  styleUrls: ['./add-task-to-project.component.scss']
})
export class AddTaskToProjectComponent implements OnInit {
  displayedColumns: string[] = ['id', 'name', 'description', 'asign task'];
  projectInfo: any;
  mail: string;
  data: any;
  taskList: any;
  constructor(
    private router: Router,
    private http: HttpServerService,
    private snackBar: MatSnackBar,
    private dialog: MatDialog,
  ) { }

  ngOnInit() {
    this.getData();
  }

  getData() {
    this.mail = localStorage.getItem('mail');
    this.http.get('getProject?mail=' + this.mail).subscribe(
      (response: any) => {
        this.projectInfo = response;
      }
    )
  }


  onClick(items) {
      this.http.put('asigntask?pid=' +this.data.pid + '&tid=' + items.tid ,null).subscribe(
        (response : any) =>{
          if(response.statusCode == 200){
            this.snackBar.open(response.statusMessage , 'close' ,{duration:3000});
          }else{
            this.snackBar.open(response.statusMessage , 'close' ,{duration:3000});
          }
        }
      )

  }



  send(element) {
    this.data = element;
    this.http.get('getalltasks').subscribe(
      (response : any) => {
        this.taskList = response;
      }
    )
  }

}
<file_sep>import { Component, OnInit } from '@angular/core';
import { HttpServerService } from "../../service/http-server.service";
import { MatSnackBar } from "@angular/material/snack-bar";
import { MatDialog } from "@angular/material/dialog";
import { DialodBoxComponent } from '../dialod-box/dialod-box.component';
import { DataServiceService } from "src/app/service/data-service.service";


@Component({
  selector: 'app-view-list',
  templateUrl: './view-list.component.html',
  styleUrls: ['./view-list.component.scss']
})
export class ViewListComponent implements OnInit {
  displayedColumns: string[] = ['id', 'name', 'mail', 'mobileNo', 'designation', 'asign project' ,'delete' , 'edit'];
  userInfo: any;
  id: number;
  projects: any;
  data: any;
  message : any;

  constructor(
    private http: HttpServerService,
    private snackBar: MatSnackBar,
    private dialog: MatDialog,
    private service : DataServiceService,
  ) { }

  ngOnInit() {
    this.service.currentMessage.subscribe(
     ( message : any)=>{
         this.message = message;
         this.getData();
      }
    )
  }

  getData() {
    this.http.get('usersinfo').subscribe(
      (response: any) => {
        this.userInfo = response;
      }
    )
  }

  edit(items) {
    this.dialog.open(DialodBoxComponent, {
      data: { items }
    });
  }
  delete(items) {
    this.http.delete("deleteUser/" + items.id).subscribe(
      (response: any) => {
        if (response.status == 200) {
          this.snackBar.open(response.statusMessage, "close", { duration: 3000 });
          this.service.changeMessage(response.statusMessage);
        }else{
          this.snackBar.open(response.statusMessage, "close", { duration: 3000 });
          this.service.changeMessage(response.statusMessage);
        }
      }
    )
  }

  // asignProjects(items) {
  //   this.dialog.open(DialogBoxAsignProjectsComponent, {
  //     data: { items }
  //   });
  // }

  getProjects(element) {
    this.data = element;
    this.http.get('getAllProjects').subscribe(
      (response: any) => {
        this.projects = response;
        console.log("hi ",this.projects);
        
      }
    )
  }

  onClick(items) {
    this.http.put('assignProject?pid=' + items.pid + '&eid=' + this.data.id, null).subscribe(
      (response: any) => {
        if (response.statusCode == 200) {
          this.snackBar.open(response.statusMessage, "close", { duration: 3000 });
          this.service.changeMessage(response.statusMessage);
        } else {
          this.snackBar.open(response.statusMessage, "close", { duration: 3000 });
          this.service.changeMessage(response.statusMessage);
        }
      }
    )
  }
}
<file_sep>export class AddMember {
    name : string;
    desg :string;
    mobileNo : string;
    mail : string;
    password :string;
}
<file_sep>import { Component, OnInit } from '@angular/core';
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
import { ResetPasswordModel } from "../../model/reset-password-model";
import { Router } from "@angular/router";
import { HttpServerService } from "../../service/http-server.service";
import { MatSnackBar } from "@angular/material/snack-bar";


@Component({
  selector: 'app-reset-password',
  templateUrl: './reset-password.component.html',
  styleUrls: ['./reset-password.component.scss']
})
export class ResetPasswordComponent implements OnInit {
  passwordModel : ResetPasswordModel = new ResetPasswordModel();
  passwordForm : FormGroup ;
  status : string;
token = localStorage.getItem('token');
  constructor(
    private formBulder :FormBuilder,
    private router: Router,
    private http: HttpServerService,
    private snackBar: MatSnackBar,
  ) { }

  ngOnInit() {
    this.passwordForm = this.formBulder.group({
      'password': new FormControl(this.passwordModel.password, [Validators.required, Validators.minLength(6)]),
      'conformPassword': new FormControl(this.passwordModel.conformPassword, [Validators.required, Validators.minLength(6)]),

    })
  }

  reset(){
    console.log(this.token);
    
    console.log(this.passwordModel);
     this.status = localStorage.getItem('code');
     if(this.passwordModel.password == this.passwordModel.conformPassword){
        this.http.putWithToken('resetpassword' , this.passwordModel).subscribe(
          (response: any) =>{
            if(response.statusCode == 205){
              console.log("hi");
              if(this.status == '201' || this.status == '204'){
                this.snackBar.open(response.statusMessage, 'close', { duration: 3000 });
                this.router.navigate(['/dddashboard']);
              }else if (this.status == '202') {
                this.snackBar.open(response.statusMessage, 'close', { duration: 3000 });
                this.router.navigate(['/tldashboard']);
              }else if (this.status == '203') {
                this.snackBar.open(response.statusMessage, 'close', { duration: 3000 });
                this.router.navigate(['/pmdashboard']);
              }else {
                console.log(response);
                this.snackBar.open(response.statusMessage, 'close', { duration: 3000 });
              }
            }
          }
        )
     }
  }
  skip(){
    this.status = localStorage.getItem('code');
    if(this.status == '201' || this.status == '204'){
      this.router.navigate(['/dddashboard']);
    }else if (this.status == '202') {
      this.router.navigate(['/tldashboard']);
    }else if (this.status == '203') {
      this.router.navigate(['/pmdashboard']);
    }else {
      this.snackBar.open(" sorry spik is failed ", 'close', { duration: 3000 });
    }
  }

}
<file_sep>import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { DdDashboardComponent } from './dd-dashboard.component';

describe('DdDashboardComponent', () => {
  let component: DdDashboardComponent;
  let fixture: ComponentFixture<DdDashboardComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ DdDashboardComponent ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(DdDashboardComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
});
<file_sep>import { Component, OnInit } from '@angular/core';
import { Router } from "@angular/router";
import { HttpServerService } from "../../service/http-server.service";
import { MatSnackBar } from "@angular/material/snack-bar";
import { MatDialog } from "@angular/material/dialog";
import { DialogEditTaskComponent } from '../dialog-edit-task/dialog-edit-task.component';

@Component({
  selector: 'app-view-tl-project',
  templateUrl: './view-tl-project.component.html',
  styleUrls: ['./view-tl-project.component.scss']
})
export class ViewTlProjectComponent implements OnInit {
  projectList: any;
  mail: string;
  taskList: any;
  project : any ;
  displayedColumns: string[] = ['id', 'name', 'description','edit' , 'delete'];

  constructor(
    private router: Router,
    private http: HttpServerService,
    private snackBar: MatSnackBar,
    private dialog : MatDialog,

  ) { }

  ngOnInit() {
    this.getData();
  }

  getData() {
    this.mail = localStorage.getItem('mail');
    this.http.get('getProject?mail=' + this.mail).subscribe(
      (response: any) => {
        console.log(" hellow ", response);
        this.projectList = response;
      }
    )
  }

  getProjectTask(items){
    this.project = items;
    this.http.get('getProjectTask?pid='+items.pid).subscribe(
      (response : any) =>{
        this.taskList = response;
      }
    )
  }

  editTask(element){
    this.dialog.open(DialogEditTaskComponent ,{
      data : {element}
    });
  }

  deleteTask(element){
    this.http.delete('removeTaskfromProj?pid='+this.project.pid+'&tid='+element.tid).subscribe(
      (response : any) =>{
        this.snackBar.open(response.statusMessage , 'close' ,{duration : 3000});
      }
    )
  }
}
<file_sep>import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { ViewMemberDetailComponent } from './view-member-detail.component';

describe('ViewMemberDetailComponent', () => {
  let component: ViewMemberDetailComponent;
  let fixture: ComponentFixture<ViewMemberDetailComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ ViewMemberDetailComponent ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(ViewMemberDetailComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
});
<file_sep>import { Component, OnInit } from '@angular/core';
import { Router } from "@angular/router";
@Component({
  selector: 'app-dd-dashboard',
  templateUrl: './dd-dashboard.component.html',
  styleUrls: ['./dd-dashboard.component.scss']
})
export class DdDashboardComponent implements OnInit {

  constructor(
    private router : Router,
  ) { }

  ngOnInit() {
  }

  logout(){
    localStorage.clear();
    this.router.navigate(['/']);
  }

  reset(){
    this.router.navigate(['/reset'])
  }
}
<file_sep>import { Component, OnInit } from '@angular/core';
import { HttpServerService } from "../../service/http-server.service";
import { MatSnackBar } from "@angular/material";
import { DataServiceService } from "../../service/data-service.service";
@Component({
  selector: 'app-view-member-detail',
  templateUrl: './view-member-detail.component.html',
  styleUrls: ['./view-member-detail.component.scss']
})
export class ViewMemberDetailComponent implements OnInit {
  userInfo: any;
  mail: string;
  userData: any;
  data: any;
  taskList: any;
  projectList: any;
  project: any;
  message:string;
  displayedColumns: string[] = ['id', 'name', 'mail', 'mobileNo', 'designation', 'asign task'];
  constructor(
    private http: HttpServerService,
    private snackBar: MatSnackBar,
    private service :DataServiceService,
  ) { }

  ngOnInit() {
    this.getData();
    this.service.currentMessage.subscribe(message => this.message = message);

  }

  getUsers(items) {
    this.project = items;
    this.mail = localStorage.getItem('mail');
    this.http.get('getOneProjects?pid='+items.pid).subscribe(
      (response: any) => {

        this.userInfo = response.userModel;
        console.log(" usdser ", this.userInfo);
        
        // for (let index = 0; index < this.userInfo.length; index++) {
        //   const element = this.userInfo[index];
        //   this.userData = element.userModel

        // }
      }
    )
  }

  // getTask(element) {
  //   this.data = element;
  //   this.http.get('getalltasks').subscribe(
  //     (response: any) => {
  //       this.taskList = response;
  //     }
  //   )
  // }

  onClick(items) {
    this.http.put('asigntaskToUser?eid=' + this.data.id + '&tid=' + items.tid, null).subscribe(
      (response: any) => {
        if (response.statusCode == 200) {
          this.snackBar.open(response.statusMessage, 'close', { duration: 3000 });
        } else {
          this.snackBar.open(response.statusMessage, 'close', { duration: 3000 });
        }
      }
    )
  }

  getData() {
    this.mail = localStorage.getItem('mail');
    this.http.get('getProject?mail=' + this.mail).subscribe(
      (response: any) => {
        console.log(" hellow ", response);
        this.projectList = response;
      }
    )
  }

  getProjectTask(element) {
    this.data = element;
    this.http.get('getProjectTask?pid=' + this.project.pid).subscribe(
      (response: any) => {
        this.taskList = response;
      }
    )
  }
  onEvent(event) {
    event.stopPropagation();
  }
}
<file_sep>import { ResetPasswordModel } from './reset-password-model';

describe('ResetPasswordModel', () => {
  it('should create an instance', () => {
    expect(new ResetPasswordModel()).toBeTruthy();
  });
});
<file_sep>import { Component, OnInit } from '@angular/core';
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
import { LoginUser } from "../../model/login-user";
import { Router } from "@angular/router";
import { HttpServerService } from "../../service/http-server.service";
import { MatSnackBar } from "@angular/material/snack-bar";

@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.scss']
})
export class LoginComponent implements OnInit {
  user: LoginUser = new LoginUser();
  loginForm: FormGroup;
  token: string;
  constructor(
    private formBuilder: FormBuilder,
    private router: Router,
    private http: HttpServerService,
    private snackBar: MatSnackBar,
  ) { }

  ngOnInit() {
    this.loginForm = this.formBuilder.group(
      {
        'mail': new FormControl(this.user.mail, [Validators.required]),
        'password': new FormControl(this.user.password, [Validators.required, Validators.minLength(6)]),
      }
    )
  }

  navigate() {
    console.log(this.user.mail);
    console.log(this.user.password);
    console.log(this.user)
    this.token = localStorage.getItem('token');
    this.http.post('login', this.user).subscribe(
      (response: any) => {
        if (response.statusCode == 201 || response.statusCode == 204) {
          localStorage.setItem('mail', this.user.mail);
          localStorage.setItem('password', <PASSWORD>);
          localStorage.setItem('token', response.token);
          localStorage.setItem('code', response.statusCode);
          this.snackBar.open(response.statusMessage, 'close', { duration: 3000 });
          this.router.navigate(['/dddashboard']);

        } else if (response.statusCode == 202) {
          localStorage.setItem('mail', this.user.mail);
          localStorage.setItem('password', <PASSWORD>);
          localStorage.setItem('token', response.token);
          localStorage.setItem('code', response.statusCode);
          this.snackBar.open(response.statusMessage, 'close', { duration: 3000 });
          this.router.navigate(['/tldashboard']);
        } else if (response.statusCode == 203) {
          localStorage.setItem('mail', this.user.mail);
          localStorage.setItem('password', <PASSWORD>);
          localStorage.setItem('token', response.token);
          localStorage.setItem('code', response.statusCode);
          this.snackBar.open(response.statusMessage, 'close', { duration: 3000 });
          this.router.navigate(['/pmdashboard']);
        } else {
          console.log(response);
          this.snackBar.open(response.statusMessage, 'close', { duration: 3000 });

        }
      }
    )
  }

}
<file_sep>import { AddMember } from './add-member';

describe('AddMember', () => {
  it('should create an instance', () => {
    expect(new AddMember()).toBeTruthy();
  });
});
<file_sep>import { Component, OnInit } from '@angular/core';
import { HttpServerService } from "../../service/http-server.service";
import { MatSnackBar } from "@angular/material/snack-bar";
import { DataServiceService } from "../../service/data-service.service";

@Component({
  selector: 'app-view-dd-task',
  templateUrl: './view-dd-task.component.html',
  styleUrls: ['./view-dd-task.component.scss']
})
export class ViewDdTaskComponent implements OnInit {

  taskList: any;
  displayedColumns: string[] = ['id', 'name', 'status', 'Description', 'change status'];
  mail: string;
  message: string;
  constructor(
    private http: HttpServerService,
    private snackBar: MatSnackBar,
    private data: DataServiceService,
  ) { }

  ngOnInit() {
    this.data.currentMessage.subscribe(
      message => {
        this.message = message;
        this.getTask();
      })
  }

  getTask() {
    this.mail = localStorage.getItem('mail');
    this.http.get('getUserTask?mail=' + this.mail).subscribe(
      (response: any) => {
        this.taskList = response;
      }
    )
  }

  onClick(element) {
    this.http.put('changeStatus?tid=' + element.tid, null).subscribe(
      (response: any) => {
        if (response.statusCode == 200) {
          this.snackBar.open(response.statusMessage, 'close', { duration: 3000 });
          this.data.changeMessage(response.statusMessage);
        } else {
          this.snackBar.open(response.statusMessage, 'close', { duration: 3000 });
          this.data.changeMessage(response.statusMessage);
        }
      }
    )
  }
}
<file_sep>import { Component, OnInit } from '@angular/core';
import { HttpServerService } from "../../service/http-server.service";
import { MatSnackBar } from "@angular/material/snack-bar";
import { MatDialog } from "@angular/material/dialog";
import { DialogEditTaskComponent } from '../dialog-edit-task/dialog-edit-task.component';

@Component({
  selector: 'app-view-projects',
  templateUrl: './view-projects.component.html',
  styleUrls: ['./view-projects.component.scss']
})
export class ViewProjectsComponent implements OnInit {
   projectList : any; 
   taskList : any ;
   displayedColumns: string[] = ['id', 'name', 'description','edit' , 'delete'];
   project : any ;

  constructor(
    private http: HttpServerService,
    private snackBar: MatSnackBar,
    private dialog : MatDialog,
  ) { }

  ngOnInit() {
    this.getProjects();
    
  }

  getProjects(){
     this.http.get('getAllProjects').subscribe(
       (response : any) =>{
         this.projectList = response;
       }
     )
  }
  editTask(element){
    this.dialog.open(DialogEditTaskComponent ,{
      data : {element}
    });
  }

  deleteTask(element){
    this.http.delete('removeTaskfromProj?pid='+this.project.pid+'&tid='+element.tid).subscribe(
      (response : any) =>{
        this.snackBar.open(response.statusMessage , 'close' ,{duration : 3000});
      }
    )
  }

  getProjectTask(items){
    this.project = items ;
    this.http.get('getProjectTask?pid='+items.pid).subscribe(
      (response : any) =>{
        this.taskList = response;
      }
    )
  }
}
<file_sep>import { Component, OnInit } from '@angular/core';
import { HttpServerService } from "../../service/http-server.service";
import { MatSnackBar } from "@angular/material/snack-bar";
import { MatDialog } from "@angular/material/dialog";
import { DialogEditTaskComponent } from '../dialog-edit-task/dialog-edit-task.component';
import { DataServiceService } from "src/app/service/data-service.service";

@Component({
  selector: 'app-view-task',
  templateUrl: './view-task.component.html',
  styleUrls: ['./view-task.component.scss']
})
export class ViewTaskComponent implements OnInit {
  taskList: any;
  displayedColumns: string[] = ['id', 'name', 'Description', 'asignTaskToProj', 'edit', 'delete'];
  projects: any;
  data: any;
  message : any;


  constructor(
    private http: HttpServerService,
    private snackBar: MatSnackBar,
    private dialog: MatDialog,
    private service : DataServiceService,

  ) { }

  ngOnInit() {
    this.service.currentMessage.subscribe(
      ( message : any)=>{
          this.message = message;
          this.getTask();
       }
     )
    
  }

  getTask() {
    this.http.get('getalltasks').subscribe(
      (response: any) => {
        this.taskList = response;
      }
    )
  }

  editTask(element) {
    this.dialog.open(DialogEditTaskComponent, {
      data: { element }
    });
  }

  deleteTask(element) {
    console.log(element);

    this.http.delete('deletetask/' + element.tid).subscribe(
      (response: any) => {
        this.snackBar.open(response.statusMessage, 'close', { duration: 3000 });
        this.service.changeMessage(response.statusMessage);
      }
    )
  }


  asignTask(element) {
    this.data = element;
    this.http.get('getAllProjects').subscribe(
      (response: any) => {
        this.projects = response;
      }
    )
  }
  onClick(items) {
    this.http.put('asigntask?pid=' +items.pid + '&tid=' + this.data.tid,null).subscribe(
      (response : any)=>{
        if(response.statusCode == 200){
          this.snackBar.open(response.statusMessage, 'close', { duration: 3000 });
          this.service.changeMessage(response.statusMessage);
        }else{
          this.snackBar.open(response.statusMessage, 'close', { duration: 3000 });
          this.service.changeMessage(response.statusMessage);
        }
      }
    )
  }

}
<file_sep>import { Component, OnInit ,Inject} from '@angular/core';
import { FormGroup, FormBuilder, FormControl, Validators } from "@angular/forms";
import { Router } from "@angular/router";
import { Project } from "../../model/project";
import { HttpServerService } from "../../service/http-server.service";
import { MatSnackBar } from "@angular/material/snack-bar";
import { MAT_DIALOG_DATA} from '@angular/material/dialog';
@Component({
  selector: 'app-dialog-edit-projects',
  templateUrl: './dialog-edit-projects.component.html',
  styleUrls: ['./dialog-edit-projects.component.scss']
})
export class DialogEditProjectsComponent implements OnInit {
  project : Project = new Project();
  addForm : FormGroup;
  constructor(
    @Inject(MAT_DIALOG_DATA) public data : any,
    private formBuilder: FormBuilder,
    private router: Router,
    private http: HttpServerService,
    private snackBar: MatSnackBar,
  ) { }

  ngOnInit() {
    this.addForm = this.formBuilder.group(
      {
        'name': new FormControl(this.project.name, [Validators.required]),
        'description': new FormControl(this.project.description, [Validators.required]),
      }
    )
  }

  updateProject(){
    this.http.put('updateProj/'+this.data.items.pid,this.project).subscribe(
      (response : any) =>{
        if(response.statusCode == 200){
          this.snackBar.open(response.statusMessage , 'close' ,{duration :3000});
        }
      }
    )
  }
}
<file_sep>import { BrowserModule } from '@angular/platform-browser';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { LoginComponent } from './component/login/login.component';
import { FlexLayoutModule } from "@angular/flex-layout";
import { MatCardModule } from '@angular/material/card';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ReactiveFormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import {
  MatIconModule, MatButtonModule, MatInputModule, MatToolbarModule,
  MatSidenavModule, MatListModule, MatDividerModule, MatExpansionModule,
  MatTableModule
} from '@angular/material';
import { DashboardComponent } from './component/dashboard/dashboard.component';
import { AddMemberComponent } from './component/add-member/add-member.component';
import { ViewListComponent } from './component/view-list/view-list.component';
import { BackgroundComponent } from './component/background/background.component';
import { TLDashboardComponent } from './component/tldashboard/tldashboard.component';
import { DdDashboardComponent } from './component/dd-dashboard/dd-dashboard.component';
import { HttpClientModule } from '@angular/common/http';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { ResetPasswordComponent } from './component/reset-password/reset-password.component';
import { CreateProjectComponent } from './component/create-project/create-project.component';
import { ViewProjectsComponent } from './component/view-projects/view-projects.component';
import { ViewTaskComponent } from './component/view-task/view-task.component';
import { MatDialogModule } from '@angular/material/dialog';
import { DialodBoxComponent } from './component/dialod-box/dialod-box.component';
import { DialogEditProjectsComponent } from './component/dialog-edit-projects/dialog-edit-projects.component';
import { DialogEditTaskComponent } from './component/dialog-edit-task/dialog-edit-task.component';
import { CreateTaskComponent } from './component/create-task/create-task.component';
import { ViewMemberDetailComponent } from './component/view-member-detail/view-member-detail.component';
import { ViewTlProjectComponent } from './component/view-tl-project/view-tl-project.component';
import { AddTaskToProjectComponent } from './component/add-task-to-project/add-task-to-project.component';
import {MatMenuModule} from '@angular/material/menu';
import { ViewDdTaskComponent } from "./component/view-dd-task/view-dd-task.component";

@NgModule({
  declarations: [
    AppComponent,
    LoginComponent,
    DashboardComponent,
    AddMemberComponent,
    ViewListComponent,
    BackgroundComponent,
    TLDashboardComponent,
    DdDashboardComponent,
    ResetPasswordComponent,
    CreateProjectComponent,
    ViewProjectsComponent,
    ViewTaskComponent,
    DialodBoxComponent,
    DialogEditProjectsComponent,
    DialogEditTaskComponent,
    CreateTaskComponent,
    ViewMemberDetailComponent,
    ViewTlProjectComponent,
    AddTaskToProjectComponent,
    ViewDdTaskComponent,
  ],
  entryComponents: [DialodBoxComponent,
    DialogEditProjectsComponent,
    DialogEditTaskComponent,
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    HttpClientModule,
    FlexLayoutModule,
    MatCardModule,
    BrowserAnimationsModule,
    ReactiveFormsModule,
    MatFormFieldModule,
    MatIconModule,
    MatToolbarModule,
    MatButtonModule,
    MatInputModule,
    MatSidenavModule,
    MatListModule,
    MatDividerModule,
    MatSnackBarModule,
    MatExpansionModule,
    MatDialogModule,
    MatTableModule,
    MatMenuModule,
  ],
  providers: [],
  bootstrap: [AppComponent],
  schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule { }
<file_sep>import { Component, OnInit ,Inject } from '@angular/core';
import { FormGroup, FormBuilder, FormControl, Validators } from "@angular/forms";
import { AddMember } from "../../model/add-member";
import { HttpServerService } from "../../service/http-server.service";
import { MatSnackBar } from "@angular/material/snack-bar";
import { MAT_DIALOG_DATA} from '@angular/material/dialog';
import { DataServiceService } from "src/app/service/data-service.service";


@Component({
  selector: 'app-dialod-box',
  templateUrl: './dialod-box.component.html',
  styleUrls: ['./dialod-box.component.scss']
})
export class DialodBoxComponent implements OnInit {

  member: AddMember = new AddMember();
  addForm: FormGroup;
  message : any;

  constructor(
    @Inject(MAT_DIALOG_DATA) public data : any,
    private formBuilder: FormBuilder,
    private http: HttpServerService,
    private snackBar: MatSnackBar,
    private service : DataServiceService,
  ) { }

  ngOnInit() {
    this.service.currentMessage.subscribe(
      ( message : any)=>{
          this.message = message;
          this.addForm = this.formBuilder.group(
            {
              'name': new FormControl(this.member.name, [Validators.required]),
              'desg': new FormControl(this.member.desg, [Validators.required]),
              'mobile': new FormControl(this.member.mobileNo, [Validators.required]),
            }
          )
       }
     )
  
  }

  update() {
    console.log(this.member);
    this.http.put('updateUser/'+this.data.items.id, this.member).subscribe(
      (response: any) => {
        if (response.statusCode == 200) {
          this.snackBar.open(response.statusMessage, "close", { duration: 3000 });
          this.service.changeMessage(response.statusMessage);

        } else {
          this.snackBar.open(response.statusMessage, "close", { duration: 3000 });
          this.service.changeMessage(response.statusMessage);

        }
      }
    )

  }

}
