diff --git a/README.md b/README.md index 5bc5f41..9d5a599 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,18 @@ This project was generated with [Angular CLI](https://github.com/angular/angular ## Development server -Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. +Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change +any of the source files. ## Code scaffolding -Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. +Run `ng generate component component-name` to generate a new component. You can also +use `ng generate directive|pipe|service|class|guard|interface|enum|module`. ## Build -Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. +Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag +for a production build. ## Running unit tests @@ -24,4 +27,5 @@ Run `ng e2e` to execute the end-to-end tests via a platform of your choice. ## Further help -To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. +To get more help on the Angular CLI use `ng help` or go check out +the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 8edcc44..88b80fd 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,5 +1,5 @@ import {NgModule} from '@angular/core'; -import {RouterModule,Routes} from "@angular/router"; +import {RouterModule, Routes} from "@angular/router"; import {CollaborateurComponent} from "./components/collaborateur/collaborateur.component"; import {CollaborateurEditComponent} from "./components/collaborateur/collaborateur-edit/collaborateur-edit.component"; import {HomeComponent} from "./components/home/home.component"; @@ -15,22 +15,22 @@ import {ReferencementAddComponent} from "./components/referencement/referencemen import {ReferencementEditComponent} from "./components/referencement/referencement-edit/referencement-edit.component"; import {PeriodeEssaiAddComponent} from "./components/periode-essai/periode-essai-add/periode-essai-add.component"; -const routes : Routes = [ - {path:'', redirectTo:'/home', pathMatch:'full'}, - { path: 'home', component:HomeComponent, data:{title:'Services Collaborateurs'}}, - { path:'collaborateurs',component:CollaborateurComponent, data:{title:'Collaborateurs'} }, - { path:'collaborateurs/add',component:CollaborateurAddComponent, data:{title:'Collaborateurs'} }, - { path: 'collaborateurs/:id', component: CollaborateurEditComponent, data:{title:'Collaborateurs'} }, - { path:'referencements',component:ReferencementComponent, data:{title:'Referencements'} }, - { path:'referencements/add',component:ReferencementAddComponent, data:{title:'Referencements'} }, - { path: 'referencements/:id', component: ReferencementEditComponent, data:{title:'Referencements'} }, - { path:'agences',component:AgenceComponent, data:{title:'Agences'} }, - { path: 'agences/:id', component: AgenceEditComponent, data:{title:'Agences'} }, - { path:'businessunits',component:BusinessunitComponent, data:{title:'BusinessUnits'} }, - { path: 'businessunits/:id', component: BusinessunitEditComponent, data:{title:'BusinessUnits'} }, - { path:'periodeessais',component:PeriodeEssaiComponent, data:{title:'Periodes d\'Essai'} }, - { path: 'periodeessais/add', component: PeriodeEssaiAddComponent, data:{title:'Periodes d\'Essai'} }, - { path: 'periodeessais/:id', component: PeriodeEssaiEditComponent, data:{title:'Periodes d\'Essai'} }, +const routes: Routes = [ + {path: '', redirectTo: '/home', pathMatch: 'full'}, + {path: 'home', component: HomeComponent, data: {title: 'Services Collaborateurs'}}, + {path: 'collaborateurs', component: CollaborateurComponent, data: {title: 'Collaborateurs'}}, + {path: 'collaborateurs/add', component: CollaborateurAddComponent, data: {title: 'Collaborateurs'}}, + {path: 'collaborateurs/:id', component: CollaborateurEditComponent, data: {title: 'Collaborateurs'}}, + {path: 'referencements', component: ReferencementComponent, data: {title: 'Referencements'}}, + {path: 'referencements/add', component: ReferencementAddComponent, data: {title: 'Referencements'}}, + {path: 'referencements/:id', component: ReferencementEditComponent, data: {title: 'Referencements'}}, + {path: 'agences', component: AgenceComponent, data: {title: 'Agences'}}, + {path: 'agences/:id', component: AgenceEditComponent, data: {title: 'Agences'}}, + {path: 'businessunits', component: BusinessunitComponent, data: {title: 'BusinessUnits'}}, + {path: 'businessunits/:id', component: BusinessunitEditComponent, data: {title: 'BusinessUnits'}}, + {path: 'periodeessais', component: PeriodeEssaiComponent, data: {title: 'Periodes d\'Essai'}}, + {path: 'periodeessais/add', component: PeriodeEssaiAddComponent, data: {title: 'Periodes d\'Essai'}}, + {path: 'periodeessais/:id', component: PeriodeEssaiEditComponent, data: {title: 'Periodes d\'Essai'}}, ]; @NgModule({ @@ -38,4 +38,5 @@ const routes : Routes = [ exports: [RouterModule] }) -export class AppRoutingModule { } +export class AppRoutingModule { +} diff --git a/src/app/app.component.html b/src/app/app.component.html index 103354d..ce9d844 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -8,25 +8,31 @@ -
- -
+
+ +
-
- -
+
+ +
-
- -
+
+ +
diff --git a/src/app/app.component.scss b/src/app/app.component.scss index de0f241..e2da112 100644 --- a/src/app/app.component.scss +++ b/src/app/app.component.scss @@ -33,7 +33,7 @@ p { } .terminal pre { - font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace; + font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace; color: white; padding: 0 1rem 1rem; margin: 0; @@ -53,6 +53,6 @@ nav a:hover { background-color: #42545C; } -.dropdown-menu{ +.dropdown-menu { min-width: fit-content; } diff --git a/src/app/app.component.ts b/src/app/app.component.ts index f8711b0..53ae3ff 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,7 +1,7 @@ -import { Component,OnInit } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; import {Title} from "@angular/platform-browser"; -import { Router, NavigationEnd, ActivatedRoute } from '@angular/router'; -import { filter} from 'rxjs/operators'; +import {ActivatedRoute, NavigationEnd, Router} from '@angular/router'; +import {filter} from 'rxjs/operators'; @Component({ @@ -9,7 +9,7 @@ import { filter} from 'rxjs/operators'; templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) -export class AppComponent implements OnInit { +export class AppComponent implements OnInit { constructor(private router: Router, private activatedRoute: ActivatedRoute, @@ -23,11 +23,12 @@ export class AppComponent implements OnInit { ).subscribe(() => { const rt = this.getChild(this.activatedRoute); rt.data.subscribe(data => { - this.titleService.setTitle(data.title)}); + this.titleService.setTitle(data.title) + }); }); } - getChild(activatedRoute: ActivatedRoute):ActivatedRoute { + getChild(activatedRoute: ActivatedRoute): ActivatedRoute { if (activatedRoute.firstChild) { return this.getChild(activatedRoute.firstChild); } else { diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 8cd2d58..70eedcc 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -16,12 +16,12 @@ import {BusinessunitEditComponent} from './components/businessunit/businessunit- import {PeriodeEssaiComponent} from './components/periode-essai/periode-essai.component'; import {PeriodeEssaiEditComponent} from './components/periode-essai/periode-essai-edit/periode-essai-edit.component'; import {CollaborateurAddComponent} from './components/collaborateur/collaborateur-add/collaborateur-add.component'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { ToastrModule } from 'ngx-toastr'; -import { ReferencementComponent } from './components/referencement/referencement.component'; -import { ReferencementAddComponent } from './components/referencement/referencement-add/referencement-add.component'; -import { ReferencementEditComponent } from './components/referencement/referencement-edit/referencement-edit.component'; -import { PeriodeEssaiAddComponent } from './components/periode-essai/periode-essai-add/periode-essai-add.component'; +import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; +import {ToastrModule} from 'ngx-toastr'; +import {ReferencementComponent} from './components/referencement/referencement.component'; +import {ReferencementAddComponent} from './components/referencement/referencement-add/referencement-add.component'; +import {ReferencementEditComponent} from './components/referencement/referencement-edit/referencement-edit.component'; +import {PeriodeEssaiAddComponent} from './components/periode-essai/periode-essai-add/periode-essai-add.component'; @NgModule({ declarations: [ diff --git a/src/app/components/agence/agence-edit/agence-edit.component.html b/src/app/components/agence/agence-edit/agence-edit.component.html index fb71e34..decda8c 100644 --- a/src/app/components/agence/agence-edit/agence-edit.component.html +++ b/src/app/components/agence/agence-edit/agence-edit.component.html @@ -1,17 +1,17 @@ -

{{agence.name | uppercase}}

id : {{agence.id}}
+ [formGroup]="registerForm">
- +
Le nom d'une agence est obligatoire
@@ -19,23 +19,26 @@
- +
-
Vous devez choisir la business unit à laquelle appartient l'agence
+
Vous devez choisir la business unit à laquelle appartient + l'agence +
- +
-
diff --git a/src/app/components/agence/agence-edit/agence-edit.component.ts b/src/app/components/agence/agence-edit/agence-edit.component.ts index 171c00a..e8387e3 100644 --- a/src/app/components/agence/agence-edit/agence-edit.component.ts +++ b/src/app/components/agence/agence-edit/agence-edit.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; import {Agence} from "../../../interfaces/agence"; import {ActivatedRoute} from "@angular/router"; import {AgenceService} from "../../../services/agence.service"; @@ -16,11 +16,11 @@ import {ToastrService} from "ngx-toastr"; styleUrls: ['./agence-edit.component.scss'] }) export class AgenceEditComponent implements OnInit { - businessUnits : Businessunit[] = []; - businessUnit = {} as Businessunit ; + businessUnits: Businessunit[] = []; + businessUnit = {} as Businessunit; agence = {} as Agence; - agenceObservable!:Observable; + agenceObservable!: Observable; id: number; registerForm!: FormGroup; @@ -37,11 +37,15 @@ export class AgenceEditComponent implements OnInit { this.id = Number(this.route.snapshot.paramMap.get('id')) } + get f() { + return this.registerForm.controls; + } + async ngOnInit(): Promise { this.getBusinessUnits() this.registerForm = this.formBuilder.group({ name: ['', Validators.required], - businessUnitId:['',Validators.required] + businessUnitId: ['', Validators.required] }); this.agenceObservable = this.agenceService.getAgence(this.id).pipe(tap(agence => this.registerForm.patchValue(agence))) this.agence = await this.agenceObservable.pipe(take(1)).toPromise() @@ -56,14 +60,14 @@ export class AgenceEditComponent implements OnInit { this.location.back(); } - onSubmit():void{ + onSubmit(): void { this.submitted = true if (this.registerForm.invalid) { return; } - if (this.agence){ - this.agence.name = this.registerForm.value.name - this.agence.businessUnitId = this.registerForm.value.businessUnitId + if (this.agence) { + this.agence.name = this.registerForm.value.name + this.agence.businessUnitId = this.registerForm.value.businessUnitId this.agenceService.updateAgence(this.agence) .subscribe(() => { this.showSuccess(); @@ -75,8 +79,6 @@ export class AgenceEditComponent implements OnInit { } } - get f() { return this.registerForm.controls; } - onReset() { this.submitted = false; this.registerForm.reset(); diff --git a/src/app/components/agence/agence.component.html b/src/app/components/agence/agence.component.html index 6e44397..be75997 100644 --- a/src/app/components/agence/agence.component.html +++ b/src/app/components/agence/agence.component.html @@ -2,11 +2,11 @@

Ajouter une agence :

-
+
- +
Le nom d'une agence est obligatoire
@@ -14,25 +14,29 @@
- +
-
Vous devez choisir la business unit à laquelle appartient l'agence
+
Vous devez choisir la business unit à laquelle appartient + l'agence +
- +
-

Agences

+

Agences

-
+
@@ -41,16 +45,14 @@ - - - - - + + + + +
{{agence.id}} {{agence.name}} Modifier
{{agence.id}} {{agence.name}} Modifier
- -
diff --git a/src/app/components/agence/agence.component.ts b/src/app/components/agence/agence.component.ts index fd60c8b..f5c1b8b 100644 --- a/src/app/components/agence/agence.component.ts +++ b/src/app/components/agence/agence.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; import {Agence} from "../../interfaces/agence"; import {HttpClient} from "@angular/common/http"; import {AgenceService} from "../../services/agence.service"; @@ -13,32 +13,37 @@ import {ToastrService} from "ngx-toastr"; styleUrls: ['./agence.component.scss'] }) export class AgenceComponent implements OnInit { - agences : Agence[] = []; + agences: Agence[] = []; agence = {} as Agence; - businessUnits : Businessunit[] = []; - businessUnit = {} as Businessunit ; + businessUnits: Businessunit[] = []; + businessUnit = {} as Businessunit; registerForm!: FormGroup; submitted = false; constructor( - private http : HttpClient, + private http: HttpClient, private agenceService: AgenceService, private businessUnitService: BusinessunitService, private formBuilder: FormBuilder, private toastr: ToastrService - ) { } + ) { + } + + get f() { + return this.registerForm.controls; + } ngOnInit(): void { this.getAgences(); this.getBusinessUnits(); this.registerForm = this.formBuilder.group({ name: ['', Validators.required], - businessUnitId: ['',Validators.required] + businessUnitId: ['', Validators.required] }); } - getAgences():void { + getAgences(): void { this.agenceService.getAgences() .subscribe(agences => this.agences = agences); } @@ -70,8 +75,6 @@ export class AgenceComponent implements OnInit { this.add(this.agence) } - get f() { return this.registerForm.controls; } - onReset() { this.submitted = false; this.registerForm.reset(); diff --git a/src/app/components/businessunit/businessunit-edit/businessunit-edit.component.html b/src/app/components/businessunit/businessunit-edit/businessunit-edit.component.html index c8bffb8..67e5dc5 100644 --- a/src/app/components/businessunit/businessunit-edit/businessunit-edit.component.html +++ b/src/app/components/businessunit/businessunit-edit/businessunit-edit.component.html @@ -1,17 +1,16 @@ -

{{bu.name | uppercase}}

id : {{bu.id}}
+ [formGroup]="registerForm">
- +
Le nom d'une business unit est obligatoire
@@ -19,7 +18,7 @@
- +
diff --git a/src/app/components/businessunit/businessunit-edit/businessunit-edit.component.ts b/src/app/components/businessunit/businessunit-edit/businessunit-edit.component.ts index cd64075..424166c 100644 --- a/src/app/components/businessunit/businessunit-edit/businessunit-edit.component.ts +++ b/src/app/components/businessunit/businessunit-edit/businessunit-edit.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; import {Businessunit} from "../../../interfaces/businessunit"; import {ActivatedRoute} from "@angular/router"; import {BusinessunitService} from "../../../services/businessunit.service"; @@ -15,8 +15,8 @@ import {ToastrService} from "ngx-toastr"; }) export class BusinessunitEditComponent implements OnInit { - businessunit! : Observable ; - bu = {} as Businessunit ; + businessunit!: Observable; + bu = {} as Businessunit; id: number; registerForm!: FormGroup; @@ -32,6 +32,10 @@ export class BusinessunitEditComponent implements OnInit { this.id = Number(this.route.snapshot.paramMap.get('id')) } + get f() { + return this.registerForm.controls; + } + async ngOnInit() { this.registerForm = this.formBuilder.group({ name: ['', Validators.required] @@ -59,8 +63,6 @@ export class BusinessunitEditComponent implements OnInit { } } - get f() { return this.registerForm.controls; } - onReset() { this.submitted = false; this.registerForm.reset(); diff --git a/src/app/components/businessunit/businessunit.component.html b/src/app/components/businessunit/businessunit.component.html index 4e93d92..838aef1 100644 --- a/src/app/components/businessunit/businessunit.component.html +++ b/src/app/components/businessunit/businessunit.component.html @@ -2,11 +2,11 @@

Ajouter une Business Unit :

-
+
- +
Le nom d'une business unit est obligatoire
@@ -14,13 +14,13 @@
- +

Business Units

-
+
diff --git a/src/app/components/businessunit/businessunit.component.ts b/src/app/components/businessunit/businessunit.component.ts index 36c3c04..c0469b2 100644 --- a/src/app/components/businessunit/businessunit.component.ts +++ b/src/app/components/businessunit/businessunit.component.ts @@ -27,6 +27,10 @@ export class BusinessunitComponent implements OnInit { ) { } + get f() { + return this.registerForm.controls; + } + ngOnInit(): void { this.getBusinessunits(); this.registerForm = this.formBuilder.group({ @@ -61,10 +65,6 @@ export class BusinessunitComponent implements OnInit { this.add(this.businessunit) } - get f() { - return this.registerForm.controls; - } - onReset() { this.submitted = false; this.registerForm.reset(); diff --git a/src/app/components/collaborateur/collaborateur-add/collaborateur-add.component.html b/src/app/components/collaborateur/collaborateur-add/collaborateur-add.component.html index 53588f2..071e9e1 100644 --- a/src/app/components/collaborateur/collaborateur-add/collaborateur-add.component.html +++ b/src/app/components/collaborateur/collaborateur-add/collaborateur-add.component.html @@ -1,12 +1,12 @@

Ajouter un collaborateur :

- +
- +
Le nom d'un collaborateur est obligatoire
@@ -14,8 +14,8 @@
- +
Le prénom d'un collaborateur est obligatoire
@@ -23,8 +23,9 @@
- +
La date de naissance d'un collaborateur est obligatoire
@@ -32,9 +33,9 @@
- + @@ -50,9 +51,9 @@
- + @@ -65,9 +66,9 @@
- +
Le nombre d'enfant d'un collaborateur est obligatoire
@@ -75,8 +76,8 @@
- +
L'adresse d'un collaborateur est obligatoire
@@ -84,8 +85,8 @@
- +
Le numéro de téléphone d'un collaborateur est obligatoire
@@ -99,8 +100,9 @@ (pas Apside)
- +
Le mail personnel d'un collaborateur est obligatoire
Le mail personnel d'un collaborateur doit être au format @@ -111,9 +113,10 @@
- +
Le mail Apside d'un collaborateur est obligatoire
Le mail Apside d'un collaborateur doit être au format @@ -128,9 +131,10 @@
- +
La date de départ d'un collaborateur est obligatoire
@@ -142,9 +146,9 @@
- +
@@ -156,6 +160,6 @@
- +
diff --git a/src/app/components/collaborateur/collaborateur-add/collaborateur-add.component.ts b/src/app/components/collaborateur/collaborateur-add/collaborateur-add.component.ts index bff739d..3e6ca9e 100644 --- a/src/app/components/collaborateur/collaborateur-add/collaborateur-add.component.ts +++ b/src/app/components/collaborateur/collaborateur-add/collaborateur-add.component.ts @@ -33,6 +33,10 @@ export class CollaborateurAddComponent implements OnInit { private toastr: ToastrService) { } + get form() { + return this.registerForm.controls; + } + ngOnInit(): void { this.getCollaborateurs(); this.getBusinessunits(); @@ -86,10 +90,6 @@ export class CollaborateurAddComponent implements OnInit { } } - get form() { - return this.registerForm.controls; - } - onReset() { this.submitted = false; this.registerForm.reset(); diff --git a/src/app/components/collaborateur/collaborateur-edit/collaborateur-edit.component.html b/src/app/components/collaborateur/collaborateur-edit/collaborateur-edit.component.html index 52d3acc..ac9f71b 100644 --- a/src/app/components/collaborateur/collaborateur-edit/collaborateur-edit.component.html +++ b/src/app/components/collaborateur/collaborateur-edit/collaborateur-edit.component.html @@ -4,15 +4,16 @@
{{collaborateur.id}}
-
+
- +
Le nom d'un collaborateur est obligatoire
@@ -20,8 +21,8 @@
- +
Le prénom d'un collaborateur est obligatoire
@@ -29,9 +30,10 @@
- +
La date de naissance d'un collaborateur est obligatoire
@@ -39,9 +41,10 @@
- + @@ -57,9 +60,10 @@
- + @@ -72,9 +76,9 @@
- +
Le nombre d'enfant d'un collaborateur est obligatoire
@@ -82,8 +86,8 @@
- +
L'adresse d'un collaborateur est obligatoire
@@ -91,8 +95,8 @@
- +
Le numéro de téléphone d'un collaborateur est obligatoire
@@ -106,9 +110,10 @@ (pas Apside)
- +
Le mail personnel d'un collaborateur est obligatoire
Le mail personnel d'un collaborateur doit être au format @@ -119,9 +124,10 @@
- +
Le mail Apside d'un collaborateur est obligatoire
Le mail Apside d'un collaborateur doit être au format @@ -136,9 +142,11 @@
- +
@@ -147,9 +155,9 @@
- +
@@ -162,7 +170,7 @@
- +
diff --git a/src/app/components/collaborateur/collaborateur-edit/collaborateur-edit.component.ts b/src/app/components/collaborateur/collaborateur-edit/collaborateur-edit.component.ts index 04662b3..71a124c 100644 --- a/src/app/components/collaborateur/collaborateur-edit/collaborateur-edit.component.ts +++ b/src/app/components/collaborateur/collaborateur-edit/collaborateur-edit.component.ts @@ -39,6 +39,10 @@ export class CollaborateurEditComponent implements OnInit { this.id = Number(this.route.snapshot.paramMap.get('id')) } + get f() { + return this.registerForm.controls; + } + async ngOnInit() { this.getCollaborateurs() this.getBusinessunits(); @@ -115,11 +119,6 @@ export class CollaborateurEditComponent implements OnInit { } } - - get f() { - return this.registerForm.controls; - } - onReset() { this.submitted = false; this.registerForm.reset(); diff --git a/src/app/components/collaborateur/collaborateur.component.html b/src/app/components/collaborateur/collaborateur.component.html index 3924555..f10b003 100644 --- a/src/app/components/collaborateur/collaborateur.component.html +++ b/src/app/components/collaborateur/collaborateur.component.html @@ -8,7 +8,7 @@
-
+
diff --git a/src/app/components/collaborateur/collaborateur.component.ts b/src/app/components/collaborateur/collaborateur.component.ts index 1d62198..004dd53 100644 --- a/src/app/components/collaborateur/collaborateur.component.ts +++ b/src/app/components/collaborateur/collaborateur.component.ts @@ -46,5 +46,4 @@ export class CollaborateurComponent implements OnInit { } - } diff --git a/src/app/components/home/home.component.ts b/src/app/components/home/home.component.ts index 73acf06..eaa9e90 100644 --- a/src/app/components/home/home.component.ts +++ b/src/app/components/home/home.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; @Component({ selector: 'app-home', @@ -7,7 +7,8 @@ import { Component, OnInit } from '@angular/core'; }) export class HomeComponent implements OnInit { - constructor() { } + constructor() { + } ngOnInit(): void { } diff --git a/src/app/components/periode-essai/periode-essai-add/periode-essai-add.component.html b/src/app/components/periode-essai/periode-essai-add/periode-essai-add.component.html index 29cd394..caa17d2 100644 --- a/src/app/components/periode-essai/periode-essai-add/periode-essai-add.component.html +++ b/src/app/components/periode-essai/periode-essai-add/periode-essai-add.component.html @@ -1,12 +1,12 @@

Ajouter une Période d'essai :

- +
- + @@ -20,8 +20,8 @@
- +
La date de début d'une période d'essai est obligatoire
@@ -29,9 +29,9 @@
- +
La date de fin prévue d'une période d'essai est obligatoire
@@ -40,8 +40,8 @@
- +
@@ -49,13 +49,13 @@
- +
- + @@ -22,9 +22,9 @@
- +
La date de début d'une période d'essai est obligatoire
@@ -32,10 +32,10 @@
- + type="date">
La date de fin prévue d'une période d'essai est obligatoire
@@ -44,8 +44,8 @@
- +
@@ -56,7 +56,7 @@
diff --git a/src/app/components/periode-essai/periode-essai.component.ts b/src/app/components/periode-essai/periode-essai.component.ts index 8d34044..2d2d565 100644 --- a/src/app/components/periode-essai/periode-essai.component.ts +++ b/src/app/components/periode-essai/periode-essai.component.ts @@ -32,11 +32,11 @@ export class PeriodeEssaiComponent implements OnInit { .subscribe(collaborateurs => this.collaborateurs = collaborateurs); } - getCollaborateurById(id : number) : Collaborateur{ + getCollaborateurById(id: number): Collaborateur { let collab = {} as Collaborateur; this.collaborateurs.forEach(c => { - if (c.id==id){ - collab= c; + if (c.id == id) { + collab = c; return; } }); diff --git a/src/app/components/referencement/referencement-add/referencement-add.component.html b/src/app/components/referencement/referencement-add/referencement-add.component.html index e1cbb0f..3032ce9 100644 --- a/src/app/components/referencement/referencement-add/referencement-add.component.html +++ b/src/app/components/referencement/referencement-add/referencement-add.component.html @@ -1,21 +1,21 @@

Ajouter un référencement :

- +
- +
- +
@@ -24,10 +24,11 @@
- + +
Vous devez préciser le référent du référencement
@@ -36,10 +37,11 @@
- + +
Vous devez préciser le référent du référencement
@@ -50,6 +52,6 @@
- +
diff --git a/src/app/components/referencement/referencement-add/referencement-add.component.ts b/src/app/components/referencement/referencement-add/referencement-add.component.ts index a07f705..ad1ce68 100644 --- a/src/app/components/referencement/referencement-add/referencement-add.component.ts +++ b/src/app/components/referencement/referencement-add/referencement-add.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; import {Collaborateur} from "../../../interfaces/collaborateur"; import {FormBuilder, FormGroup, Validators} from "@angular/forms"; import {HttpClient} from "@angular/common/http"; @@ -32,6 +32,10 @@ export class ReferencementAddComponent implements OnInit { private toastr: ToastrService) { } + get form() { + return this.registerForm.controls; + } + ngOnInit(): void { this.getCollaborateurs(); this.registerForm = this.formBuilder.group({ @@ -70,10 +74,6 @@ export class ReferencementAddComponent implements OnInit { } } - get form() { - return this.registerForm.controls; - } - onReset() { this.submitted = false; this.registerForm.reset(); diff --git a/src/app/components/referencement/referencement-edit/referencement-edit.component.html b/src/app/components/referencement/referencement-edit/referencement-edit.component.html index 944dfe8..d98dd50 100644 --- a/src/app/components/referencement/referencement-edit/referencement-edit.component.html +++ b/src/app/components/referencement/referencement-edit/referencement-edit.component.html @@ -1,23 +1,23 @@

Modifier un référencement :

-
+
- + type="date">
- + type="date">
@@ -26,9 +26,9 @@
- + @@ -39,9 +39,9 @@
- + @@ -54,8 +54,8 @@
- - + +
diff --git a/src/app/components/referencement/referencement.component.html b/src/app/components/referencement/referencement.component.html index 706c2bd..8ed2797 100644 --- a/src/app/components/referencement/referencement.component.html +++ b/src/app/components/referencement/referencement.component.html @@ -8,7 +8,7 @@
-
+
diff --git a/src/app/components/referencement/referencement.component.ts b/src/app/components/referencement/referencement.component.ts index 9a6b3e3..b35fd13 100644 --- a/src/app/components/referencement/referencement.component.ts +++ b/src/app/components/referencement/referencement.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; import {HttpClient} from "@angular/common/http"; import {ReferencementService} from "../../services/referencement.service"; import {Referencement} from "../../interfaces/referencement"; @@ -13,7 +13,7 @@ import {Collaborateur} from "../../interfaces/collaborateur"; export class ReferencementComponent implements OnInit { referencements: Referencement[] = []; - collaborateurs: Collaborateur[]= []; + collaborateurs: Collaborateur[] = []; constructor( private http: HttpClient, @@ -32,11 +32,11 @@ export class ReferencementComponent implements OnInit { .subscribe(collaborateurs => this.collaborateurs = collaborateurs); } - getCollaborateurById(id : number) : Collaborateur{ + getCollaborateurById(id: number): Collaborateur { let collab = {} as Collaborateur; this.collaborateurs.forEach(c => { - if (c.id==id){ - collab= c; + if (c.id == id) { + collab = c; return; } }); @@ -49,11 +49,11 @@ export class ReferencementComponent implements OnInit { .subscribe(referencements => this.referencements = referencements); } - getSplitDate(date: string | undefined) : string{ - if (date == undefined){ + getSplitDate(date: string | undefined): string { + if (date == undefined) { return ""; } - return date.split('T')[0]; + return date.split('T')[0]; } } diff --git a/src/app/interfaces/agence.ts b/src/app/interfaces/agence.ts index 00bf754..72d5ba2 100644 --- a/src/app/interfaces/agence.ts +++ b/src/app/interfaces/agence.ts @@ -1,5 +1,5 @@ export interface Agence { name: string; id: number; - businessUnitId : number; + businessUnitId: number; } diff --git a/src/app/interfaces/collaborateur.ts b/src/app/interfaces/collaborateur.ts index 6637e1c..45dfe64 100644 --- a/src/app/interfaces/collaborateur.ts +++ b/src/app/interfaces/collaborateur.ts @@ -3,13 +3,13 @@ export interface Collaborateur { firstName: string; birthDate: Date; gender: string; - status:string; - childrenNumber:number; - address:string; - telephone:string; - personalMail:string; - apsideMail:string; - resignationDate:Date; - businessUnitId:number; + status: string; + childrenNumber: number; + address: string; + telephone: string; + personalMail: string; + apsideMail: string; + resignationDate: Date; + businessUnitId: number; id: number; } diff --git a/src/app/interfaces/periode-essai.ts b/src/app/interfaces/periode-essai.ts index 2f73c8b..0ed6254 100644 --- a/src/app/interfaces/periode-essai.ts +++ b/src/app/interfaces/periode-essai.ts @@ -1,9 +1,9 @@ export interface PeriodeEssai { id: number; - collaborateurId : number; - startingDate : Date; - plannedEndingDate : Date; - realEndingDate : Date | null; - comment : string; - issue : string; + collaborateurId: number; + startingDate: Date; + plannedEndingDate: Date; + realEndingDate: Date | null; + comment: string; + issue: string; } diff --git a/src/app/interfaces/referencement.ts b/src/app/interfaces/referencement.ts index 8961bd9..e6390b7 100644 --- a/src/app/interfaces/referencement.ts +++ b/src/app/interfaces/referencement.ts @@ -1,7 +1,7 @@ export interface Referencement { id: number; - startingDate : Date; - endingDate : Date | null; - referredId : number; - referrerId : number; + startingDate: Date; + endingDate: Date | null; + referredId: number; + referrerId: number; } diff --git a/src/app/services/agence.service.ts b/src/app/services/agence.service.ts index a92030f..fd538d6 100644 --- a/src/app/services/agence.service.ts +++ b/src/app/services/agence.service.ts @@ -1,4 +1,4 @@ -import { Injectable } from '@angular/core'; +import {Injectable} from '@angular/core'; import {HttpClient, HttpHeaders} from "@angular/common/http"; import {Observable} from "rxjs"; import {Agence} from "../interfaces/agence"; @@ -8,23 +8,23 @@ import {agencesUrl} from "../../ressources/routes/routesPreprod"; providedIn: 'root' }) export class AgenceService { - private agencesUrl = agencesUrl; - httpOptions = { - headers: new HttpHeaders({ 'Content-Type': 'application/json' }) + headers: new HttpHeaders({'Content-Type': 'application/json'}) }; + private agencesUrl = agencesUrl; - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) { + } - getAgences():Observable { + getAgences(): Observable { return this.http.get(this.agencesUrl); } - getAgence(id : number):Observable{ - return this.http.get(this.agencesUrl+"/"+id); + getAgence(id: number): Observable { + return this.http.get(this.agencesUrl + "/" + id); } - updateAgence(agence : Agence):Observable{ + updateAgence(agence: Agence): Observable { let body = JSON.stringify(agence); return this.http.put(this.agencesUrl + "/" + agence.id, body, this.httpOptions); } diff --git a/src/app/services/businessunit.service.ts b/src/app/services/businessunit.service.ts index dbf35fb..ec0fabb 100644 --- a/src/app/services/businessunit.service.ts +++ b/src/app/services/businessunit.service.ts @@ -1,4 +1,4 @@ -import { Injectable } from '@angular/core'; +import {Injectable} from '@angular/core'; import {HttpClient, HttpHeaders} from "@angular/common/http"; import {Observable} from "rxjs"; import {Businessunit} from "../interfaces/businessunit"; @@ -8,24 +8,24 @@ import {businessunitsUrl} from "../../ressources/routes/routesPreprod"; providedIn: 'root' }) export class BusinessunitService { - private businessunitsUrl = businessunitsUrl; - httpOptions = { - headers: new HttpHeaders({ 'Content-Type': 'application/json' }) + headers: new HttpHeaders({'Content-Type': 'application/json'}) }; + private businessunitsUrl = businessunitsUrl; - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) { + } - getBusinessunits():Observable { + getBusinessunits(): Observable { return this.http.get(this.businessunitsUrl); } - getBusinessunit(id : number):Observable{ + getBusinessunit(id: number): Observable { return this.http.get(this.businessunitsUrl + "/" + id); } - updateBusinessunit(businessunit: Businessunit, id:number):Observable{ - let body= JSON.stringify(businessunit); + updateBusinessunit(businessunit: Businessunit, id: number): Observable { + let body = JSON.stringify(businessunit); return this.http.put(this.businessunitsUrl + "/" + id, body, this.httpOptions); } diff --git a/src/app/services/collaborateur.service.ts b/src/app/services/collaborateur.service.ts index 773ab7d..4e4d0f7 100644 --- a/src/app/services/collaborateur.service.ts +++ b/src/app/services/collaborateur.service.ts @@ -9,23 +9,23 @@ import {collaborateursUrl} from "../../ressources/routes/routesPreprod"; export class CollaborateurService { - private collaborateursUrl = collaborateursUrl; - httpOptions = { - headers: new HttpHeaders({ 'Content-Type': 'application/json' }) + headers: new HttpHeaders({'Content-Type': 'application/json'}) }; + private collaborateursUrl = collaborateursUrl; - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) { + } - getCollaborateurs():Observable { + getCollaborateurs(): Observable { return this.http.get(this.collaborateursUrl); } - getCollaborateur(id : number):Observable{ - return this.http.get(this.collaborateursUrl+"/"+id); + getCollaborateur(id: number): Observable { + return this.http.get(this.collaborateursUrl + "/" + id); } - updateCollaborateur(collaborateur : Collaborateur):Observable{ + updateCollaborateur(collaborateur: Collaborateur): Observable { let body = JSON.stringify(collaborateur); return this.http.put(this.collaborateursUrl + "/" + collaborateur.id, body, this.httpOptions); diff --git a/src/app/services/periode-essai.service.ts b/src/app/services/periode-essai.service.ts index 4bea51f..d7f805f 100644 --- a/src/app/services/periode-essai.service.ts +++ b/src/app/services/periode-essai.service.ts @@ -1,4 +1,4 @@ -import { Injectable } from '@angular/core'; +import {Injectable} from '@angular/core'; import {HttpClient, HttpHeaders} from "@angular/common/http"; import {Observable} from "rxjs"; import {periodeessaisUrl} from "../../ressources/routes/routesPreprod"; @@ -8,24 +8,24 @@ import {PeriodeEssai} from "../interfaces/periode-essai"; @Injectable({ providedIn: 'root' }) -export class PeriodeEssaiService{ - private periodeessaisUrl = periodeessaisUrl; - +export class PeriodeEssaiService { httpOptions = { - headers: new HttpHeaders({ 'Content-Type': 'application/json' }) + headers: new HttpHeaders({'Content-Type': 'application/json'}) }; + private periodeessaisUrl = periodeessaisUrl; - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) { + } - getPeriodeEssais():Observable { + getPeriodeEssais(): Observable { return this.http.get(this.periodeessaisUrl); } - getPeriodeEssai(id : number):Observable{ - return this.http.get(this.periodeessaisUrl+"/"+id); + getPeriodeEssai(id: number): Observable { + return this.http.get(this.periodeessaisUrl + "/" + id); } - updatePeriodeEssai(periodeEssai : PeriodeEssai):Observable{ + updatePeriodeEssai(periodeEssai: PeriodeEssai): Observable { let body = JSON.stringify(periodeEssai); return this.http.put(this.periodeessaisUrl + "/" + periodeEssai.id, body, this.httpOptions); } diff --git a/src/app/services/referencement.service.ts b/src/app/services/referencement.service.ts index e4a7664..37c4bab 100644 --- a/src/app/services/referencement.service.ts +++ b/src/app/services/referencement.service.ts @@ -9,23 +9,23 @@ import {referencementsUrl} from "../../ressources/routes/routesPreprod"; export class ReferencementService { - private referencementsUrl = referencementsUrl; - httpOptions = { - headers: new HttpHeaders({ 'Content-Type': 'application/json' }) + headers: new HttpHeaders({'Content-Type': 'application/json'}) }; + private referencementsUrl = referencementsUrl; - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) { + } - getReferencements():Observable { + getReferencements(): Observable { return this.http.get(this.referencementsUrl); } - getReferencement(id : number):Observable{ - return this.http.get(this.referencementsUrl+"/"+id); + getReferencement(id: number): Observable { + return this.http.get(this.referencementsUrl + "/" + id); } - updateReferencement(referencement : Referencement):Observable{ + updateReferencement(referencement: Referencement): Observable { let body = JSON.stringify(referencement); return this.http.put(this.referencementsUrl + "/" + referencement.id, body, this.httpOptions); diff --git a/src/index.html b/src/index.html index 8327614..481cd58 100644 --- a/src/index.html +++ b/src/index.html @@ -4,12 +4,12 @@ Services Collaborateurs - + - + diff --git a/src/main.ts b/src/main.ts index c7b673c..484b5f3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,8 +1,8 @@ -import { enableProdMode } from '@angular/core'; -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import {enableProdMode} from '@angular/core'; +import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; -import { AppModule } from './app/app.module'; -import { environment } from './environments/environment'; +import {AppModule} from './app/app.module'; +import {environment} from './environments/environment'; if (environment.production) { enableProdMode(); diff --git a/src/styles.scss b/src/styles.scss index 770b9c9..e6b3383 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -12,6 +12,7 @@ label { color: $primary; font-weight: bold; } + input { font-size: 1em; padding: .3rem; @@ -25,9 +26,11 @@ input { border-radius: 4px; } + .form-submit:hover { background-color: $primary; } + .form-submit:disabled { background-color: #eee; color: #ccc; @@ -64,9 +67,11 @@ button { border-radius: 4px; border-color: transparent; } + button:hover { background-color: $primary; } + button:disabled { background-color: #eee; color: #ccc;