diff --git a/src/app/formations/formations.component.ts b/src/app/formations/formations.component.ts
index 8e98ade..a2cf154 100644
--- a/src/app/formations/formations.component.ts
+++ b/src/app/formations/formations.component.ts
@@ -59,7 +59,6 @@ export class FormationsComponent implements OnInit {
initFormations(formations:FormationModel[]) {
this.formationsDisponibles = [];
- console.log(formations);
let formationDisplay : DisplayFormation;
for(let formation of formations) {
formationDisplay = new DisplayFormation();
@@ -71,9 +70,6 @@ export class FormationsComponent implements OnInit {
}
formationDisplay.datePrevu = formation.dateDebut;
formationDisplay.origine = formation.origine;
- console.log(formation.origine);
- console.log(formationDisplay.origine);
- console.log("");
formationDisplay.statut = formation.statut;
this.formationsDisponibles.push(formationDisplay);
}
@@ -83,28 +79,6 @@ export class FormationsComponent implements OnInit {
this.dataSource.sort = this.sort;
}
- /*
- getStatut(statut:number) {
-
- let value ="";
- switch(statut) {
- case 0:
- value = "Plannifiée";
- break;
- case 1:
- value = "Replannifiée";
- break;
- case 2:
- value = "Réalisée";
- break;
- case 3:
- value = "Annulée";
- break;
- }
- return value;
- }
- */
-
ngOnDestroy() {
if(this.formationsDisponiblesSubscription != undefined) {
this.formationsDisponiblesSubscription.unsubscribe();
diff --git a/src/app/formations/new-formation/new-formation.component.ts b/src/app/formations/new-formation/new-formation.component.ts
index 32e5b38..875e019 100644
--- a/src/app/formations/new-formation/new-formation.component.ts
+++ b/src/app/formations/new-formation/new-formation.component.ts
@@ -36,15 +36,13 @@ export class NewFormationComponent implements OnInit {
constructor(private fb: FormBuilder, private service:FormationsService, private router: Router) { }
ngOnInit() {
- console.log(FormationModel.StatutEnum);
}
ajouterFormation() {
this.nouvelleformation = this.formationForm.value;
this.formationSubscription = this.service.ajouterFormation(this.nouvelleformation).subscribe(
- reponse => {
- console.log(reponse);
- this.router.navigate(['']);
+ response => {
+ this.router.navigate(['/formations',response["id"]]);
}
);
}
diff --git a/src/app/home/home-rh/home-rh.component.html b/src/app/home/home-rh/home-rh.component.html
index c7c2c40..76900d5 100644
--- a/src/app/home/home-rh/home-rh.component.html
+++ b/src/app/home/home-rh/home-rh.component.html
@@ -16,14 +16,14 @@
{{ row.datePrevu | date:'dd/MM/yyyy à hh:mm' }}
-
+
+ Origine
+ {{row.origine}}
+
Statut
- {{ getStatut(row.statut) }}
+ {{row.statut}}
diff --git a/src/app/home/home-rh/home-rh.component.ts b/src/app/home/home-rh/home-rh.component.ts
index 3fbb69a..973778f 100644
--- a/src/app/home/home-rh/home-rh.component.ts
+++ b/src/app/home/home-rh/home-rh.component.ts
@@ -29,7 +29,7 @@ export class HomeRHComponent implements OnInit {
private formationsDisponiblesSubscription : Subscription;
//displayedColumns: string[] = ["intitule", "participants", "date", "origine", "statut"]
- displayedColumns: string[] = ["intitule", "participants", "date", "statut"]
+ displayedColumns: string[] = ["intitule", "origine", "participants", "date", "statut"]
/**
* source pour l'affichage des formations dans le tableau qui est affichée.
@@ -59,14 +59,13 @@ export class HomeRHComponent implements OnInit {
}
ngOnInit() {
- this.formationsDisponiblesSubscription = this.service.getFormations(undefined, 1).subscribe(
+ this.formationsDisponiblesSubscription = this.service.getProchainesFormation(undefined, 1).subscribe(
formations => this.initFormations(formations)
);
}
initFormations(formations:FormationModel[]) {
this.formationsDisponibles = [];
- console.log(formations);
let formationDisplay : DisplayFormation;
for(let formation of formations) {
formationDisplay = new DisplayFormation();
@@ -87,28 +86,6 @@ export class HomeRHComponent implements OnInit {
this.dataSource.sort = this.sort;
}
-
- getStatut(statut:number) {
-
- let value ="";
- switch(statut) {
- case 0:
- value = "Plannifiée";
- break;
- case 1:
- value = "Replannifiée";
- break;
- case 2:
- value = "Réalisée";
- break;
- case 3:
- value = "Annulée";
- break;
- }
- return value;
- }
-
-
ngOnDestroy() {
if(this.formationsDisponiblesSubscription != undefined) {
this.formationsDisponiblesSubscription.unsubscribe();