-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from AMOSTeam1/alla-changes
Alla's changes
- Loading branch information
Showing
16 changed files
with
196 additions
and
69 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
67 changes: 64 additions & 3 deletions
67
nfafrontend/src/app/current-project/project-edit/project-edit.component.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,64 @@ | ||
<p> | ||
project-edit works! | ||
</p> | ||
<div class="row"> | ||
<div class="col-xs-12" style="text-align: center"> | ||
<span class="label label-default">Edit Project</span> | ||
</div> | ||
</div> | ||
<hr> | ||
<div class ="div1"> | ||
<form (ngSubmit) = "onUpdateProject()"> | ||
<label>Customer name</label> | ||
<input type="text" | ||
class="txt" | ||
name="customerName" | ||
style="float:right" | ||
[(ngModel)]="project.customerName"> | ||
<br><br> | ||
<label>Contact person for customer</label> | ||
<input type="text" | ||
class="txt" | ||
name="contactPersCustomer" | ||
style="float:right" | ||
[(ngModel)]="project.contactPersCustomer"> | ||
<br><br> | ||
<label>Contact person for msg</label> | ||
<input type="text" | ||
class="txt" | ||
name="contactPersMsg" | ||
style="float:right" | ||
[(ngModel)]="project.contactPersMsg"> | ||
<br><br> | ||
|
||
<label>Branch</label> | ||
<select name="branch" style="float:right" [(ngModel)]="project.branch"> | ||
<option value="" disabled>Choose branch</option> | ||
<option value="Public Sector">Public Sector</option> | ||
<option value="Automotive">Automotive</option> | ||
<option value="Banking">Banking</option> | ||
</select><br><br><br> | ||
<label>Project type</label> | ||
<select name="projectType" style="float:right" [(ngModel)]="project.projectType"> | ||
<option value="" disabled>Choose project type</option> | ||
<option value="Communication project">Communication project</option> | ||
<option value="Data exchange project">Data exchange project</option> | ||
</select><br><br><br> | ||
<label>Development process</label> | ||
<select name="developmentProcess" style="float:right" [(ngModel)]="project.developmentProcess"> | ||
<option value="" disabled>Choose development process</option> | ||
<option value="Agile">Agile</option> | ||
<option value="Classic">Classic</option> | ||
</select><br><br><br> | ||
<label>Project phase</label> | ||
<select name="projectPhase" style="float:right" [(ngModel)]="project.projectPhase"> | ||
<option value="" disabled>Choose project phase</option> | ||
<option value="Specification Sheet">Specification Sheet</option> | ||
<option value="Requirements Specification">Requirements Specification</option> | ||
</select><br><br><br> | ||
<table style="width: 100%"> | ||
<tr> | ||
<td align="right"> | ||
<button class="btn btn-primary" type="submit" style="float:right">Save project</button> | ||
</td> | ||
</tr> | ||
</table> | ||
</form> | ||
</div> |
37 changes: 35 additions & 2 deletions
37
nfafrontend/src/app/current-project/project-edit/project-edit.component.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,48 @@ | ||
import { DataStorageService } from '../../shared/data-storage.service'; | ||
import { Component, OnInit } from '@angular/core'; | ||
import { Project } from '../../shared/project.model'; | ||
import { CurrentProjectService } from '../current-project.service'; | ||
import { ActivatedRoute, Router, Params } from '@angular/router'; | ||
|
||
|
||
@Component({ | ||
selector: 'app-project-edit', | ||
templateUrl: './project-edit.component.html', | ||
styleUrls: ['./project-edit.component.css'] | ||
}) | ||
export class ProjectEditComponent implements OnInit { | ||
|
||
constructor() { } | ||
project: Project; | ||
id: number; | ||
constructor(private route: ActivatedRoute, | ||
private router: Router, | ||
private currentProjectService: CurrentProjectService, | ||
private dataStorage: DataStorageService) { } | ||
|
||
ngOnInit() { | ||
this.route.params.subscribe( | ||
(params) => { | ||
this.id = +params['id']; | ||
this.project = this.copy( | ||
this.currentProjectService.getProject(this.id)); | ||
}); | ||
} | ||
|
||
private copy(toEdit: Project) { | ||
return new Project(toEdit.id, | ||
toEdit.customerName, | ||
toEdit.contactPersCustomer, | ||
toEdit.contactPersMsg, | ||
toEdit.branch, | ||
toEdit.projectType, | ||
toEdit.developmentProcess, | ||
toEdit.projectPhase, | ||
toEdit.projectStatus); | ||
} | ||
|
||
onUpdateProject() { | ||
this.dataStorage.updateProject(this.project).subscribe((response) => { | ||
this.currentProjectService.updateProject(this.id, this.project); | ||
this.router.navigate(['../'], {relativeTo: this.route}); | ||
}); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.