Merge pull request 'Merge des modifications vues avec Mélissa Blanger lors de la code review' (#4) from refonte_review into develop
Reviewed-on: Clement.Ferrere/Collaborateur_Epa_Front#4pull/5/head
commit
75c2979842
@ -1,27 +0,0 @@ |
||||
label { |
||||
color: #435960; |
||||
font-weight: bold; |
||||
} |
||||
input { |
||||
font-size: 1em; |
||||
padding: .3rem; |
||||
margin: .5rem; |
||||
} |
||||
|
||||
button { |
||||
padding: 5px; |
||||
text-decoration: none; |
||||
margin: 2px; |
||||
display: inline-block; |
||||
background-color: #E77620; |
||||
color: white; |
||||
border-radius: 4px; |
||||
} |
||||
button:hover { |
||||
background-color: #42545C; |
||||
} |
||||
button:disabled { |
||||
background-color: #eee; |
||||
color: #ccc; |
||||
cursor: auto; |
||||
} |
@ -1,61 +0,0 @@ |
||||
label { |
||||
color: #435960; |
||||
font-weight: bold; |
||||
} |
||||
input { |
||||
font-size: 1em; |
||||
padding: .3rem; |
||||
margin: .5rem; |
||||
} |
||||
|
||||
.agences { |
||||
margin: 0 0 2em 0; |
||||
list-style-type: none; |
||||
padding: 0; |
||||
width: 15em; |
||||
} |
||||
.agences li { |
||||
position: relative; |
||||
cursor: pointer; |
||||
} |
||||
|
||||
.agences li:hover { |
||||
left: .1em; |
||||
} |
||||
|
||||
.agences a, td a { |
||||
padding: 5px; |
||||
text-decoration: none; |
||||
margin: 2px; |
||||
display: inline-block; |
||||
background-color: #E77620; |
||||
color: white; |
||||
border-radius: 4px; |
||||
|
||||
} |
||||
|
||||
.agences a:hover { |
||||
background-color: #42545C; |
||||
} |
||||
|
||||
.agences a:active { |
||||
background-color: #525252; |
||||
color: #fafafa; |
||||
} |
||||
|
||||
.agences .badge{ |
||||
display: inline-block; |
||||
font-size: small; |
||||
color: white; |
||||
padding: 0.8em 0.7em 0 0.7em; |
||||
background-color:#405061; |
||||
line-height: 1em; |
||||
position: relative; |
||||
left: -1px; |
||||
top: -4px; |
||||
height: 1.8em; |
||||
min-width: 16px; |
||||
text-align: right; |
||||
margin-right: .8em; |
||||
border-radius: 4px 0 0 4px; |
||||
} |
@ -1,21 +0,0 @@ |
||||
<div xmlns=""> |
||||
<h2>Agences</h2> |
||||
|
||||
<table *ngFor="let agence of agences"> |
||||
|
||||
<td> {{agence.name}} </td> |
||||
<td></td> |
||||
<td> <a routerLink="{{agence.id}}"> Modifier </a></td> |
||||
</table> |
||||
|
||||
<h3>Ajouter une agence : </h3> |
||||
|
||||
<div> |
||||
<label class="col-2" for="agence-name">Agence name</label> |
||||
<input id="agence-name" [(ngModel)]="agence.name" placeholder="name"> |
||||
</div> |
||||
|
||||
<button class="add-button" (click)="add(agence)"> |
||||
Ajouter une Agence |
||||
</button> |
||||
</div> |
@ -1,27 +0,0 @@ |
||||
label { |
||||
color: #435960; |
||||
font-weight: bold; |
||||
} |
||||
input { |
||||
font-size: 1em; |
||||
padding: .3rem; |
||||
margin: .5rem; |
||||
} |
||||
|
||||
button { |
||||
padding: 5px; |
||||
text-decoration: none; |
||||
margin: 2px; |
||||
display: inline-block; |
||||
background-color: #E77620; |
||||
color: white; |
||||
border-radius: 4px; |
||||
} |
||||
button:hover { |
||||
background-color: #42545C; |
||||
} |
||||
button:disabled { |
||||
background-color: #eee; |
||||
color: #ccc; |
||||
cursor: auto; |
||||
} |
@ -1,50 +0,0 @@ |
||||
|
||||
<div *ngIf="collaborateur"> |
||||
|
||||
<h2>{{collaborateur.name | uppercase}} {{collaborateur.firstName | uppercase}} </h2> |
||||
<div><span>id : </span>{{collaborateur.id}}</div> |
||||
<div> |
||||
<label class="col-2" for="collaborateur-name">Collaborateur name </label> |
||||
<input id="collaborateur-name" [(ngModel)]="collaborateur.name" placeholder="name"> |
||||
|
||||
<label class="col-2" for="collaborateur-firstName">Collaborateur firstname </label> |
||||
<input id="collaborateur-firstName" [(ngModel)]="collaborateur.firstName" placeholder="firstname"> |
||||
|
||||
<label class="col-2" for="collaborateur-birthDate">Collaborateur birthDate </label> |
||||
<input id="collaborateur-birthDate" [(ngModel)]="collaborateur.birthDate" placeholder="birthDate"> |
||||
|
||||
<label class="col-2" for="collaborateur-gender">Collaborateur gender </label> |
||||
<input id="collaborateur-gender" [(ngModel)]="collaborateur.gender" placeholder="gender"> |
||||
|
||||
<label class="col-2" for="collaborateur-status">Collaborateur status </label> |
||||
<input id="collaborateur-status" [(ngModel)]="collaborateur.status" placeholder="status"> |
||||
|
||||
<label class="col-2" for="collaborateur-childrenNumber">Collaborateur childrenNumber </label> |
||||
<input id="collaborateur-childrenNumber" [(ngModel)]="collaborateur.childrenNumber" placeholder="childrenNumber"> |
||||
|
||||
<label class="col-2" for="collaborateur-address">Collaborateur address </label> |
||||
<input id="collaborateur-address" [(ngModel)]="collaborateur.address" placeholder="address"> |
||||
|
||||
<label class="col-2" for="collaborateur-telephone">Collaborateur telephone </label> |
||||
<input id="collaborateur-telephone" [(ngModel)]="collaborateur.telephone" placeholder="telephone"> |
||||
|
||||
<label class="col-2" for="collaborateur-personalMail">Collaborateur personalMail </label> |
||||
<input id="collaborateur-personalMail" [(ngModel)]="collaborateur.personalMail" placeholder="personalMail"> |
||||
|
||||
<label class="col-2" for="collaborateur-apsideMail">Collaborateur apsideMail </label> |
||||
<input id="collaborateur-apsideMail" [(ngModel)]="collaborateur.apsideMail" placeholder="apsideMail"> |
||||
|
||||
<label class="col-2" for="collaborateur-resignationDate">Collaborateur resignationDate </label> |
||||
<input id="collaborateur-resignationDate" [(ngModel)]="collaborateur.resignationDate" placeholder="resignationDate"> |
||||
|
||||
<label class="col-2" for="collaborateur-referrerId">Collaborateur referrerId </label> |
||||
<input id="collaborateur-referrerId" [(ngModel)]="collaborateur.referrerId" placeholder="referrerId"> |
||||
|
||||
<label class="col-2" for="collaborateur-businessUnitId">Collaborateur businessUnitId </label> |
||||
<input id="collaborateur-businessUnitId" [(ngModel)]="collaborateur.businessUnitId" placeholder="businessUnitId"> |
||||
</div> |
||||
|
||||
<button (click)="goBack()">Retour</button> |
||||
<button (click)="save()">Sauvegarder les changements</button> |
||||
<button (click)="delete()">Supprimer le collaborateur</button> |
||||
</div> |
@ -1,81 +0,0 @@ |
||||
/* HeroesComponent's private CSS styles */ |
||||
|
||||
label { |
||||
color: #435960; |
||||
font-weight: bold; |
||||
} |
||||
input { |
||||
font-size: 1em; |
||||
padding: .3rem; |
||||
margin: .5rem; |
||||
} |
||||
|
||||
.collaborateurs { |
||||
margin: 0 0 2em 0; |
||||
list-style-type: none; |
||||
padding: 0; |
||||
width: 15em; |
||||
} |
||||
.collaborateurs li { |
||||
position: relative; |
||||
cursor: pointer; |
||||
} |
||||
|
||||
.collaborateurs li:hover { |
||||
left: .1em; |
||||
} |
||||
|
||||
.collaborateurs a, td a { |
||||
padding: 5px; |
||||
text-decoration: none; |
||||
margin: 2px; |
||||
display: inline-block; |
||||
background-color: #E77620; |
||||
color: white; |
||||
border-radius: 4px; |
||||
|
||||
} |
||||
|
||||
.collaborateurs a:hover { |
||||
background-color: #42545C; |
||||
} |
||||
|
||||
.collaborateurs a:active { |
||||
background-color: #525252; |
||||
color: #fafafa; |
||||
} |
||||
|
||||
.collaborateurs .badge { |
||||
display: inline-block; |
||||
font-size: small; |
||||
color: white; |
||||
padding: 0.8em 0.7em 0 0.7em; |
||||
background-color:#405061; |
||||
line-height: 1em; |
||||
position: relative; |
||||
left: -1px; |
||||
top: -4px; |
||||
height: 1.8em; |
||||
min-width: 16px; |
||||
text-align: right; |
||||
margin-right: .8em; |
||||
border-radius: 4px 0 0 4px; |
||||
} |
||||
|
||||
button { |
||||
padding: 5px; |
||||
text-decoration: none; |
||||
margin: 2px; |
||||
display: inline-block; |
||||
background-color: #E77620; |
||||
color: white; |
||||
border-radius: 4px; |
||||
} |
||||
button:hover { |
||||
background-color: #42545C; |
||||
} |
||||
button:disabled { |
||||
background-color: #eee; |
||||
color: #ccc; |
||||
cursor: auto; |
||||
} |
@ -1,61 +0,0 @@ |
||||
<div xmlns=""> |
||||
<h2>Collaborateurs</h2> |
||||
|
||||
<table *ngFor="let collaborateur of collaborateurs"> |
||||
|
||||
<td> {{collaborateur.name}} </td> |
||||
<td></td> |
||||
<td> {{collaborateur.firstName}} </td> |
||||
<td></td> |
||||
<td> {{collaborateur.apsideMail}} </td> |
||||
<td></td> |
||||
<td> <a routerLink="{{collaborateur.id}}"> Modifier </a></td> |
||||
</table> |
||||
|
||||
<h3>Ajouter un collaborateur : </h3> |
||||
|
||||
<div> |
||||
<label class="col-2" for="collaborateur-name">Collaborateur name </label> |
||||
<input id="collaborateur-name" [(ngModel)]="collaborateur.name" placeholder="name"> |
||||
|
||||
<label class="col-2" for="collaborateur-firstName">Collaborateur firstname </label> |
||||
<input id="collaborateur-firstName" [(ngModel)]="collaborateur.firstName" placeholder="firstname"> |
||||
|
||||
<label class="col-2" for="collaborateur-birthDate">Collaborateur birthDate </label> |
||||
<input id="collaborateur-birthDate" [(ngModel)]="collaborateur.birthDate" placeholder="birthDate"> |
||||
|
||||
<label class="col-2" for="collaborateur-gender">Collaborateur name </label> |
||||
<input id="collaborateur-gender" [(ngModel)]="collaborateur.gender" placeholder="gender"> |
||||
|
||||
<label class="col-2" for="collaborateur-status">Collaborateur status </label> |
||||
<input id="collaborateur-status" [(ngModel)]="collaborateur.status" placeholder="status"> |
||||
|
||||
<label class="col-2" for="collaborateur-childrenNumber">Collaborateur childrenNumber </label> |
||||
<input id="collaborateur-childrenNumber" [(ngModel)]="collaborateur.childrenNumber" placeholder="childrenNumber"> |
||||
|
||||
<label class="col-2" for="collaborateur-address">Collaborateur address </label> |
||||
<input id="collaborateur-address" [(ngModel)]="collaborateur.address" placeholder="address"> |
||||
|
||||
<label class="col-2" for="collaborateur-telephone">Collaborateur telephone </label> |
||||
<input id="collaborateur-telephone" [(ngModel)]="collaborateur.telephone" placeholder="telephone"> |
||||
|
||||
<label class="col-2" for="collaborateur-personalMail">Collaborateur personalMail </label> |
||||
<input id="collaborateur-personalMail" [(ngModel)]="collaborateur.personalMail" placeholder="personalMail"> |
||||
|
||||
<label class="col-2" for="collaborateur-apsideMail">Collaborateur apsideMail </label> |
||||
<input id="collaborateur-apsideMail" [(ngModel)]="collaborateur.apsideMail" placeholder="apsideMail"> |
||||
|
||||
<label class="col-2" for="collaborateur-resignationDate">Collaborateur resignationDate </label> |
||||
<input id="collaborateur-resignationDate" [(ngModel)]="collaborateur.resignationDate" placeholder="resignationDate"> |
||||
|
||||
<label class="col-2" for="collaborateur-referrerId">Collaborateur referrerId </label> |
||||
<input id="collaborateur-referrerId" [(ngModel)]="collaborateur.referrerId" placeholder="referrerId"> |
||||
|
||||
<label class="col-2" for="collaborateur-businessUnitId">Collaborateur businessUnitId </label> |
||||
<input id="collaborateur-businessUnitId" [(ngModel)]="collaborateur.businessUnitId" placeholder="businessUnitId"> |
||||
</div> |
||||
|
||||
<button class="add-button" (click)="add(collaborateur)"> |
||||
Ajouter un Collaborateur |
||||
</button> |
||||
</div> |
@ -1,13 +1,13 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {Agence} from "../interfaces/agence"; |
||||
import {Agence} from "../../../interfaces/agence"; |
||||
import {ActivatedRoute} from "@angular/router"; |
||||
import {AgenceService} from "../services/agence.service"; |
||||
import {AgenceService} from "../../../services/agence.service"; |
||||
import {Location} from "@angular/common"; |
||||
|
||||
@Component({ |
||||
selector: 'app-agence-edit', |
||||
templateUrl: './agence-edit.component.html', |
||||
styleUrls: ['./agence-edit.component.css'] |
||||
styleUrls: ['./agence-edit.component.scss'] |
||||
}) |
||||
export class AgenceEditComponent implements OnInit { |
||||
agence : Agence | undefined; |
@ -0,0 +1,32 @@ |
||||
<div xmlns=""> |
||||
<h2 class = mb-4>Agences</h2> |
||||
|
||||
<table class = mb-5> |
||||
<tr> |
||||
<th class="spaced">Name</th> |
||||
</tr> |
||||
<tr *ngFor="let agence of agences"> |
||||
<td class="spaced"> {{agence.name}} </td> |
||||
<td class="spaced"> <a routerLink="{{agence.id}}"> Modifier </a></td> |
||||
</tr> |
||||
</table> |
||||
|
||||
<h3>Ajouter une agence : </h3> |
||||
|
||||
<div class = mb-3> |
||||
<table> |
||||
<tr> |
||||
<th>Name</th> |
||||
</tr> |
||||
<tr> |
||||
<td> |
||||
<input id="agence-name" [(ngModel)]="agence.name" placeholder="name"> |
||||
</td> |
||||
</tr> |
||||
</table> |
||||
</div> |
||||
|
||||
<button class="add-button" (click)="add(agence)"> |
||||
Ajouter une Agence |
||||
</button> |
||||
</div> |
@ -0,0 +1,2 @@ |
||||
|
||||
|
@ -1,12 +1,12 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {Agence} from "../interfaces/agence"; |
||||
import {Agence} from "../../interfaces/agence"; |
||||
import {HttpClient} from "@angular/common/http"; |
||||
import {AgenceService} from "../services/agence.service"; |
||||
import {AgenceService} from "../../services/agence.service"; |
||||
|
||||
@Component({ |
||||
selector: 'app-agence', |
||||
templateUrl: './agence.component.html', |
||||
styleUrls: ['./agence.component.css'] |
||||
styleUrls: ['./agence.component.scss'] |
||||
}) |
||||
export class AgenceComponent implements OnInit { |
||||
agences : Agence[] = []; |
@ -0,0 +1,45 @@ |
||||
<div *ngIf="collaborateur" style="overflow-x:auto;" class="mb-3"> |
||||
|
||||
<table> |
||||
<tr> |
||||
<th>Name</th> |
||||
<th>First Name</th> |
||||
<th>Birth Date</th> |
||||
<th>Gender</th> |
||||
<th>Status</th> |
||||
<th>Children Number</th> |
||||
<th>Address</th> |
||||
<th>Telephone</th> |
||||
<th>Personal Mail</th> |
||||
<th>Apside Mail</th> |
||||
<th>Resignation Date</th> |
||||
<th>Referrer ID</th> |
||||
<th>Business Unit ID</th> |
||||
</tr> |
||||
|
||||
<tr> |
||||
<td><input id="collaborateur-name" [(ngModel)]="collaborateur.name" placeholder="name"></td> |
||||
<td><input id="collaborateur-firstName" [(ngModel)]="collaborateur.firstName" placeholder="firstname"></td> |
||||
<td><input id="collaborateur-birthDate" [(ngModel)]="collaborateur.birthDate" placeholder="birthDate"></td> |
||||
<td><input id="collaborateur-gender" [(ngModel)]="collaborateur.gender" placeholder="gender"></td> |
||||
<td><input id="collaborateur-status" [(ngModel)]="collaborateur.status" placeholder="status"></td> |
||||
<td><input id="collaborateur-childrenNumber" [(ngModel)]="collaborateur.childrenNumber" placeholder="childrenNumber"></td> |
||||
<td><input id="collaborateur-address" [(ngModel)]="collaborateur.address" placeholder="address"></td> |
||||
<td><input id="collaborateur-telephone" [(ngModel)]="collaborateur.telephone" placeholder="telephone"></td> |
||||
<td><input id="collaborateur-personalMail" [(ngModel)]="collaborateur.personalMail" placeholder="personalMail"></td> |
||||
<td><input id="collaborateur-apsideMail" [(ngModel)]="collaborateur.apsideMail" placeholder="apsideMail"></td> |
||||
<td><input id="collaborateur-resignationDate" [(ngModel)]="collaborateur.resignationDate" placeholder="resignationDate"></td> |
||||
<td><input id="collaborateur-referrerId" [(ngModel)]="collaborateur.referrerId" placeholder="referrerId"></td> |
||||
<td><input id="collaborateur-businessUnitId" [(ngModel)]="collaborateur.businessUnitId" placeholder="businessUnitId"></td> |
||||
</tr> |
||||
|
||||
</table> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div> |
@ -0,0 +1 @@ |
||||
|
@ -0,0 +1,19 @@ |
||||
import {Component, Input, OnInit} from '@angular/core'; |
||||
import {Collaborateur} from "../../../interfaces/collaborateur"; |
||||
|
||||
@Component({ |
||||
selector: 'app-collaborateur-detail', |
||||
templateUrl: './collaborateur-detail.component.html', |
||||
styleUrls: ['./collaborateur-detail.component.scss'] |
||||
}) |
||||
export class CollaborateurDetailComponent implements OnInit { |
||||
|
||||
@Input() |
||||
collaborateur: Collaborateur | undefined; |
||||
|
||||
constructor() { } |
||||
|
||||
ngOnInit(): void { |
||||
} |
||||
|
||||
} |
@ -0,0 +1,12 @@ |
||||
|
||||
<div *ngIf="collaborateur"> |
||||
|
||||
<h2>{{collaborateur.name | uppercase}} {{collaborateur.firstName | uppercase}} </h2> |
||||
<div><span>id : </span>{{collaborateur.id}}</div> |
||||
|
||||
<app-collaborateur-detail [collaborateur]="collaborateur"></app-collaborateur-detail> |
||||
|
||||
<button (click)="goBack()">Retour</button> |
||||
<button (click)="save()">Sauvegarder les changements</button> |
||||
<button (click)="delete()">Supprimer le collaborateur</button> |
||||
</div> |
@ -1,13 +1,13 @@ |
||||
import {Component, OnInit} from '@angular/core'; |
||||
import {Collaborateur} from "../interfaces/collaborateur"; |
||||
import {Collaborateur} from "../../../interfaces/collaborateur"; |
||||
import { ActivatedRoute } from '@angular/router'; |
||||
import { Location } from '@angular/common'; |
||||
import { CollaborateurService} from "../services/collaborateur.service"; |
||||
import { CollaborateurService} from "../../../services/collaborateur.service"; |
||||
|
||||
@Component({ |
||||
selector: 'app-collaborateur-edit', |
||||
templateUrl: './collaborateur-edit.component.html', |
||||
styleUrls: ['./collaborateur-edit.component.css'] |
||||
styleUrls: ['./collaborateur-edit.component.scss'] |
||||
}) |
||||
export class CollaborateurEditComponent implements OnInit { |
||||
collaborateur : Collaborateur | undefined; |
@ -0,0 +1,28 @@ |
||||
<div xmlns=""> |
||||
<h2 class = mb-4>Collaborateurs</h2> |
||||
|
||||
<div style="overflow-x:auto;" class="mb-5"> |
||||
<table > |
||||
<tr> |
||||
<th class="spaced">Name</th> |
||||
<th class="spaced">First Name</th> |
||||
<th class="spaced">Apside Mail</th> |
||||
</tr> |
||||
|
||||
<tr *ngFor="let collaborateur of collaborateurs"> |
||||
<td class="spaced"> {{collaborateur.name}} </td> |
||||
<td class="spaced"> {{collaborateur.firstName}} </td> |
||||
<td class="spaced"> {{collaborateur.apsideMail}} </td> |
||||
<td class="spaced"> <a routerLink="{{collaborateur.id}}"> Modifier </a></td> |
||||
</tr> |
||||
</table> |
||||
</div> |
||||
|
||||
<h3>Ajouter un collaborateur : </h3> |
||||
|
||||
<app-collaborateur-detail [collaborateur]="collaborateur"></app-collaborateur-detail> |
||||
|
||||
<button class="add-button" (click)="add(collaborateur)"> |
||||
Ajouter un Collaborateur |
||||
</button> |
||||
</div> |
@ -1,12 +1,12 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {HttpClient} from "@angular/common/http"; |
||||
import {CollaborateurService} from "../services/collaborateur.service"; |
||||
import {Collaborateur} from "../interfaces/collaborateur"; |
||||
import {CollaborateurService} from "../../services/collaborateur.service"; |
||||
import {Collaborateur} from "../../interfaces/collaborateur"; |
||||
|
||||
@Component({ |
||||
selector: 'app-collaborateur', |
||||
templateUrl: './collaborateur.component.html', |
||||
styleUrls: ['./collaborateur.component.css'] |
||||
styleUrls: ['./collaborateur.component.scss'] |
||||
}) |
||||
export class CollaborateurComponent implements OnInit { |
||||
collaborateurs : Collaborateur[] = []; |
@ -0,0 +1,2 @@ |
||||
<h2>Services Collaborateurs EPA</h2> |
||||
|
@ -1,2 +0,0 @@ |
||||
<h1>Services Collaborateurs EPA</h1> |
||||
|
@ -1,17 +0,0 @@ |
||||
button { |
||||
padding: 5px; |
||||
text-decoration: none; |
||||
margin: 2px; |
||||
display: inline-block; |
||||
background-color: #E77620; |
||||
color: white; |
||||
border-radius: 4px; |
||||
} |
||||
button:hover { |
||||
background-color: #42545C; |
||||
} |
||||
button:disabled { |
||||
background-color: #eee; |
||||
color: #ccc; |
||||
cursor: auto; |
||||
} |
@ -1,11 +0,0 @@ |
||||
<div *ngIf="messageService.messages.length"> |
||||
|
||||
<h2>Messages</h2> |
||||
|
||||
<button (click)="messageService.clear()">Clear messages</button> |
||||
|
||||
<div *ngFor='let message of messageService.messages'> |
||||
{{message}} |
||||
</div> |
||||
|
||||
</div> |
@ -1,16 +0,0 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import { MessageService} from "../services/message.service"; |
||||
|
||||
@Component({ |
||||
selector: 'app-messages', |
||||
templateUrl: './messages.component.html', |
||||
styleUrls: ['./messages.component.css'] |
||||
}) |
||||
export class MessagesComponent implements OnInit { |
||||
|
||||
constructor(public messageService : MessageService) { } |
||||
|
||||
ngOnInit(): void { |
||||
} |
||||
|
||||
} |
@ -1,50 +1,40 @@ |
||||
import { Injectable } from '@angular/core'; |
||||
import {HttpClient, HttpHeaders} from "@angular/common/http"; |
||||
import {MessageService} from "./message.service"; |
||||
import {Observable} from "rxjs"; |
||||
import {Agence} from "../interfaces/agence"; |
||||
import {agencesUrl} from "../../ressources/routes/routes"; |
||||
|
||||
@Injectable({ |
||||
providedIn: 'root' |
||||
}) |
||||
export class AgenceService { |
||||
private agencesUrl = 'https://localhost:7125/api/agences'; |
||||
private agencesUrl = agencesUrl; |
||||
|
||||
httpOptions = { |
||||
headers: new HttpHeaders({ 'Content-Type': 'application/json' }) |
||||
}; |
||||
|
||||
constructor(private http: HttpClient, |
||||
private messageService : MessageService) { } |
||||
|
||||
private log(message : string){ |
||||
this.messageService.add(`AgenceService : ${message}`) |
||||
} |
||||
constructor(private http: HttpClient) { } |
||||
|
||||
getAgences():Observable<Agence[]> { |
||||
this.log('get all agences'); |
||||
return this.http.get<Agence[]>(this.agencesUrl); |
||||
} |
||||
|
||||
getAgence(id : number):Observable<Agence>{ |
||||
this.log(`get agence by id : ${id}`); |
||||
return this.http.get<Agence>(this.agencesUrl+"/"+id); |
||||
} |
||||
|
||||
updateAgence(agence : Agence):Observable<any>{ |
||||
updateAgence(agence : Agence):Observable<Agence>{ |
||||
let body = JSON.stringify(agence); |
||||
this.log(`update agence ${agence.id}`) |
||||
return this.http.put(this.agencesUrl + "/" + agence.id, body, this.httpOptions); |
||||
return this.http.put<Agence>(this.agencesUrl + "/" + agence.id, body, this.httpOptions); |
||||
} |
||||
|
||||
deleteAgence(agence: Agence) { |
||||
this.log(`delete agence ${agence.id}`) |
||||
return this.http.delete(this.agencesUrl + "/" + agence.id); |
||||
} |
||||
|
||||
addAgence(agence: Agence): Observable<Agence> { |
||||
let body = JSON.stringify(agence); |
||||
this.log(`add agence ${body}`); |
||||
return this.http.post<Agence>(this.agencesUrl, body, this.httpOptions); |
||||
} |
||||
} |
||||
|
@ -1,51 +1,41 @@ |
||||
import {Collaborateur} from "../interfaces/collaborateur"; |
||||
import {Injectable} from '@angular/core'; |
||||
import {Observable} from "rxjs"; |
||||
import {MessageService} from "./message.service"; |
||||
import {HttpClient, HttpHeaders} from "@angular/common/http"; |
||||
import {collaborateursUrl} from "../../ressources/routes/routes"; |
||||
|
||||
|
||||
@Injectable({providedIn: 'root'}) |
||||
|
||||
export class CollaborateurService { |
||||
|
||||
private collaborateursUrl = 'https://localhost:7125/api/collaborateurs'; |
||||
private collaborateursUrl = collaborateursUrl; |
||||
|
||||
httpOptions = { |
||||
headers: new HttpHeaders({ 'Content-Type': 'application/json' }) |
||||
}; |
||||
|
||||
constructor(private http: HttpClient, |
||||
private messageService : MessageService) { } |
||||
|
||||
private log(message : string){ |
||||
this.messageService.add(`CollaborateurService : ${message}`) |
||||
} |
||||
constructor(private http: HttpClient) { } |
||||
|
||||
getCollaborateurs():Observable<Collaborateur[]> { |
||||
this.log('get all collaborateurs'); |
||||
return this.http.get<Collaborateur[]>(this.collaborateursUrl); |
||||
} |
||||
|
||||
getCollaborateur(id : number):Observable<Collaborateur>{ |
||||
this.log(`get collaborateur by id : ${id}`); |
||||
return this.http.get<Collaborateur>(this.collaborateursUrl+"/"+id); |
||||
} |
||||
|
||||
updateCollaborateur(collaborateur : Collaborateur):Observable<any>{ |
||||
updateCollaborateur(collaborateur : Collaborateur):Observable<Collaborateur>{ |
||||
let body = JSON.stringify(collaborateur); |
||||
this.log(`update collaborateur ${collaborateur.id}`) |
||||
return this.http.put(this.collaborateursUrl + "/" + collaborateur.id, body, this.httpOptions); |
||||
return this.http.put<Collaborateur>(this.collaborateursUrl + "/" + collaborateur.id, body, this.httpOptions); |
||||
} |
||||
|
||||
deleteCollaborateur(collaborateur: Collaborateur) { |
||||
this.log(`delete collaborateur ${collaborateur.id}`) |
||||
return this.http.delete(this.collaborateursUrl + "/" + collaborateur.id); |
||||
} |
||||
|
||||
addCollaborateur(collaborateur: Collaborateur): Observable<Collaborateur> { |
||||
let body = JSON.stringify(collaborateur); |
||||
this.log(`add collaborateur ${body}`); |
||||
return this.http.post<Collaborateur>(this.collaborateursUrl, body, this.httpOptions); |
||||
} |
||||
} |
||||
|
@ -1,20 +0,0 @@ |
||||
import { Injectable } from '@angular/core'; |
||||
|
||||
@Injectable({ |
||||
providedIn: 'root' |
||||
}) |
||||
export class MessageService { |
||||
|
||||
messages : string[] = []; |
||||
|
||||
add(message: string){ |
||||
this.messages.push(message) |
||||
} |
||||
|
||||
clear(){ |
||||
this.messages = []; |
||||
} |
||||
|
||||
constructor() { } |
||||
|
||||
} |
@ -1,25 +0,0 @@ |
||||
import { ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { AgenceEditComponent } from '../agence-edit/agence-edit.component'; |
||||
|
||||
describe('AgenceEditComponent', () => { |
||||
let component: AgenceEditComponent; |
||||
let fixture: ComponentFixture<AgenceEditComponent>; |
||||
|
||||
beforeEach(async () => { |
||||
await TestBed.configureTestingModule({ |
||||
declarations: [ AgenceEditComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
}); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(AgenceEditComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -1,25 +0,0 @@ |
||||
import { ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { AgenceComponent } from '../agence/agence.component'; |
||||
|
||||
describe('AgenceComponent', () => { |
||||
let component: AgenceComponent; |
||||
let fixture: ComponentFixture<AgenceComponent>; |
||||
|
||||
beforeEach(async () => { |
||||
await TestBed.configureTestingModule({ |
||||
declarations: [ AgenceComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
}); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(AgenceComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -1,16 +0,0 @@ |
||||
import { TestBed } from '@angular/core/testing'; |
||||
|
||||
import { AgenceService } from '../services/agence.service'; |
||||
|
||||
describe('AgenceService', () => { |
||||
let service: AgenceService; |
||||
|
||||
beforeEach(() => { |
||||
TestBed.configureTestingModule({}); |
||||
service = TestBed.inject(AgenceService); |
||||
}); |
||||
|
||||
it('should be created', () => { |
||||
expect(service).toBeTruthy(); |
||||
}); |
||||
}); |
@ -1,31 +0,0 @@ |
||||
import { TestBed } from '@angular/core/testing'; |
||||
import { AppComponent } from '../app.component'; |
||||
|
||||
describe('AppComponent', () => { |
||||
beforeEach(async () => { |
||||
await TestBed.configureTestingModule({ |
||||
declarations: [ |
||||
AppComponent |
||||
], |
||||
}).compileComponents(); |
||||
}); |
||||
|
||||
it('should create the app', () => { |
||||
const fixture = TestBed.createComponent(AppComponent); |
||||
const app = fixture.componentInstance; |
||||
expect(app).toBeTruthy(); |
||||
}); |
||||
|
||||
it(`should have as title 'Collaborateur-Epa-Front'`, () => { |
||||
const fixture = TestBed.createComponent(AppComponent); |
||||
const app = fixture.componentInstance; |
||||
expect(app.title).toEqual('Collaborateur-Epa-Front'); |
||||
}); |
||||
|
||||
it('should render title', () => { |
||||
const fixture = TestBed.createComponent(AppComponent); |
||||
fixture.detectChanges(); |
||||
const compiled = fixture.nativeElement; |
||||
expect(compiled.querySelector('.content span').textContent).toContain('Collaborateur-Epa-Front app is running!'); |
||||
}); |
||||
}); |
@ -1,25 +0,0 @@ |
||||
import { ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { CollaborateurEditComponent } from '../collaborateur-edit/collaborateur-edit.component'; |
||||
|
||||
describe('CollaborateurEditComponent', () => { |
||||
let component: CollaborateurEditComponent; |
||||
let fixture: ComponentFixture<CollaborateurEditComponent>; |
||||
|
||||
beforeEach(async () => { |
||||
await TestBed.configureTestingModule({ |
||||
declarations: [ CollaborateurEditComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
}); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(CollaborateurEditComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -1,25 +0,0 @@ |
||||
import { ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { CollaborateurComponent } from '../collaborateur/collaborateur.component'; |
||||
|
||||
describe('CollaborateurComponent', () => { |
||||
let component: CollaborateurComponent; |
||||
let fixture: ComponentFixture<CollaborateurComponent>; |
||||
|
||||
beforeEach(async () => { |
||||
await TestBed.configureTestingModule({ |
||||
declarations: [ CollaborateurComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
}); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(CollaborateurComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -1,16 +0,0 @@ |
||||
import { TestBed } from '@angular/core/testing'; |
||||
|
||||
import { CollaborateurService } from '../services/collaborateur.service'; |
||||
|
||||
describe('CollaborateurService', () => { |
||||
let service: CollaborateurService; |
||||
|
||||
beforeEach(() => { |
||||
TestBed.configureTestingModule({}); |
||||
service = TestBed.inject(CollaborateurService); |
||||
}); |
||||
|
||||
it('should be created', () => { |
||||
expect(service).toBeTruthy(); |
||||
}); |
||||
}); |
@ -1,25 +0,0 @@ |
||||
import { ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { HomeComponent } from '../home/home.component'; |
||||
|
||||
describe('HomeComponent', () => { |
||||
let component: HomeComponent; |
||||
let fixture: ComponentFixture<HomeComponent>; |
||||
|
||||
beforeEach(async () => { |
||||
await TestBed.configureTestingModule({ |
||||
declarations: [ HomeComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
}); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(HomeComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -1,16 +0,0 @@ |
||||
import { TestBed } from '@angular/core/testing'; |
||||
|
||||
import { MessageService } from '../services/message.service'; |
||||
|
||||
describe('MessageService', () => { |
||||
let service: MessageService; |
||||
|
||||
beforeEach(() => { |
||||
TestBed.configureTestingModule({}); |
||||
service = TestBed.inject(MessageService); |
||||
}); |
||||
|
||||
it('should be created', () => { |
||||
expect(service).toBeTruthy(); |
||||
}); |
||||
}); |
@ -1,25 +0,0 @@ |
||||
import { ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { MessagesComponent } from '../messages/messages.component'; |
||||
|
||||
describe('MessagesComponent', () => { |
||||
let component: MessagesComponent; |
||||
let fixture: ComponentFixture<MessagesComponent>; |
||||
|
||||
beforeEach(async () => { |
||||
await TestBed.configureTestingModule({ |
||||
declarations: [ MessagesComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
}); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(MessagesComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -1,25 +0,0 @@ |
||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
||||
|
||||
import 'zone.js/testing'; |
||||
import { getTestBed } from '@angular/core/testing'; |
||||
import { |
||||
BrowserDynamicTestingModule, |
||||
platformBrowserDynamicTesting |
||||
} from '@angular/platform-browser-dynamic/testing'; |
||||
|
||||
declare const require: { |
||||
context(path: string, deep?: boolean, filter?: RegExp): { |
||||
keys(): string[]; |
||||
<T>(id: string): T; |
||||
}; |
||||
}; |
||||
|
||||
// First, initialize the Angular testing environment.
|
||||
getTestBed().initTestEnvironment( |
||||
BrowserDynamicTestingModule, |
||||
platformBrowserDynamicTesting() |
||||
); |
||||
// Then we find all the tests.
|
||||
const context = require.context('./', true, /\.spec\.ts$/); |
||||
// And load the modules.
|
||||
context.keys().map(context); |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
@ -0,0 +1,2 @@ |
||||
export const collaborateursUrl = 'https://localhost:7125/api/collaborateurs'; |
||||
export const agencesUrl = 'https://localhost:7125/api/agences'; |
@ -1 +0,0 @@ |
||||
/* You can add global styles to this file, and also import other style files */ |
@ -0,0 +1,86 @@ |
||||
/* You can add global styles to this file, and also import other style files */ |
||||
|
||||
$primary: #183650; |
||||
$secondary: #e77620; |
||||
$accent: #e1e4e6; |
||||
$error: #b53333; |
||||
$success: #0b7023; |
||||
$info: #fff; |
||||
$warning: #e07612; |
||||
|
||||
label { |
||||
color: $primary; |
||||
font-weight: bold; |
||||
} |
||||
input { |
||||
font-size: 1em; |
||||
padding: .3rem; |
||||
margin: .5rem; |
||||
} |
||||
|
||||
button { |
||||
padding: 5px; |
||||
text-decoration: none; |
||||
margin: 2px; |
||||
display: inline-block; |
||||
background-color: $secondary; |
||||
color: white; |
||||
border-radius: 4px; |
||||
} |
||||
button:hover { |
||||
background-color: $primary; |
||||
} |
||||
button:disabled { |
||||
background-color: #eee; |
||||
color: #ccc; |
||||
cursor: auto; |
||||
} |
||||
|
||||
|
||||
|
||||
.entities { |
||||
margin: 0 0 2em 0; |
||||
list-style-type: none; |
||||
padding: 0; |
||||
width: 15em; |
||||
} |
||||
.entities li { |
||||
position: relative; |
||||
cursor: pointer; |
||||
} |
||||
|
||||
.entities li:hover { |
||||
left: .1em; |
||||
} |
||||
|
||||
.entities a, td a { |
||||
padding: 5px; |
||||
text-decoration: none; |
||||
margin: 2px; |
||||
display: inline-block; |
||||
background-color: $secondary; |
||||
color: white; |
||||
border-radius: 4px; |
||||
} |
||||
|
||||
.entities a:hover { |
||||
background-color: $primary; |
||||
} |
||||
|
||||
.entities a:active { |
||||
background-color: #525252; |
||||
color: #fafafa; |
||||
} |
||||
|
||||
.spaced{ |
||||
padding : 0 25px; |
||||
} |
||||
|
||||
.list { |
||||
|
||||
} |
||||
|
||||
input{ |
||||
margin: 0 15px 0 0; |
||||
} |
||||
|
Loading…
Reference in new issue