Compare commits

..

No commits in common. 'develop' and 'master' have entirely different histories.

  1. 1
      .gitignore
  2. 11
      angular.json
  3. 0
      browserslist
  4. 2
      e2e/tsconfig.json
  5. 9904
      package-lock.json
  6. 65
      package.json
  7. 54
      src/app/app-routing.module.ts
  8. 0
      src/app/app.component.css
  9. 2
      src/app/app.component.spec.ts
  10. 31
      src/app/app.component.ts
  11. 44
      src/app/app.module.ts
  12. 125
      src/app/app.theme.scss
  13. 0
      src/app/collaborateurs/collaborateur-routing.module.ts
  14. 24
      src/app/collaborateurs/collaborateurs.component.html
  15. 93
      src/app/collaborateurs/collaborateurs.component.ts
  16. 13
      src/app/collaborateurs/collaborateurs.module.ts
  17. 22
      src/app/collaborateurs/collaborateurs.routing.module.ts
  18. 41
      src/app/collaborateurs/details-collaborateur/details-collaborateur.component.html
  19. 76
      src/app/collaborateurs/details-collaborateur/details-collaborateur.component.ts
  20. 1
      src/app/collaborateurs/formations-collaborateur/details-evaluation/evaluation.component.ts
  21. 1
      src/app/collaborateurs/formations-collaborateur/edit-evaluation/edit-evaluation.component.ts
  22. 1
      src/app/collaborateurs/formations-collaborateur/formations-collaborateur.component.ts
  23. 11
      src/app/demandes-delegation/demandes-delegation.component.html
  24. 80
      src/app/demandes-delegation/demandes-delegation.component.ts
  25. 13
      src/app/demandes-delegation/demandes-delegation.module.ts
  26. 14
      src/app/demandes-delegation/demandes-delegation.routing.module.ts
  27. 17
      src/app/demandes-delegation/details-demande-delegation/demande-delegation.component.html
  28. 106
      src/app/demandes-delegation/details-demande-delegation/demande-delegation.component.ts
  29. 9
      src/app/demandes-delegation/details-demande-delegation/dialog-reponse-demande-delegation.html
  30. 4
      src/app/demandes-delegation/dialog-validation-reponse.html
  31. 1
      src/app/demandes-formation/demandes-formation.component.html
  32. 15
      src/app/demandes-formation/demandes-formation.component.ts
  33. 16
      src/app/demandes-formation/demandes-formation.module.ts
  34. 13
      src/app/demandes-formation/demandes-formation.routing.module.ts
  35. 2
      src/app/demandes-formation/details-demande-formation/demande-formation.component.ts
  36. 31
      src/app/demandes-formation/mat-dialog/dialog-demande-formation.component.html
  37. 79
      src/app/demandes-formation/mat-dialog/dialog-demande-formation.component.ts
  38. 33
      src/app/demandes-formation/new-demande-formation/new-demande-formation.component.html
  39. 69
      src/app/demandes-formation/new-demande-formation/new-demande-formation.component.ts
  40. 30
      src/app/engagements/dialog-engagements.html
  41. 94
      src/app/engagements/engagements.component.ts
  42. 5
      src/app/engagements/engagements.html
  43. 30
      src/app/engagements/engagements.module.ts
  44. 19
      src/app/engagements/engagements.routing.module.ts
  45. 2
      src/app/engagements/index.ts
  46. 1
      src/app/ep-saisie/ep-saisie.component.ts
  47. 3
      src/app/ep-saisie/ep-saisie.module.ts
  48. 21
      src/app/ep-saisie/ep-saisie.routing.module.ts
  49. 1
      src/app/ep-saisie/epa-saisie/epa-saisie.component.ts
  50. 1
      src/app/ep-saisie/epa-six-ans-saisie/epa-six-ans-saisie.component.ts
  51. 1
      src/app/ep-saisie/eps-saisie/eps-saisie.component.ts
  52. 97
      src/app/ep/details-ep/details-ep.component.html
  53. 4
      src/app/ep/details-ep/details-ep.component.scss
  54. 72
      src/app/ep/details-ep/details-ep.component.ts
  55. 8
      src/app/ep/details-ep/ep-choix-date/ep-choix-date.component.html
  56. 5
      src/app/ep/details-ep/ep-choix-date/ep-choix-date.component.scss
  57. 16
      src/app/ep/details-ep/ep-choix-date/ep-choix-date.component.ts
  58. 12
      src/app/ep/details-ep/ep-commentaires-assistant/dialog-ep-ajouter-commentaire-assistant.html
  59. 3
      src/app/ep/details-ep/ep-commentaires-assistant/dialog-ep-supprimer-commentaire-assistant.html
  60. 31
      src/app/ep/details-ep/ep-commentaires-assistant/ep-commentaires-assistant.component.html
  61. 131
      src/app/ep/details-ep/ep-commentaires-assistant/ep-commentaires-assistant.component.ts
  62. 15
      src/app/ep/details-ep/ep-demande-delegation/ep-demande-delegation.component.html
  63. 22
      src/app/ep/details-ep/ep-demande-delegation/ep-demande-delegation.component.ts
  64. 2
      src/app/ep/details-ep/ep-demandes-formation/ep-demandes-formation.component.html
  65. 19
      src/app/ep/details-ep/ep-demandes-formation/ep-demandes-formation.component.ts
  66. 8
      src/app/ep/details-ep/ep-engagements/ep-engagements.component.html
  67. 15
      src/app/ep/details-ep/ep-engagements/ep-engagements.component.ts
  68. 21
      src/app/ep/details-ep/ep-objectifs/ep-objectifs.component.html
  69. 14
      src/app/ep/details-ep/ep-objectifs/ep-objectifs.component.scss
  70. 19
      src/app/ep/details-ep/ep-objectifs/ep-objectifs.component.ts
  71. 11
      src/app/ep/details-ep/ep-participants/ep-participants.component.html
  72. 16
      src/app/ep/details-ep/ep-participants/ep-participants.component.ts
  73. 39
      src/app/ep/details-ep/ep-propositions-dates/ep-propositions-dates.component.html
  74. 42
      src/app/ep/details-ep/ep-propositions-dates/ep-propositions-dates.component.ts
  75. 0
      src/app/ep/ep-augmentation-salaire/ep-augmentation-salaire.component.html
  76. 1
      src/app/ep/ep-augmentation-salaire/ep-augmentation-salaire.component.ts
  77. 1
      src/app/ep/ep-choix-date/ep-choix-date.component.html
  78. 15
      src/app/ep/ep-choix-date/ep-choix-date.component.ts
  79. 1
      src/app/ep/ep-commentaire-assistant/ep-commentaire-assistant.component.html
  80. 15
      src/app/ep/ep-commentaire-assistant/ep-commentaire-assistant.component.ts
  81. 0
      src/app/ep/ep-commentaire-referent/ep-commentaire-referent.component.html
  82. 1
      src/app/ep/ep-commentaire-referent/ep-commentaire-referent.component.ts
  83. 0
      src/app/ep/ep-consultation/ep-consultation.component.html
  84. 1
      src/app/ep/ep-consultation/ep-consultation.component.ts
  85. 1
      src/app/ep/ep-demande-delegation/ep-demande-delegation.component.html
  86. 15
      src/app/ep/ep-demande-delegation/ep-demande-delegation.component.ts
  87. 1
      src/app/ep/ep-demandes-formation/ep-demandes-formation.component.html
  88. 15
      src/app/ep/ep-demandes-formation/ep-demandes-formation.component.ts
  89. 1
      src/app/ep/ep-participants/ep-participants.component.html
  90. 15
      src/app/ep/ep-participants/ep-participants.component.ts
  91. 2
      src/app/ep/ep-participants/new-participant/new-participant.component.html
  92. 15
      src/app/ep/ep-participants/new-participant/new-participant.component.ts
  93. 1
      src/app/ep/ep-propositions-dates/ep-propositions-dates.component.html
  94. 15
      src/app/ep/ep-propositions-dates/ep-propositions-dates.component.ts
  95. 0
      src/app/ep/ep-signature/ep-signature.component.html
  96. 1
      src/app/ep/ep-signature/ep-signature.component.ts
  97. 3
      src/app/ep/ep-signes/ep-signes.component.html
  98. 40
      src/app/ep/ep-signes/ep-signes.component.ts
  99. 22
      src/app/ep/ep.component.html
  100. 44
      src/app/ep/ep.component.ts
  101. Some files were not shown because too many files have changed in this diff Show More

1
.gitignore vendored

@ -30,7 +30,6 @@ speed-measure-plugin*.json
!.vscode/launch.json !.vscode/launch.json
!.vscode/extensions.json !.vscode/extensions.json
.history/* .history/*
.vs/*
# misc # misc
/.sass-cache /.sass-cache

@ -24,7 +24,8 @@
"src/assets" "src/assets"
], ],
"styles": [ "styles": [
"src/styles.scss" "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"src/styles.css"
], ],
"scripts": [] "scripts": []
}, },
@ -39,6 +40,7 @@
"optimization": true, "optimization": true,
"outputHashing": "all", "outputHashing": "all",
"sourceMap": false, "sourceMap": false,
"extractCss": true,
"namedChunks": false, "namedChunks": false,
"extractLicenses": true, "extractLicenses": true,
"vendorChunk": false, "vendorChunk": false,
@ -88,7 +90,7 @@
], ],
"styles": [ "styles": [
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"src/styles.scss" "src/styles.css"
], ],
"scripts": [] "scripts": []
} }
@ -121,10 +123,5 @@
} }
} }
}, },
"schematics": {
"@schematics/angular:component": {
"styleext": "scss"
}
},
"defaultProject": "EPAClient" "defaultProject": "EPAClient"
} }

@ -3,7 +3,7 @@
"compilerOptions": { "compilerOptions": {
"outDir": "../out-tsc/e2e", "outDir": "../out-tsc/e2e",
"module": "commonjs", "module": "commonjs",
"target": "es2018", "target": "es5",
"types": [ "types": [
"jasmine", "jasmine",
"jasminewd2", "jasminewd2",

9904
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -8,45 +8,46 @@
"test": "ng test", "test": "ng test",
"lint": "ng lint", "lint": "ng lint",
"e2e": "ng e2e", "e2e": "ng e2e",
"compodoc": "npx compodoc -p tsconfig.compodoc.json src" "compodoc": "./node_modules/.bin/compodoc -p tsconfig.json"
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular-material-components/datetime-picker": "^5.0.3", "@angular-material-components/datetime-picker": "^2.0.4",
"@angular/animations": "~11.1.2", "@angular/animations": "~9.1.9",
"@angular/cdk": "^11.1.2", "@angular/cdk": "^9.2.4",
"@angular/common": "~11.1.2", "@angular/common": "~9.1.9",
"@angular/compiler": "~11.1.2", "@angular/compiler": "~9.1.9",
"@angular/core": "~11.1.2", "@angular/core": "~9.1.9",
"@angular/forms": "~11.1.2", "@angular/forms": "~9.1.9",
"@angular/material": "^11.1.2", "@angular/material": "^9.2.4",
"@angular/platform-browser": "~11.1.2", "@angular/platform-browser": "~9.1.9",
"@angular/platform-browser-dynamic": "~11.1.2", "@angular/platform-browser-dynamic": "~9.1.9",
"@angular/router": "~11.1.2", "@angular/router": "~9.1.9",
"angular-oauth2-oidc": "^10.0.3", "keycloak-angular": "^7.3.1",
"rxjs": "~6.6.3", "keycloak-js": "^10.0.2",
"tslib": "^2.1.0", "rxjs": "~6.5.4",
"zone.js": "~0.11.3" "tslib": "^1.10.0",
"zone.js": "~0.10.2"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~0.1101.4", "@angular-devkit/build-angular": "~0.901.7",
"@angular/cli": "~11.1.4", "@angular/cli": "~9.1.7",
"@angular/compiler-cli": "~11.1.2", "@angular/compiler-cli": "~9.1.9",
"@compodoc/compodoc": "^1.1.11", "@compodoc/compodoc": "^1.1.11",
"@types/jasmine": "~3.6.3", "@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.8", "@types/jasminewd2": "~2.0.3",
"@types/node": "^14.14.25", "@types/node": "^12.11.1",
"codelyzer": "^6.0.1", "codelyzer": "^5.1.2",
"jasmine-core": "~3.6.0", "jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~6.0.0", "jasmine-spec-reporter": "~4.2.1",
"karma": "~6.1.0", "karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0", "karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.3", "karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~4.0.1", "karma-jasmine": "~3.0.1",
"karma-jasmine-html-reporter": "^1.5.4", "karma-jasmine-html-reporter": "^1.4.2",
"protractor": "~7.0.0", "protractor": "~7.0.0",
"ts-node": "~9.1.1", "ts-node": "~8.3.0",
"tslint": "^6.1.3", "tslint": "~6.1.0",
"typescript": "~4.1.3" "typescript": "~3.8.3"
} }
} }

@ -5,80 +5,56 @@ import { Routes } from '@angular/router';
import { HomeComponent } from './home/'; import { HomeComponent } from './home/';
import { AuthGuard } from './shared/auth/auth.guard'; import { KeycloakGuard } from '@shared/guards/keycloakguard';
import { paths_collaborateurs, paths_demandes_delegation, paths_demandes_formation, import { paths_collaborateurs, paths_demandes_delegation, paths_demandes_formation,
paths_ep, paths_saisie_ep, paths_formation, paths_home, paths_referents, paths_engagements, paths_notes } from './shared/utils/paths'; paths_ep, paths_saisie_ep, paths_formation, paths_home, paths_referents } from '@shared/utils/paths';
import { Role } from './shared/utils/roles';
/**
* L'ensemble des routes du client Angular
*/
const routes: Routes = [ const routes: Routes = [
//chargement des chemins du module collaborateur à partir du routing de ce module {
path: '',
redirectTo: paths_home.path,
pathMatch: 'full'
},
{
path: paths_home.path,
component: HomeComponent,
canActivate: [KeycloakGuard],
pathMatch: 'full'
},
{ {
path: paths_collaborateurs.path, path: paths_collaborateurs.path,
loadChildren: () => import('./collaborateurs/collaborateurs.module').then(m=> m.CollaborateursModule) loadChildren: () => import('./collaborateurs/collaborateurs.module').then(m=> m.CollaborateursModule)
}, },
//chargement des chemins du module demandes délégation à partir du routing de ce module
{ {
path: paths_demandes_delegation.path, path: paths_demandes_delegation.path,
loadChildren: () => import('./demandes-delegation/demandes-delegation.module').then(m=> m.DemandesDelegationModule) loadChildren: () => import('./demandes-delegation/demandes-delegation.module').then(m=> m.DemandesDelegationModule)
}, },
//chargement des chemins du module demandes de formation à partir du routing de ce module
{ {
path: paths_demandes_formation.path, path: paths_demandes_formation.path,
loadChildren: () => import('./demandes-formation/demandes-formation.module').then(m=> m.DemandesFormationModule) loadChildren: () => import('./demandes-formation/demandes-formation.module').then(m=> m.DemandesFormationModule)
}, },
//chargement des chemins du module ep à partir du routing de ce module
{ {
path: paths_ep.path, path: paths_ep.path,
loadChildren: () => import('./ep/ep.module').then(m=> m.EpModule) loadChildren: () => import('./ep/ep.module').then(m=> m.EpModule)
}, },
//chargement des chemins du module saisie ep à partir du routing de ce module
{ {
path: paths_saisie_ep.path, path: paths_saisie_ep.path,
loadChildren: () => import('./ep-saisie/ep-saisie.module').then(m=> m.EpSaisieModule) loadChildren: () => import('./ep-saisie/ep-saisie.module').then(m=> m.EpSaisieModule)
}, },
//chargement des chemins du module formation à partir du routing de ce module
{ {
path: paths_formation.path, path: paths_formation.path,
loadChildren: () => import('./formations/formations.module').then(m=> m.FormationsModule) loadChildren: () => import('./formations/formations.module').then(m=> m.FormationsModule)
}, },
//chargement des chemins du module référent à partir du routing de ce module
{ {
path: paths_referents.path, path: paths_referents.path,
loadChildren: () => import('./referents/referents.module').then(m=> m.ReferentsModule) loadChildren: () => import('./referents/referents.module').then(m=> m.ReferentsModule)
},
//chargement des chemin du module engagement à partir du routing de ce module
{
path: paths_engagements.path,
loadChildren: () => import('./engagements/engagements.module').then(m => m.EngagementsModule)
},
{
path: paths_notes.path,
loadChildren: () => import('./notes/notes.module').then( m => m.NotesModule)
},
//Chemin du home
{
path: paths_home.path,
component: HomeComponent,
canActivate: [AuthGuard],
data: { roles: [Role.assistante, Role.commercial, Role.rh, Role.collaborateur] },
pathMatch: 'full'
},
//Redirection vers le home pour "/"
{
path: '',
redirectTo: paths_home.path,
pathMatch: 'full'
} }
]; ];
@NgModule({ @NgModule({
imports: [RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' })], imports: [RouterModule.forRoot(routes)],
exports: [RouterModule], exports: [RouterModule],
providers: [AuthGuard] providers: [KeycloakGuard]
}) })
export class AppRoutingModule {} export class AppRoutingModule {}

@ -1,4 +1,4 @@
import { TestBed, waitForAsync } from '@angular/core/testing'; import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
/* /*

@ -1,37 +1,14 @@
import { Component, OnInit } from '@angular/core'; import { Component } from '@angular/core';
import { CollaborateursService } from '@shared/api-swagger/api/api'
import { AuthService } from '@shared/auth/auth.service';
import { Subscription } from 'rxjs';
import { cles } from "@shared/utils/cles"
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
templateUrl: './app.component.html', templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'] styleUrls: ['./app.component.css']
}) })
export class AppComponent {
export class AppComponent implements OnInit {
title = 'EPAClient'; title = 'EPAClient';
subscriber: Subscription; constructor() {
constructor(private collaborateursService: CollaborateursService,
private authService: AuthService ) {
}
ngOnInit(): void {
if(sessionStorage.getItem(cles.sessionKeyConnectee) == undefined) {
this.subscriber = this.collaborateursService.getCollaborateurByMail(this.authService.mail).subscribe(
collaborateur => sessionStorage.setItem(cles.sessionKeyConnectee, JSON.stringify(collaborateur))
);
}
}
ngOnDestroy(): void {
if(this.subscriber != undefined)
this.subscriber.unsubscribe();
} }
} }

@ -2,6 +2,8 @@ import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule, DoBootstrap } from '@angular/core'; import { NgModule, DoBootstrap } from '@angular/core';
import { HttpClientModule } from '@angular/common/http'; import { HttpClientModule } from '@angular/common/http';
import { KeycloakAngularModule, KeycloakService } from 'keycloak-angular';
import { RouterModule } from '@angular/router';
import { registerLocaleData } from '@angular/common'; import { registerLocaleData } from '@angular/common';
import localeFr from '@angular/common/locales/fr'; import localeFr from '@angular/common/locales/fr';
@ -20,14 +22,16 @@ import { FormationsModule } from './formations';
import { DemandesFormationModule } from './demandes-formation'; import { DemandesFormationModule } from './demandes-formation';
import { DemandesDelegationModule } from './demandes-delegation'; import { DemandesDelegationModule } from './demandes-delegation';
import { EpSaisieModule } from "./ep-saisie"; import { EpSaisieModule } from "./ep-saisie";
import { AffichageDetailsCollaborateurModule } from "@shared/affichage-details-collaboarteur/affichage-details-collaborateur.module";
import { EpModule } from "./ep" import { EpModule } from "./ep"
import { AuthModule } from '@shared/auth/auth.module';
import { MatTablesModule } from "@shared/mat-tables/mat-tables.module"; import { environment } from '@env';
import { EngagementsModule } from './engagements';
import { NotesModule } from './notes';
import { FilterModule } from "@shared/filter/filter.module";
/**
* constante Keycloak qui pourra être utilisé dans tout le projet.
*/
let keycloakService: KeycloakService = new KeycloakService();
@NgModule({ @NgModule({
declarations: [ declarations: [
@ -35,18 +39,32 @@ import { FilterModule } from "@shared/filter/filter.module";
], ],
imports: [ imports: [
BrowserModule, BrowserAnimationsModule, BrowserModule, BrowserAnimationsModule,
AuthModule.forRoot(), AppRoutingModule, KeycloakAngularModule, AppRoutingModule,
HttpClientModule, ApiModule, HttpClientModule, ApiModule,
HomeModule, CollaborateursModule, HomeModule, CollaborateursModule,
ReferentsModule, FormationsModule, ReferentsModule, FormationsModule,
DemandesFormationModule, DemandesDelegationModule, DemandesFormationModule, DemandesDelegationModule,
EpSaisieModule, NotesModule, EpModule, EpSaisieModule
MatTablesModule, FilterModule,
AffichageDetailsCollaborateurModule, EngagementsModule
], ],
providers: [], providers: [
bootstrap: [AppComponent] {
provide: KeycloakService,
useValue: keycloakService
}
],
entryComponents: [AppComponent]
}) })
export class AppModule { export class AppModule implements DoBootstrap {
async ngDoBootstrap(app) {
const { keycloakConfig } = environment;
try {
await keycloakService.init({ config: keycloakConfig });
app.bootstrap(AppComponent);
} catch (error) {
console.error('Keycloak init failed', error);
}
}
} }

@ -1,125 +0,0 @@
// -----------------------------------------------------------------------------------------------------
// @ Custom color maps
// -----------------------------------------------------------------------------------------------------
$navy-app-theme: (
50: #ECECEE,
100: #C5C6CB,
200: #9EA1A9,
300: #7D818C,
400: #5C616F,
500: #E89759,
600: #353A48,
700: #2D323E,
800: #262933,
900: #1E2129,
A100: #C5C6CB,
A200: #9EA1A9,
A400: #5C616F,
A700: #2D323E,
contrast: (
50: $dark-primary-text,
100: $dark-primary-text,
200: $dark-primary-text,
300: $light-primary-text,
400: $light-primary-text,
500: $light-primary-text,
600: $light-primary-text,
700: $light-primary-text,
800: $light-primary-text,
900: $light-primary-text,
A100: $dark-primary-text,
A200: $light-primary-text,
A400: $light-primary-text,
A700: $light-primary-text,
)
);
$apside-primary-app-theme: (
50: #ECECEE,
100: #C5C6CB,
200: #9EA1A9,
300: #7D818C,
400: #5C616F,
500: #E89759,
600: #353A48,
700: #2D323E,
800: #262933,
900: #1E2129,
A100: #C5C6CB,
A200: #9EA1A9,
A400: #5C616F,
A700: #2D323E,
contrast: (
50: $dark-primary-text,
100: $dark-primary-text,
200: $dark-primary-text,
300: $light-primary-text,
400: $light-primary-text,
500: $light-primary-text,
600: $light-primary-text,
700: $light-primary-text,
800: $light-primary-text,
900: $light-primary-text,
A100: $dark-primary-text,
A200: $light-primary-text,
A400: $light-primary-text,
A700: $light-primary-text,
)
);
// -----------------------------------------------------------------------------------------------------
// @ Define the default theme
// -----------------------------------------------------------------------------------------------------
// Define the primary, accent and warn palettes
$default-primary-palette: mat-palette($navy-app-theme);
$default-accent-palette: mat-palette($mat-light-blue, 600, 400, 700);
$default-warn-palette: mat-palette($mat-red);
// Create the Material theme object
$theme: mat-light-theme($default-primary-palette, $default-accent-palette, $default-warn-palette);
// Add ".theme-default" class to the body to activate this theme.
// Class name must start with "theme-" !!!
.theme-default {
// Create an Angular Material theme from the $theme map
@include angular-material-theme($theme);
}
// -----------------------------------------------------------------------------------------------------
// @ Define a blue-gray dark theme
// -----------------------------------------------------------------------------------------------------
// Define the primary, accent and warn palettes
$blue-gray-dark-theme-primary-palette: mat-palette($navy-app-theme);
$blue-gray-dark-theme-accent-palette: mat-palette($mat-blue-gray);
$blue-gray-dark-theme-warn-palette: mat-palette($mat-red);
// Create the Material theme object
$blue-gray-dark-theme: mat-dark-theme($blue-gray-dark-theme-primary-palette, $blue-gray-dark-theme-accent-palette, $blue-gray-dark-theme-warn-palette);
// Add ".theme-blue-gray-dark" class to the body to activate this theme.
// Class name must start with "theme-" !!!
.theme-blue-gray-dark {
// Generate the Angular Material theme
@include angular-material-theme($blue-gray-dark-theme);
}
// -----------------------------------------------------------------------------------------------------
// @ Typography
// -----------------------------------------------------------------------------------------------------
// Angular Material typography
$typography: mat-typography-config(
$font-family: 'Muli, Helvetica Neue, Arial, sans-serif',
$title: mat-typography-level(20px, 32px, 600),
$body-2: mat-typography-level(14px, 24px, 600),
$button: mat-typography-level(14px, 14px, 600),
$input: mat-typography-level(16px, 1.125, 400) // line-height must be unitless !!!
);
// Setup the typography
@include angular-material-typography($typography);

@ -1,5 +1,27 @@
<app-nav-menu></app-nav-menu> <app-nav-menu></app-nav-menu>
<h1> Liste des collaborateurs </h1> <h1> Liste des collaborateurs </h1>
<mat-table matSort [dataSource]="dataSource">
<ng-container matColumnDef="agence">
<mat-header-cell *matHeaderCellDef mat-sort-header>Agence</mat-header-cell>
<mat-cell *matCellDef="let row">{{ row.agence}}</mat-cell>
</ng-container>
<collaborateurs-table [typeRecherche]="typeRecherche" [rechercherParBU]="rechercherParBU" [roles]="roles" [displayedColumns]="displayedColumns" (eventEmitter)="event($event)" ></collaborateurs-table> <ng-container matColumnDef="collaborateur">
<mat-header-cell *matHeaderCellDef mat-sort-header>Collabotareur</mat-header-cell>
<mat-cell *matCellDef="let row" [routerLink]="['/collaborateurs', row.id]">{{row.prenom}} {{row.nom}}</mat-cell>
</ng-container>
<ng-container matColumnDef="dateembauche">
<mat-header-cell *matHeaderCellDef mat-sort-header>Date embauche</mat-header-cell>
<mat-cell *matCellDef="let row">TODO AUSSI</mat-cell>
</ng-container>
<ng-container matColumnDef="referent">
<mat-header-cell *matHeaderCellDef mat-sort-header>Référent</mat-header-cell>
<mat-cell *matCellDef="let row">TODO</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
</mat-table>

@ -1,54 +1,95 @@
import { Component } from '@angular/core'; import { Component, OnInit, OnDestroy, ViewChild, ViewChildren } from '@angular/core';
import { Observable, Subscription } from 'rxjs';
import { collaborateurTypeRecherche } from "@shared/utils/cles"; import {MatTableDataSource} from '@angular/material/table';
import { Router } from '@angular/router'; import {MatPaginator} from '@angular/material/paginator';
import {MatSort} from '@angular/material/sort';
import { CollaborateursService } from "@shared/api-swagger/api/api";
import { CollaborateurModel } from "@shared/api-swagger/model/models";
import { DisplayCollaborateur } from "@shared/displayInfo/displays";
/** /**
* Composant qui sert à l'affichage de la liste des collaborateurs en fonction de l'agence de son utilitateur. * Composant qui sert à l'affichage de la liste des collaborateurs en fonction de l'agence de son utilitateur.
* Seuls les commerciaux, RH et assistantes pourront accéder à la liste des collaborateurs.
* Les données affichées : Agence-Nom Prénom-Date Embauche-Responsable Commercial-Date Prochain EP
*/ */
@Component({ @Component({
selector: 'app-collaborateurs', selector: 'app-collaborateurs',
templateUrl: './collaborateurs.component.html' templateUrl: './collaborateurs.component.html'
}) })
export class CollaborateursComponent { export class CollaborateursComponent implements OnInit {
collaborateursDisponibles : DisplayCollaborateur[];
collaborateursFiltre : DisplayCollaborateur[];
private collaborateursDisponiblesSubscription : Subscription;
displayedColumns : string[] = ["agence", "collaborateur", "dateembauche", "referent"];
dataSource : MatTableDataSource<DisplayCollaborateur>;
/** /**
* Type de la recherche à indiquer au composant fils qui affiche la liste des collaborateurs * contenu de la recherche.
*/ */
typeRecherche: string = collaborateurTypeRecherche.collaborateurs; search = "";
/** /**
* Rôle des collaborateurs à récupérer via le service collaborateur, ici nous ne voulons que les collaborateurs (pour le moment...). * Pagination du tableau.
*/ */
roles: string[] = ["Collaborateur"]; @ViewChild(MatPaginator) paginator: MatPaginator;
/** /**
* Liste des colonnes du tableau à afficher. * Tri par les éléments du tableau selon la colonne choisie.
*/ */
displayedColumns: string[] = ["businessunit", "collaborateur", "datearrivee", "referent"]; @ViewChild(MatSort) sort: MatSort;
/** /**
* Indique si la recherche pas BU est activée ou non * Spécifie si la liste des EP est en cours de chargement et d'écriture dans le tableau.
*/ */
rechercherParBU: boolean = true; chargement = true;
constructor(private service: CollaborateursService) {}
constructor(private router: Router) {} ngOnInit() {
this. collaborateursDisponiblesSubscription = this.service.getCollaborateurs(undefined,undefined,undefined,1).subscribe(
collaborateurs => {
this.initCollaborateur(collaborateurs)
}
);
}
/** initCollaborateur(collaborateurs:CollaborateurModel[]) {
* Fonction permettant d'ouvrir les détails d'un référent ou d'un collaborateur en fonction de la case cliquée this.collaborateursDisponibles = [];
* let collaborateurDisplay : DisplayCollaborateur;
* @param event Evènement reçu par le composant enfant, contient le type du collaborateur reçu (référent, collaborateur) et les données collaborateur let today = new Date();
*/ console.log(collaborateurs);
event(event : any) { for(let c of collaborateurs) {
switch(event.type) { collaborateurDisplay = new DisplayCollaborateur();
case "collaborateur": collaborateurDisplay.id = c.id;
this.router.navigate(["/collaborateurs", event.collaborateur.id]); collaborateurDisplay.prenom = c.prenom;
break; collaborateurDisplay.nom = c.nom;
case "referent": collaborateurDisplay.agence = c.businessUnit.nom;
this.router.navigate(["/referents", event.collaborateur.id]); collaborateurDisplay.embauche = c.dateArrivee;
break; collaborateurDisplay.anciennete = this.setAnciennete(new Date(c.dateArrivee), today);
collaborateurDisplay.annee = Math.floor(collaborateurDisplay.anciennete / 31536000000);
collaborateurDisplay.mois = Math.floor(collaborateurDisplay.anciennete / 2629800000 % 12);
this.collaborateursDisponibles.push(collaborateurDisplay);
} }
this.collaborateursFiltre = this.collaborateursDisponibles;
this.dataSource = new MatTableDataSource(this.collaborateursFiltre);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
} }
setAnciennete(firstDate, secondDate) {
return Math.abs(firstDate-secondDate);
}
ngOnDestroy() {
if(this.collaborateursDisponiblesSubscription != undefined) {
this.collaborateursDisponiblesSubscription.unsubscribe();
}
}
} }

@ -1,28 +1,25 @@
import { NgModule } from "@angular/core"; import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common"; import { CommonModule } from "@angular/common";
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { MaterialModule } from "@shared/angular-material/angular-material.module"; import { MaterialModule } from "@shared/angular-material/angular-material.module";
import {NavMenuModule} from '@shared/nav-menu/nav-menu.module'; import {NavMenuModule} from '@shared/nav-menu/nav-menu.module';
import { CollaborateursComponent } from "./collaborateurs.component"; import { CollaborateursComponent } from "./collaborateurs.component";
import { DetailsCollaborateurComponent } from "./details-collaborateur/details-collaborateur.component"; import { DetailsCollaborateurComponent } from "./details-collaborateur/details-collaborateur.component";
import { EvaluationComponent } from "./formations-collaborateur/details-evaluation/evaluation.component"; import { EvaluationComponent } from "./formations-collaborateur/details-evaluation/evaluation.component";
import { EditEvaluationComponent } from "./formations-collaborateur/edit-evaluation/edit-evaluation.component"; import { EditEvaluationComponent } from "./formations-collaborateur/edit-evaluation/edit-evaluation.component";
import { FormationsCollaboateurComponent } from "./formations-collaborateur/formations-collaborateur.component"; import { FormationsCollaboateurComponent } from "./formations-collaborateur/formations-collaborateur.component";
import { MatTablesModule } from "@shared/mat-tables/mat-tables.module";
import { CollaborateursRoutingModule } from "./collaborateurs.routing.module"; import { CollaborateursRoutingModule } from "./collaborateurs.routing.module";
import { AffichageDetailsCollaborateurModule } from "@shared/affichage-details-collaboarteur/affichage-details-collaborateur.module";
@NgModule({ @NgModule({
declarations: [ declarations: [
CollaborateursComponent, DetailsCollaborateurComponent,
DetailsCollaborateurComponent, EvaluationComponent, EditEvaluationComponent, DetailsCollaborateurComponent, EvaluationComponent, EditEvaluationComponent,
FormationsCollaboateurComponent CollaborateursComponent, FormationsCollaboateurComponent
], ],
exports: [ exports: [
CollaborateursComponent CollaborateursComponent
@ -30,12 +27,8 @@ import { AffichageDetailsCollaborateurModule } from "@shared/affichage-details-c
imports: [ imports: [
//FormsModule, //FormsModule,
CommonModule, CommonModule,
FormsModule,
ReactiveFormsModule,
MaterialModule, MaterialModule,
NavMenuModule, NavMenuModule,
MatTablesModule,
AffichageDetailsCollaborateurModule,
CollaborateursRoutingModule, CollaborateursRoutingModule,
RouterModule RouterModule
], ],

@ -1,30 +1,24 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import { CollaborateursComponent } from "./collaborateurs.component"; import { CollaborateursComponent } from "./collaborateurs.component";
import { DetailsCollaborateurComponent } from "./details-collaborateur/details-collaborateur.component"; import { DetailsCollaborateurComponent } from "./details-collaborateur/details-collaborateur.component";
import { FormationsCollaboateurComponent } from "./formations-collaborateur/formations-collaborateur.component"; import { FormationsCollaboateurComponent } from "./formations-collaborateur/formations-collaborateur.component";
import { EvaluationComponent } from './formations-collaborateur/details-evaluation/evaluation.component'; import { EvaluationComponent } from './formations-collaborateur/details-evaluation/evaluation.component';
import { EditEvaluationComponent } from './formations-collaborateur/edit-evaluation/edit-evaluation.component'; import { EditEvaluationComponent } from './formations-collaborateur/edit-evaluation/edit-evaluation.component';
import { paths_collaborateurs } from '../shared/utils/paths'; import { paths_collaborateurs } from '@shared/utils/paths';
import { AuthGuard } from '../shared/auth/auth.guard'; import { KeycloakGuard } from '@shared/guards/keycloakguard';
import { Role } from '../shared/utils/roles';
const routes: Routes = [ const routes: Routes = [
{ path:paths_collaborateurs.formations, component: FormationsCollaboateurComponent, canActivate: [AuthGuard] }, { path:'', component: CollaborateursComponent, pathMatch: 'full', canActivate: [KeycloakGuard] },
{ path:paths_collaborateurs.evaluation, component: EvaluationComponent, canActivate: [AuthGuard] }, { path:paths_collaborateurs.formations, component: FormationsCollaboateurComponent, canActivate: [KeycloakGuard] },
{ path:paths_collaborateurs.edit, component: EditEvaluationComponent, canActivate: [AuthGuard] }, { path:paths_collaborateurs.evaluation, component: EvaluationComponent, canActivate: [KeycloakGuard] },
{ path:paths_collaborateurs.get, component: DetailsCollaborateurComponent, canActivate: [AuthGuard] }, { path:paths_collaborateurs.edit, component: EditEvaluationComponent, canActivate: [KeycloakGuard] },
{ { path:paths_collaborateurs.get, component: DetailsCollaborateurComponent, canActivate: [KeycloakGuard] }
path:'',
component: CollaborateursComponent,
canActivate: [AuthGuard],
data: { roles: [Role.assistante, Role.commercial, Role.rh] },
pathMatch: 'full'
}
]; ];

@ -1,3 +1,42 @@
<app-nav-menu></app-nav-menu> <app-nav-menu></app-nav-menu>
<ng-container *ngIf="collaborateur!=undefined">
<h2>{{ collaborateur.prenom }} {{ collaborateur.nom }} </h2>
<affichage-details-collaborateur [idCollaborateur]="idCollaborateur"></affichage-details-collaborateur> <h3>Agence : {{ collaborateur.businessUnit.nom}}</h3>
<h3>Date embauche : {{ collaborateur.dateArrivee}}</h3>
</ng-container>
<ng-container *ngIf="collaborateur==undefined || !eploaded">
<mat-spinner></mat-spinner>
</ng-container>
<ng-container *ngIf= "eploaded && epEffectues.length==0">
<h3> Aucun EP effectué encore </h3>
</ng-container>
<ng-container *ngIf= "eploaded && epEffectues.length!=0">
<h3>Liste des précédents EP</h3>
<mat-table [dataSource]="this.dataSource" matSort>
<ng-container matColumnDef="dateentretien">
<mat-header-cell *matHeaderCellDef mat-sort-header>Date entretient</mat-header-cell>
<mat-cell *matCellDef="let row">{{ row.dateentretien}}</mat-cell>
</ng-container>
<ng-container matColumnDef="referent">
<mat-header-cell *matHeaderCellDef mat-sort-header>Référent</mat-header-cell>
<mat-cell *matCellDef="let row"> {{ row.referent.prenom }} {{ row.referent.nom }}</mat-cell>
</ng-container>
<ng-container matColumnDef="type">
<mat-header-cell *matHeaderCellDef mat-sort-header>Type</mat-header-cell>
<mat-cell *matCellDef="let row">{{ row.type}}</mat-cell>
</ng-container>
<ng-container matColumnDef="details">
<mat-header-cell *matHeaderCellDef mat-sort-header></mat-header-cell>
<mat-cell *matCellDef="let row" [routerLink]="['/ep',row.id]"> Voir détails EP </mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
</mat-table>
</ng-container>

@ -1,20 +1,86 @@
import { Component } from '@angular/core'; import { Component, OnInit, ViewChild, OnDestroy } from '@angular/core';
import { Observable, Subscription } from 'rxjs';
import {ActivatedRoute} from '@angular/router'; import {ActivatedRoute} from '@angular/router';
import {MatTableDataSource} from '@angular/material/table';
import {MatPaginator} from '@angular/material/paginator';
import {MatSort} from '@angular/material/sort';
import { CollaborateursService, EpService } from "@shared/api-swagger/api/api";
import { CollaborateurModel } from "@shared/api-swagger/model/collaborateurModel";
import { EpModel } from "@shared/api-swagger/model/epModel";
import { DisplayEP } from "@shared/displayInfo/displays";
/** /**
* Composant pour gérer l'affichage des détails d'un collaborateur avec ses formations et ses EP
*/ */
@Component({ @Component({
selector: 'app-details-collaborateur', selector: 'app-details-collaborateur',
templateUrl: './details-collaborateur.component.html' templateUrl: './details-collaborateur.component.html'
}) })
export class DetailsCollaborateurComponent { export class DetailsCollaborateurComponent implements OnInit {
//epCollaborateurIdCollaborateurGet
collaborateur: CollaborateurModel;
private collaborateurSubscription : Subscription;
private epSubscription : Subscription;
epEffectues : DisplayEP[];
displayedColumns: string[] = ["dateentretien", "referent", "type", "details"];
dataSource : MatTableDataSource<DisplayEP>;
eploaded = false;
idCollaborateur: any;
/**
* Pagination du tableau.
*/
@ViewChild(MatPaginator) paginator: MatPaginator;
idCollaborateur: string; /**
* Tri par les éléments du tableau selon la colonne choisie.
*/
@ViewChild(MatSort) sort: MatSort;
constructor(private collaborateusrService:CollaborateursService, private epService:EpService, private route: ActivatedRoute) {}
constructor(private route: ActivatedRoute) { ngOnInit() {
this.idCollaborateur = this.route.snapshot.paramMap.get('id'); this.idCollaborateur = this.route.snapshot.paramMap.get('id');
this.collaborateurSubscription = this.collaborateusrService.getCollaborateurById(this.idCollaborateur).subscribe(
collaborateur => this.initCollaborateur(collaborateur[0]),
err => console.log(err)
);
}
initCollaborateur(collaborateur:CollaborateurModel) {
this.collaborateur = collaborateur;
this.epSubscription = this.epService.getEPByCollaborateur(this.idCollaborateur).subscribe(
ep => this.initEP(ep)
)
}
initEP(ep:EpModel[]) {
this.epEffectues = [];
let epDisplay : DisplayEP;
for(let un_ep of ep) {
epDisplay = new DisplayEP();
epDisplay.id = un_ep.id;
epDisplay.referent = un_ep.referent;
epDisplay.etat = un_ep.etat;
epDisplay.type = un_ep.type;
epDisplay.dateentretien = un_ep.dateEntretien;
this.epEffectues.push(epDisplay);
}
this.dataSource = new MatTableDataSource(this.epEffectues);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
this.eploaded = true;
}
ngOnDestroy() {
if(this.epSubscription!= undefined) {
this.epSubscription.unsubscribe();
}
if(this.collaborateurSubscription!= undefined) {
this.collaborateurSubscription.unsubscribe();
}
} }
} }

@ -1,7 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
/** /**
* Composant pour faire affhcier l'évaluation d'une formation d'un collaborateur.
*/ */
@Component({ @Component({
selector: 'app-evaluation ', selector: 'app-evaluation ',

@ -1,7 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
/** /**
* Composant pour permettre à un collaborateur de faire l'évaluation d'une formation
*/ */
@Component({ @Component({
selector: 'app-edit-evaluation', selector: 'app-edit-evaluation',

@ -1,7 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
/** /**
* Composant pour afficher la liste des formations auxquelles à participer le collaborateur.
*/ */
@Component({ @Component({
selector: 'app-formations-collaborateur', selector: 'app-formations-collaborateur',

@ -1,11 +1,2 @@
<app-nav-menu></app-nav-menu> <app-nav-menu></app-nav-menu>
<h2>Liste de vos demandes de délégations en attente</h2> <h1>Liste des demandes de délégations</h1>
<ng-container *ngIf="chargement">
<mat-spinner></mat-spinner>
</ng-container>
<ng-container *ngIf="!chargement">
<p *ngIf="demandesDelegation.length==0">
Aucune demande de délégation en cours.
</p>
<app-demande-delegation *ngFor="let demandeDelegation of demandesDelegation" [demandeDelegation]="demandeDelegation" (eventEmitter)="donnerReponse($event)"></app-demande-delegation>
</ng-container>

@ -1,11 +1,6 @@
import { Component, Inject, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { CollaborateurDTO, DemandeDelegationDTO, DemandesDelegationService, EtatDemande } from '@shared/api-swagger';
import { cles } from '@shared/utils/cles';
import { Subscription } from 'rxjs';
/** /**
* Composant pour faire afficher la liste des demandes de délégation reçues
*/ */
@Component({ @Component({
selector: 'app-demandes-delegation', selector: 'app-demandes-delegation',
@ -13,79 +8,8 @@ import { Subscription } from 'rxjs';
}) })
export class DemandesDelegationComponent implements OnInit { export class DemandesDelegationComponent implements OnInit {
constructor() {}
idCollaborateurConnecte: string = "";
chargement: boolean = true;
demandesDelegation: DemandeDelegationDTO[] = [];
demandeDelegationSubscription: Subscription;
demandeDelegationReponseSubscription: Subscription;
constructor(private demandeDelegationService: DemandesDelegationService, private matDialog: MatDialog) {}
ngOnInit() { ngOnInit() {
this.setIdCollaborateurConnecte();
}
setIdCollaborateurConnecte() {
if(sessionStorage.getItem(cles.sessionKeyConnectee) == undefined) {
setTimeout( () => this.setIdCollaborateurConnecte(), 1000);
}
else {
const collaborateurConnecte: CollaborateurDTO = JSON.parse(sessionStorage.getItem(cles.sessionKeyConnectee));
this.idCollaborateurConnecte = collaborateurConnecte.id;
this.updateListeDemandesDelegation();
}
}
/**
* Cette fonction permet de mettre à jour l'affichage de la liste des demande de délégation
*/
updateListeDemandesDelegation() {
this.chargement = false;
this.demandeDelegationSubscription = this.demandeDelegationService.getDemandesDelegationReferent(this.idCollaborateurConnecte).subscribe(
demandeDelegations => this.demandesDelegation = demandeDelegations,
err => console.log(err)
);
} }
donnerReponse(event: DemandeDelegationDTO) {
console.log(event);
const id: number = event.id;
this.demandeDelegationReponseSubscription = this.demandeDelegationService.updateDemandeDelegation(event, event.id).subscribe(
() => {
let data: any = {
acceptee: false
};
if(event.etatDemande == EtatDemande.Validee) {
data.acceptee = true,
data.ep = event.ep
}
this.demandesDelegation = this.demandesDelegation.filter(d => d.id != id);
this.matDialog.open(DialogValidationReponse, {data:data});
},
err => console.log(err)
);
}
ngOnDestroy() {
if(this.demandeDelegationSubscription != undefined) {
this.demandeDelegationSubscription.unsubscribe();
}
if(this.demandeDelegationReponseSubscription != undefined) {
this.demandeDelegationReponseSubscription.unsubscribe();
}
}
}
@Component({
selector: "dialog-validation-reponse",
templateUrl: "./dialog-validation-reponse.html"
})
export class DialogValidationReponse {
constructor(@Inject(MAT_DIALOG_DATA)public data: any, private matDialog: MatDialogRef<DialogValidationReponse>) {}
fermer() {this.matDialog.close();}
} }

@ -8,15 +8,13 @@ import { MaterialModule } from "@shared/angular-material/angular-material.module
import {NavMenuModule} from '@shared/nav-menu/nav-menu.module'; import {NavMenuModule} from '@shared/nav-menu/nav-menu.module';
import { DemandesDelegationComponent, DialogValidationReponse } from './demandes-delegation.component'; import { DemandesDelegationComponent } from './demandes-delegation.component';
import { DemandeDelegationComponent, DialogReponseDemandeDelegation } from './details-demande-delegation/demande-delegation.component'; import { DemandeDelegationComponent } from './details-demande-delegation/demande-delegation.component';
import { DemandesDelegationRoutingModule } from './demandes-delegation.routing.module'; import { DemandesDelegationRoutingModule } from './demandes-delegation.routing.module';
@NgModule({ @NgModule({
declarations: [ declarations: [ DemandesDelegationComponent, DemandeDelegationComponent
DemandesDelegationComponent, DemandeDelegationComponent,
DialogReponseDemandeDelegation, DialogValidationReponse
], ],
exports: [ DemandesDelegationComponent exports: [ DemandesDelegationComponent
], ],
@ -24,9 +22,8 @@ import { DemandesDelegationRoutingModule } from './demandes-delegation.routing.m
MaterialModule, MaterialModule,
NavMenuModule, NavMenuModule,
DemandesDelegationRoutingModule, DemandesDelegationRoutingModule,
RouterModule, RouterModule
FormsModule,
CommonModule
], ],
}) })
export class DemandesDelegationModule {} export class DemandesDelegationModule {}

@ -3,19 +3,23 @@ import { Routes, RouterModule } from '@angular/router';
import { DemandesDelegationComponent } from "./demandes-delegation.component"; import { DemandesDelegationComponent } from "./demandes-delegation.component";
import { DemandeDelegationComponent } from "./details-demande-delegation/demande-delegation.component";
import { AuthGuard } from '@shared/auth/auth.guard'; import { KeycloakGuard } from '@shared/guards/keycloakguard';
import { paths_demandes_delegation } from "@shared/utils/paths";
/**
* Routes du module demandes delegation
*/
const routes: Routes = [ const routes: Routes = [
{ {
path:'', path:'',
component: DemandesDelegationComponent, component: DemandesDelegationComponent,
pathMatch: 'full', pathMatch: 'full',
canActivate: [AuthGuard] canActivate: [KeycloakGuard]
},
{
path: paths_demandes_delegation.get,
component: DemandeDelegationComponent,
canActivate: [KeycloakGuard]
} }
]; ];

@ -1,15 +1,2 @@
<mat-card> <app-nav-menu></app-nav-menu>
<mat-card-header> <h1> Demande delegation </h1>
<mat-card-title>{{demandeDelegation.ep.collaborateur.nom}} {{demandeDelegation.ep.collaborateur.prenom}}</mat-card-title>
</mat-card-header>
<mat-card-content>
<p>Demande effectuée le {{ demandeDelegation.dateDemande | date: 'dd/MM/yyyy'}} par {{demandeDelegation.ep.referent.nom}} {{demandeDelegation.ep.referent.prenom}} </p>
<p *ngIf="demandeDelegation.ep.datePrevisionnelle == undefined"> {{demandeDelegation.ep.type}} en attente d'une date</p>
<p *ngIf="demandeDelegation.ep.datePrevisionnelle != undefined"> {{demandeDelegation.ep.type}} prévu le {{demandeDelegation.ep.datePrevisionnelle | date : 'dd/MM/yyyy'}} </p>
</mat-card-content>
<mat-card-footer>
<button mat-raised-button (click)="repondreALaDemande(etatDemande.Validee)" color="primary">Accepter la demande</button>
<button mat-raised-button (click)="repondreALaDemande(etatDemande.Rejetee)" color="warn">Refuser la demande</button>
</mat-card-footer>
</mat-card>

@ -1,117 +1,15 @@
import { i18nMetaToJSDoc } from '@angular/compiler/src/render3/view/i18n/meta'; import { Component, OnInit } from '@angular/core';
import { Component, EventEmitter, Inject, Input, OnInit, Output } from '@angular/core';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { DemandeDelegationDTO, DemandeEPIDTO, EtatDemande } from '@shared/api-swagger';
import { BrowserStack } from 'protractor/built/driverProviders';
import { Subscription } from 'rxjs';
/** /**
* Composant pour faire afficher les détails d'une demande de délégation
*/ */
@Component({ @Component({
selector: 'app-demande-delegation', selector: 'app-demande-delegation',
templateUrl: './demande-delegation.component.html' templateUrl: './demande-delegation.component.html'
}) })
export class DemandeDelegationComponent implements OnInit { export class DemandeDelegationComponent implements OnInit {
@Input() demandeDelegation: DemandeDelegationDTO;
@Output() eventEmitter: EventEmitter<any> = new EventEmitter<any>();
etatDemande: any = EtatDemande;
dialogSubscription: Subscription;
constructor(private matDialog: MatDialog) {} constructor() {}
ngOnInit() { ngOnInit() {
} }
accepter() {
this.repondreALaDemande(EtatDemande.Validee);
}
repondreALaDemande(etatDemande: EtatDemande) {
const data : any = {
etatDemande : etatDemande,
demandeDelegation : this.demandeDelegation
};
const dialogRef: MatDialogRef<DialogReponseDemandeDelegation> = this.matDialog.open(DialogReponseDemandeDelegation, {data: data})
this.dialogSubscription = dialogRef.afterClosed().subscribe(
reponse => {
if(reponse.engistree) {
this.eventEmitter.emit(reponse.demandeDelegation);
}
}
);
}
ngOnDestroy() {
if(this.dialogSubscription != undefined) {
this.dialogSubscription.unsubscribe();
}
}
}
@Component({
selector: "dialog-reponse-demande-delegation",
templateUrl: "./dialog-reponse-demande-delegation.html"
})
export class DialogReponseDemandeDelegation {
/**
* Texte à afficher lors de la réponse à une demande de délégation. Le texte dépend de si la demande va être acceptée ou bien refusée.
*/
texte: string ="";
/**
* Indique si la réponse est un refus.
*/
estRefus: boolean = false;
raisonRefus: string;
/**
* Contient l'information indiquant si la réponse a é validé et doit être enregistré ou non et la demande de délégation cible.
*/
reponse: any = {
engistree: false
}
constructor(@Inject(MAT_DIALOG_DATA) public data, private dialogRef: MatDialogRef<DialogReponseDemandeDelegation>) {
switch(data.etatDemande) {
case EtatDemande.Validee:
this.texte = "Souhaitez-vous vraiment accepter la demande de délégation et devenir le nouveau référent de l'EP ?";
break;
case EtatDemande.Rejetee:
this.texte = "Souhaitez-vous vraiment refuser la demande de délégation ?";
this.estRefus = true;
break;
}
}
enregistrer() {
if(this.estRefus && this.raisonRefus == "")
return;
let demandeDelegation: DemandeDelegationDTO = this.data.demandeDelegation;
demandeDelegation.etatDemande = this.data.etatDemande;
demandeDelegation.raisonRefus = this.raisonRefus;
this.reponse = {
engistree: true,
demandeDelegation: demandeDelegation
}
this.fermer();
}
fermer() {
this.dialogRef.close(this.reponse);
}
} }

@ -1,9 +0,0 @@
<p>{{texte}}</p>
<div>
<mat-form-field *ngIf="estRefus" appearance="fill">
<mat-label>Raison du refus</mat-label>
<textarea matInput [(ngModel)]="raisonRefus"></textarea>
</mat-form-field>
</div>
<button mat-raised-button (click)="enregistrer()" color="primary">Enregister la réponse</button>
<button mat-raised-button (click)="fermer()" color="warn">Annuler</button>

@ -1,4 +0,0 @@
<p>Votre réponse à la demande de délégation a bien été enregistrée</p>
<button *ngIf="data.acceptee" (click)="fermer()" [routerLink]="['/ep', data.ep.id]" mat-raised-button>Accéder à l'EP</button>
<button mat-raised-button (click)="fermer()">Fermer</button>

@ -1,3 +1,2 @@
<app-nav-menu></app-nav-menu> <app-nav-menu></app-nav-menu>
<h1>Liste des demandes de formation </h1> <h1>Liste des demandes de formation </h1>
<demandes-formation-table [displayedColumns]="displayedColumns" (eventEmitter)="afficherDetailDemandeFormation($event)"></demandes-formation-table>

@ -1,11 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { DemandeFormationDTO } from '@shared/api-swagger';
import { DialogDemandeFormationComponent } from './mat-dialog/dialog-demande-formation.component';
/** /**
* Composant pour faire afficher la liste des demandes de formations
* Les RH pourront valider ou refuser les demandes
*/ */
@Component({ @Component({
selector: 'app-demandes-formation', selector: 'app-demandes-formation',
@ -13,16 +8,8 @@ import { DialogDemandeFormationComponent } from './mat-dialog/dialog-demande-for
}) })
export class DemandesFormationComponent implements OnInit { export class DemandesFormationComponent implements OnInit {
displayedColumns : string[] = ["businessunit", "collaborateur", "datedemande", "demanderh", "ep", "etat", "datereponse"]; constructor() {}
constructor(private dialog: MatDialog) {}
ngOnInit() { ngOnInit() {
} }
afficherDetailDemandeFormation(demandeFormation: DemandeFormationDTO) {
const datas = { data: demandeFormation, width: "80%", height: '80%'};
this.dialog.open(DialogDemandeFormationComponent, datas);
}
} }

@ -1,40 +1,32 @@
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { NgModule } from "@angular/core"; import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common"; import { CommonModule } from "@angular/common";
import { MaterialModule } from "@shared/angular-material/angular-material.module"; import { MaterialModule } from "@shared/angular-material/angular-material.module";
import {NavMenuModule} from '@shared/nav-menu/nav-menu.module'; import {NavMenuModule} from '@shared/nav-menu/nav-menu.module';
import { DemandesFormationComponent } from './demandes-formation.component'; import { DemandesFormationComponent } from './demandes-formation.component';
import { DialogDemandeFormationComponent } from './mat-dialog/dialog-demande-formation.component';
import { DemandeFormationComponent } from './details-demande-formation/demande-formation.component' import { DemandeFormationComponent } from './details-demande-formation/demande-formation.component'
import { NewDemandeFormationComponent } from './new-demande-formation/new-demande-formation.component' import { NewDemandeFormationComponent } from './new-demande-formation/new-demande-formation.component'
import { DemandesFormationsRoutingModule } from './demandes-formation.routing.module'; import { DemandesFormationsRoutingModule } from './demandes-formation.routing.module';
import { MatTablesModule } from "@shared/mat-tables/mat-tables.module";
/**
* Module demandes formation
*/
@NgModule({ @NgModule({
declarations: [ DemandesFormationComponent, DialogDemandeFormationComponent, DemandeFormationComponent, declarations: [ DemandesFormationComponent, DemandeFormationComponent,
NewDemandeFormationComponent NewDemandeFormationComponent
], ],
exports: [ exports: [
DemandesFormationComponent DemandesFormationComponent
], ],
imports: [ imports: [
CommonModule,
MaterialModule, MaterialModule,
NavMenuModule, NavMenuModule,
DemandesFormationsRoutingModule, DemandesFormationsRoutingModule,
MatTablesModule, RouterModule
RouterModule,
FormsModule,
ReactiveFormsModule
], ],
}) })
export class DemandesFormationModule {} export class DemandesFormationModule {}

@ -6,17 +6,14 @@ import { DemandesFormationComponent } from "./demandes-formation.component";
import { DemandeFormationComponent } from "./details-demande-formation/demande-formation.component"; import { DemandeFormationComponent } from "./details-demande-formation/demande-formation.component";
import { NewDemandeFormationComponent } from "./new-demande-formation/new-demande-formation.component"; import { NewDemandeFormationComponent } from "./new-demande-formation/new-demande-formation.component";
import { AuthGuard } from '../shared/auth/auth.guard'; import { KeycloakGuard } from '@shared/guards/keycloakguard';
import { paths_demandes_formation } from "../shared/utils/paths"; import { paths_demandes_formation } from "@shared/utils/paths";
/**
* Routes du module demandes formation
*/
const routes: Routes = [ const routes: Routes = [
{ path:paths_demandes_formation.new, component: NewDemandeFormationComponent, canActivate: [AuthGuard] }, { path:'', component: DemandesFormationComponent, pathMatch: 'full', canActivate: [KeycloakGuard] },
{ path:paths_demandes_formation.get, component: DemandeFormationComponent, canActivate: [AuthGuard] }, { path:paths_demandes_formation.new, component: NewDemandeFormationComponent, canActivate: [KeycloakGuard] },
{ path:'', component: DemandesFormationComponent, pathMatch: 'full', canActivate: [AuthGuard] } { path:paths_demandes_formation.get, component: DemandeFormationComponent, canActivate: [KeycloakGuard] }
]; ];

@ -1,8 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
/** /**
* Composant pour afficher les détails d'une demandes de formation
* (peut ne pas être utile)
*/ */
@Component({ @Component({
selector: 'app-demande-formation', selector: 'app-demande-formation',

@ -1,31 +0,0 @@
<h3>Détails de la demande</h3>
<p><button mat-stroked-button (click)="fermer()" [routerLink]="['/collaborateurs', collaborateur.id]"> Collaborateur: {{collaborateur.nom}} {{collaborateur.prenom}}</button></p>
<p> <button mat-stroked-button (click)="fermer()" [routerLink]="['/referents', referent.id]">Référent: {{referent.nom}} {{referent.prenom}}</button></p>
<p><button mat-stroked-button (click)="fermer()" [routerLink]="['/ep',ep.id]">Voir EP effectué le {{ ep.datePrevisionnelle | date: 'dd/MM/yyyy' }} </button></p>
<p>Libellé : {{ data.libelle}}</p>
<p>Description: {{ data.description }}</p>
<p>Demande RH: {{ afficherDemandeRH(data.demandeRH) }}</p>
<p>Date demande: {{ data.dateDemande | date: 'dd/MM/yyyy' }} </p>
<p>Etat : {{ afficherEtat(data.etatDemande) }}</p>
<p *ngIf="data.etatDemande == etatDemande.Rejetee"> Raison du refus : {{data.commentaireRefus}}</p>
<ng-container *ngIf="data.etatDemande == etatDemande.EnAttente">
<button mat-raised-button (click)="repondre()">Répondre à la demande de formation</button>
<ng-container *ngIf="donnerReponse">
<mat-slide-toggle [(ngModel)]="demandeValidee">
Demande validée
</mat-slide-toggle>
<div>
<mat-form-field *ngIf="!demandeValidee" appearance="fill">
<mat-label>Raison du refus</mat-label>
<textarea matInput [(ngModel)]="commentaireRefus"></textarea>
</mat-form-field>
</div>
<button mat-raised-button (click)="updateDemandeFormation()">Valider le choix</button>
</ng-container>
</ng-container>
<button mat-raised-button (click)="fermer()">Fermer</button>

@ -1,79 +0,0 @@
import { Component, Inject } from "@angular/core";
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog";
import { MatSnackBar } from "@angular/material/snack-bar";
import { CollaborateurDTO, EpInformationDTO, DemandesFormationService, DemandeFormationDTO, EtatDemande, afficherEtatDemande } from "@shared/api-swagger";
import { Subscription } from "rxjs";
@Component( {
selector: "dialog-demande-formation",
templateUrl: "dialog-demande-formation.component.html"
})
export class DialogDemandeFormationComponent {
ep: EpInformationDTO;
collaborateur: CollaborateurDTO;
referent: CollaborateurDTO;
etatDemande: any = EtatDemande;
engagementsSubscription: Subscription;
donnerReponse: boolean = false;
commentaireRefus : string = "";
demandeValidee: boolean = true;
constructor(private dialogRef : MatDialogRef<DialogDemandeFormationComponent>, @Inject(MAT_DIALOG_DATA) public data : DemandeFormationDTO, private demandesFormationService: DemandesFormationService,
private snackBar: MatSnackBar){
this.ep = data.ep;
this.collaborateur = data.ep.collaborateur;
this.referent = data.ep.referent;
}
updateDemandeFormation() {
let demandeFormation : DemandeFormationDTO = this.data;
if(this.demandeValidee) {
demandeFormation.etatDemande = EtatDemande.Validee;
}
else {
if(this.commentaireRefus.length == 0) {
this.snackBar.open("Vous devez justifier le refus de la demande de formation.", "Attention", {
duration: 5000,
horizontalPosition: "center",
verticalPosition: "top",
});
return;
}
demandeFormation.commentaireRefus = this.commentaireRefus;
demandeFormation.etatDemande = EtatDemande.Rejetee;
}
this.engagementsSubscription = this.demandesFormationService.updateDemandeFormation(demandeFormation, demandeFormation.id).subscribe(
() => location.reload(),
err => console.log(err)
);
}
afficherDemandeRH(demandeRH: boolean) {
if (demandeRH)
return 'Oui';
else
return 'Non'
}
afficherEtat(etat: EtatDemande) {
return afficherEtatDemande(etat);
}
fermer() {
this.dialogRef.close();
}
repondre() {
this.donnerReponse = true;
}
ngOnDestroy() {
if(this.engagementsSubscription != null) {
this.engagementsSubscription.unsubscribe();
}
}
}

@ -1,35 +1,2 @@
<app-nav-menu></app-nav-menu> <app-nav-menu></app-nav-menu>
<h1> Nouvelle demande de formation </h1> <h1> Nouvelle demande de formation </h1>
<!-- Le formulaire -->
<form [formGroup]="demandeFormationForm" (ngSubmit)="ajouterDemandeFormation()">
<div>
<!-- Attribut : libelle -->
<mat-form-field class="input">
<input matInput placeholder="Libellé" formControlName="libelle">
</mat-form-field>
</div>
<div>
<!-- Attribut : description -->
<mat-form-field class="input">
<input matInput placeholder="Description" formControlName="description">
</mat-form-field>
</div>
<div>
<!-- Attribut : origine -->
<mat-form-field class="input">
<mat-label>Origine de la demande</mat-label>
<mat-select formControlName="origine">
<mat-option *ngFor="let o of originesDemandeFormation" [value]="o">{{o.libelle}}</mat-option>
</mat-select>
</mat-form-field>
</div>
<div>
<button mat-raised-button>Ajouter une demande de formation</button>
</div>
</form>

@ -1,80 +1,15 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Observable, Subscription } from 'rxjs';
import { Router } from '@angular/router';
import { FormBuilder, FormGroup, FormControl, } from '@angular/forms';
import { OrigineDemandeFormationDTO, EtatDemande } from "@shared/api-swagger/model/models";
import { DemandesFormationService } from "@shared/api-swagger/api/api";
/** /**
* Composant qui sert à créer une demande de formation pour un collaborateur.
*/ */
@Component({ @Component({
selector: 'app-new-demande-formation', selector: 'app-new-demande-formation',
templateUrl: './new-demande-formation.component.html', templateUrl: './new-demande-formation.component.html'
styleUrls: ['./new-demande-formation.component.scss']
}) })
export class NewDemandeFormationComponent implements OnInit { export class NewDemandeFormationComponent implements OnInit {
/** constructor() {}
* Observable pour enregistrer la nouvelle formation
*/
demandeFormationSubscription: Subscription;
/**
* Observable pour récupérer la liste des origines formation
*/
origineDemandeSubscription: Subscription;
/**
* Liste des origines de demande de formation à faire afficher dans une liste déroulante.
*/
originesDemandeFormation: OrigineDemandeFormationDTO[];
/**
* FormBuilder qui sera lié au formulaire du template avec les attributs d'une formation
* C'est dans cet objet qu'est stockée la nouvelle formation
*/
demandeFormationForm = this.fb.group(
{
id:[0],
libelle: [""],
description: [],
demandeRH: [true],
dateDemande: [new Date()],
etatDemande: [EtatDemande.EnAttente],
origine: [""],
collaborateur: [""],
}
);
constructor(private fb: FormBuilder, private demandesFormationService: DemandesFormationService, private router: Router) { }
ngOnInit() { ngOnInit() {
this.origineDemandeSubscription = this.demandesFormationService.getOriginesDemandeFormation().subscribe(
originesDemandeFormation => this.originesDemandeFormation = originesDemandeFormation,
err => console.log(err)
);
}
ajouterDemandeFormation() {
this.demandeFormationSubscription = this.demandesFormationService.addDemandeFormation(this.demandeFormationForm.getRawValue()).subscribe(
response => {
console.log(response);
this.router.navigate(['/demandesformation',response["id"]]);
}
);
}
ngOnDestroy() {
if(this.demandeFormationSubscription != undefined) {
this.demandeFormationSubscription.unsubscribe();
}
if(this.origineDemandeSubscription != undefined) {
this.origineDemandeSubscription.unsubscribe();
}
} }
} }

@ -1,30 +0,0 @@
<h3>Détails de l'engagement</h3>
<p><button mat-stroked-button (click)="fermer()" [routerLink]="['/collaborateurs', collaborateur.id]"> Collaborateur: {{collaborateur.nom}} {{collaborateur.prenom}}</button></p>
<p> <button mat-stroked-button (click)="fermer()" [routerLink]="['/referents', referent.id]">Référent: {{referent.nom}} {{referent.prenom}}</button></p>
<p><button mat-stroked-button (click)="fermer()" [routerLink]="['/ep',ep.id]">Voir EP effectué le {{ ep.datePrevisionnelle | date: 'dd/MM/yyyy' }} </button></p>
<p>Action : {{ data.action}}</p>
<p>Modalité: {{ data.modalite }}</p>
<p>Date limite: {{ data.dateLimite | date: 'dd/MM/yyyy' }} </p>
<p>Etat : {{ afficherEtat(data.etatEngagement) }}</p>
<p *ngIf="data.etatEngagement == etatEngagement.NonRealisable"> Raison non réalisable : {{data.raisonNonRealisable}}</p>
<ng-container *ngIf="data.etatEngagement == etatEngagement.EnAttente">
<button mat-raised-button (click)="repondre()">Répondre à l'engagement</button>
<ng-container *ngIf="donnerReponse">
<mat-slide-toggle [(ngModel)]="engagementRespecte">
Engagement respecté
</mat-slide-toggle>
<div>
<mat-form-field *ngIf="!engagementRespecte" appearance="fill">
<mat-label>Raison du refus</mat-label>
<textarea matInput [(ngModel)]="raisonRefus"></textarea>
</mat-form-field>
</div>
<button mat-raised-button (click)="mettreAJourEngagement()">Valider le choix</button>
</ng-container>
</ng-container>
<button mat-raised-button (click)="fermer()">Fermer</button>

@ -1,94 +0,0 @@
import { Component, Inject } from "@angular/core";
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog";
import { MatSnackBar } from "@angular/material/snack-bar";
import { CollaborateurDTO, EngagementDTO, EngagementsService, EpInformationDTO, EtatEngagement, afficherEtatEngagement } from "@shared/api-swagger";
import { Subscription } from "rxjs";
/**
* Composant pour afficher la liste des engagements EP
*/
@Component({
selector: "app-engagements",
templateUrl: "./engagements.html"
})
export class EngagementsComponent {
displayedColumns : string[] = ["businessunit", "collaborateur", "action", "dispositif", "modalite", "datelimite", "etat"];
constructor(private dialog: MatDialog) {}
afficherDetailsEngagements(engagement: EngagementDTO) {
const datas = { data: engagement, width: "80%", height: '80%'};
this.dialog.open(DialogEngagementsComponent, datas);
}
}
/**
* Dialog pour afficher les détails d'un engagement et y donner une réponse si possible
*/
@Component( {
selector: "dialog-engagements",
templateUrl: "dialog-engagements.html"
})
export class DialogEngagementsComponent {
ep: EpInformationDTO;
collaborateur: CollaborateurDTO;
referent: CollaborateurDTO;
etatEngagement: any = EtatEngagement;
engagementsSubscription: Subscription;
/**
* Indique si l'on souhaite donner une réponse à l'engagement encore en cours ou non
*/
donnerReponse: boolean = false;
raisonRefus : string = "";
engagementRespecte: boolean = true;
constructor(private dialogRef : MatDialogRef<DialogEngagementsComponent>, @Inject(MAT_DIALOG_DATA) public data : EngagementDTO, private engagementsService: EngagementsService,
private snackBar: MatSnackBar){
this.ep = data.ep;
this.collaborateur = data.ep.collaborateur;
this.referent = data.ep.referent;
}
mettreAJourEngagement() {
let engagement : EngagementDTO = this.data;
if(this.engagementRespecte) {
engagement.etatEngagement = EtatEngagement.Respecte;
}
else {
if(this.raisonRefus.length == 0) {
this.snackBar.open("Vous devez justifier le refus de respecter l'engagement.", "Attention", {
duration: 5000,
horizontalPosition: "center",
verticalPosition: "top",
});
return;
}
engagement.raisonNonRealisable = this.raisonRefus;
engagement.etatEngagement = EtatEngagement.NonRealisable;
}
this.engagementsSubscription = this.engagementsService.updateEngagement(engagement, engagement.id).subscribe(
() => location.reload(),
err => console.log(err)
);
}
afficherEtat(etat: EtatEngagement) {
return afficherEtatEngagement(etat);
}
fermer() {
this.dialogRef.close();
}
repondre() {
this.donnerReponse = true;
}
ngOnDestroy() {
if(this.engagementsSubscription != null) {
this.engagementsSubscription.unsubscribe();
}
}
}

@ -1,5 +0,0 @@
<app-nav-menu></app-nav-menu>
<h2>Liste des engagements</h2>
<engagements-table [displayedColumns]="displayedColumns" (eventEmitter)="afficherDetailsEngagements($event)"></engagements-table>

@ -1,30 +0,0 @@
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { RouterModule } from '@angular/router';
import { MaterialModule } from "@shared/angular-material/angular-material.module";
import {NavMenuModule} from '@shared/nav-menu/nav-menu.module';
import { DialogEngagementsComponent, EngagementsComponent } from "./engagements.component";
import { EngagementsRoutingModule } from "./engagements.routing.module";
import { MatTablesModule } from "@shared/mat-tables/mat-tables.module";
import { FormsModule } from "@angular/forms";
@NgModule({
declarations: [
EngagementsComponent, DialogEngagementsComponent
],
exports: [],
imports: [
CommonModule,
RouterModule,
NavMenuModule,
EngagementsRoutingModule,
MatTablesModule,
MaterialModule,
FormsModule
],
})
export class EngagementsModule {}

@ -1,19 +0,0 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { EngagementsComponent } from "./engagements.component";
import { AuthGuard } from '@shared/auth/auth.guard';
const routes: Routes = [
{ path: '', component: EngagementsComponent, pathMatch: 'full', canActivate: [AuthGuard]}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class EngagementsRoutingModule {}

@ -1,2 +0,0 @@
export * from './engagements.component';
export * from './engagements.module';

@ -1,7 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
/** /**
* Composant permettant la saisie d'un EP
*/ */
@Component({ @Component({
selector: 'app-ep-saisie', selector: 'app-ep-saisie',

@ -14,9 +14,6 @@ import { EpaSixAnsSaisieComponent } from './epa-six-ans-saisie/epa-six-ans-saisi
import { EpSaisieRoutingModule } from './ep-saisie.routing.module'; import { EpSaisieRoutingModule } from './ep-saisie.routing.module';
/**
* Module de la saisie de l'EP
*/
@NgModule({ @NgModule({
declarations: [EpSaisieComponent, EpsSaisieComponent, EpaSaisieComponent, declarations: [EpSaisieComponent, EpsSaisieComponent, EpaSaisieComponent,
EpaSixAnsSaisieComponent EpaSixAnsSaisieComponent

@ -7,25 +7,28 @@ import { EpsSaisieComponent } from "./eps-saisie/eps-saisie.component";
import { EpaSaisieComponent } from "./epa-saisie/epa-saisie.component"; import { EpaSaisieComponent } from "./epa-saisie/epa-saisie.component";
import { EpaSixAnsSaisieComponent } from "./epa-six-ans-saisie/epa-six-ans-saisie.component"; import { EpaSixAnsSaisieComponent } from "./epa-six-ans-saisie/epa-six-ans-saisie.component";
import { AuthGuard } from '../shared/auth/auth.guard'; import { KeycloakGuard } from '@shared/guards/keycloakguard';
import { paths_saisie_ep } from "../shared/utils/paths"; import { paths_saisie_ep } from "@shared/utils/paths";
/**
* Routes du module saisie ep
*/
const routes: Routes = [ const routes: Routes = [
{ path:'', { path:'',
component: EpSaisieComponent, component: EpSaisieComponent,
canActivate: [AuthGuard], canActivate: [KeycloakGuard],
children: [ children: [
{ path:paths_saisie_ep.epa, component: EpaSaisieComponent, canActivate: [AuthGuard] }, { path:paths_saisie_ep.epa, component: EpaSaisieComponent, canActivate: [KeycloakGuard] },
{ path:paths_saisie_ep.eps, component: EpsSaisieComponent, canActivate: [AuthGuard] }, { path:paths_saisie_ep.eps, component: EpsSaisieComponent, canActivate: [KeycloakGuard] },
{ path:paths_saisie_ep.epa6ans, component: EpaSixAnsSaisieComponent, canActivate: [AuthGuard] } { path:paths_saisie_ep.epa6ans, component: EpaSixAnsSaisieComponent, canActivate: [KeycloakGuard] }
] ]
} }
]; ];
/*
/saisie-ep
/saisie-ep/eps
/saisie-ep/epa
/saisie-ep/epasixans
*/
@NgModule({ @NgModule({
imports: [RouterModule.forChild(routes)], imports: [RouterModule.forChild(routes)],

@ -1,7 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
/** /**
* Composant pour saisir le document EPA
*/ */
@Component({ @Component({
selector: 'app-epa-saisie', selector: 'app-epa-saisie',

@ -1,7 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
/** /**
* Composant pour saisir le document EPA des six ans
*/ */
@Component({ @Component({
selector: 'app-epa-six-ans-saisie', selector: 'app-epa-six-ans-saisie',

@ -1,7 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
/** /**
* Composant permettant la saisie du document EPS
*/ */
@Component({ @Component({
selector: 'app-eps-saisie', selector: 'app-eps-saisie',

@ -1,97 +0,0 @@
<app-nav-menu></app-nav-menu>
<div *ngIf="ep!=undefined" class="detailsep">
<p> Collaborateur : {{ep.collaborateur.nom}} {{ep.collaborateur.prenom}} ({{ep.collaborateur.businessUnit.nom}}) <button mat-stroked-button [routerLink]="['/collaborateurs',ep.collaborateur.id]">Accéder au détails collaborateur</button></p>
<p> Référent : {{ep.referent.nom}} {{ep.referent.prenom}} </p>
<p> Entretien le : {{ep.datePrevisionnelle | date: 'dd/MM/yyyy'}}</p>
<p> Statut : {{afficherTypeEP(ep.statut)}}</p>
<button mat-raised-button color="primary" title="Valider le déroulement de l'entretien">Valider entretien</button>
<button mat-raised-button color="primary" title="Signer l'EP">Signer</button>
<mat-tab-group mat-align-tabs="start">
<mat-tab label="Les objectifs">
<ep-objectifs [ep]="ep"></ep-objectifs>
</mat-tab>
<mat-tab label="La saisie">
<mat-vertical-stepper class="saisie" linear #stepper>
<mat-step label="Mission/Projet" completed="true">
</mat-step>
<mat-step label="Compétences générales" completed="true">
</mat-step>
<mat-step label="Compétences techniques" completed="true">
</mat-step>
<mat-step label="Apside" completed="true">
</mat-step>
<mat-step label="Demande d'augmentation salaire" completed="true">
</mat-step>
<mat-step label="Formation effectuée" completed="true">
</mat-step>
<mat-step label="Evolution du collaborateur" completed="true">
</mat-step>
</mat-vertical-stepper>
</mat-tab>
<mat-tab label="Les engagements" *ngIf="afficherDemandesFormationEtEngagements()">
<ep-engagements [engagements]="ep.engagements"></ep-engagements>
</mat-tab>
<mat-tab label="Les demandes de formation" *ngIf="afficherDemandesFormationEtEngagements()">
<ep-demandes-formation [demandesFormation]="ep.demandesFormation"></ep-demandes-formation>
</mat-tab>
<mat-tab label="Commentaire assistant">
<ep-commentaires-assistant [ep]="ep" [collaborateurConnecte]="collaborateurConnecte"></ep-commentaires-assistant>
</mat-tab>
<mat-tab label="Choix de dates" *ngIf="afficherChoixDates()" >
<ep-choix-date [rdvsEntretien]="ep.propositionsEntretien"></ep-choix-date>
</mat-tab>
<mat-tab label="Proposition de date" *ngIf="epNonEffectue()">
<ep-propositions-dates [choixTypeEntretien]="ep.choixTypeEntretien"></ep-propositions-dates>
</mat-tab>
<mat-tab label="Demande délégation" *ngIf="epNonEffectue()">
<ep-demande-delegation [demande]="ep.demandesDelegation"></ep-demande-delegation>
</mat-tab>
<mat-tab label="Les participants">
<ep-participants [ep]="ep"></ep-participants>
</mat-tab>
</mat-tab-group>
</div>
<ng-container *ngIf="ep==undefined">
<mat-spinner></mat-spinner>
</ng-container>
<!--
<ng-container *ngIf="ep == undefined" >
<mat-spinner></mat-spinner>
</ng-container>
<ng-container *ngIf="ep != undefined">
<p> Collaborateur : {{ep.collaborateur.nom + " " + ep.collaborateur.prenom}}</p>
<p *ngIf="ep.referent != undefined"> Référent : {{ep.referent.nom + " " + ep.referent.prenom}}</p>
<p *ngIf="ep.referent == undefined"> Aucun référent pour </p>
<p> Entretien le : {{ep.datePrevisionnelle }}</p>
</ng-container>
-->

@ -1,4 +0,0 @@
/*.saisie {
overflow-y: scroll;
height: 100%;
}*/

@ -1,72 +0,0 @@
import { Component, OnInit } from "@angular/core";
import { ActivatedRoute } from "@angular/router";
import { affichageStatut, EpDTO, EpService, StatutEp, estEPEnCours, estEPSigne, estEPEnAttenteSignatureCollaborateur, estEPEffectue, CollaborateurDTO } from "@shared/api-swagger";
import { AuthService } from "@shared/auth/auth.service";
import { cles } from "@shared/utils/cles";
import { Role } from "@shared/utils/roles";
import { Subscription } from "rxjs";
/**
* Composant pour afficher les détails d'un EP
*/
@Component({
selector : "details-ep",
templateUrl: "./details-ep.component.html",
styleUrls: ["./details-ep.component.scss"]
})
export class DetailsEPComponent implements OnInit {
epSubscription : Subscription;
idEp: any;
role : Role;
roleUtilisateur: string;
collaborateurConnecte : CollaborateurDTO;
ep : EpDTO;
constructor(private epService : EpService, private route : ActivatedRoute, private authService: AuthService) {
this.roleUtilisateur = authService.firstRole;
}
ngOnInit() {
this.idEp = this.route.snapshot.paramMap.get("id");
this.epSubscription = this.epService.getEPById(this.idEp).subscribe(
ep => {
this.ep = ep;
console.log(this.ep);
},
err => console.log(err)
);
this.setCollaborateurConnecte();
}
setCollaborateurConnecte() {
if(sessionStorage.getItem(cles.sessionKeyConnectee) == undefined) {
setTimeout( () => this.setCollaborateurConnecte(), 1000);
}
else {
this.collaborateurConnecte = JSON.parse(sessionStorage.getItem(cles.sessionKeyConnectee));
}
}
afficherDemandesFormationEtEngagements() {
return estEPSigne(this.ep.statut) || estEPEnAttenteSignatureCollaborateur(this.ep.statut);
}
afficherTypeEP(statutEP: StatutEp) {
return affichageStatut(statutEP);
}
afficherChoixDates() {
return this.ep.statut == StatutEp.DatesProposees;
}
epNonEffectue() {
return estEPEnCours(this.ep.statut) && !estEPEnAttenteSignatureCollaborateur(this.ep.statut) && !estEPEffectue(this.ep.statut);
}
}

@ -1,8 +0,0 @@
<h3>Choisir une date</h3>
<mat-radio-group class="radio-rdv" [(ngModel)]="choixRdv">
<mat-radio-button *ngFor="let rdv of rdvsEntretien" [value]="rdv">
{{rdv.typeEntretien.libelle}} le {{rdv.dateEntretien | date : 'dd/MM/yyyy à hh:mm'}}
</mat-radio-button>
</mat-radio-group>
<button mat-raised-button color="primary">Valider le choix</button>

@ -1,5 +0,0 @@
.radio-rdv {
display: flex;
flex-direction: column;
margin-bottom: 15px;
}

@ -1,16 +0,0 @@
import { Component, Input } from '@angular/core';
import { RDVEntretienDTO } from '@shared/api-swagger';
/**
* Composant qui permet au collaborateur de faire un choix parmi les date proposées
*/
@Component({
selector: 'ep-choix-date',
templateUrl: './ep-choix-date.component.html',
styleUrls: ["ep-choix-date.component.scss"]
})
export class EpChoixDateComponent {
@Input() rdvsEntretien : Array<RDVEntretienDTO>;
choixRdv : RDVEntretienDTO;
constructor() {}
}

@ -1,12 +0,0 @@
<h3 *ngIf="nouveauCommentaire">Ajouter un commentaire</h3>
<h3 *ngIf="!nouveauCommentaire">Modifier un commentaire</h3>
<div>
<mat-form-field appearance="fill">
<mat-label>Commentaire</mat-label>
<textarea matInput [(ngModel)]="commentaire"></textarea>
</mat-form-field>
</div>
<button mat-raised-button color="primary" (click)="enregistrer()">Enregister les modifications</button>
<button mat-raised-button color="warn" (click)="annuler()">Annuler</button>

@ -1,3 +0,0 @@
<p> Êtes-vous certain de vouloir supprimer votre commentaire ?</p>
<button mat-raised-button color="warn" (click)="valider(true)">Supprimer</button>
<button mat-raised-button color="primary" (click)="valider(false)">Annuler</button>

@ -1,31 +0,0 @@
<ng-container *ngIf="ep.commentairesAssistant == undefined || ep.commentairesAssistant.length == 0">
Aucun commentaire assistant
</ng-container>
<button mat-raised-button *ngIf="!aDejaCommente()" (click)="nouveauCommentaire()">Ajouter un commentaire</button>
<ng-container *ngIf="ep.commentairesAssistant != undefined && ep.commentairesAssistant.length != 0">
Liste des commentaires assistants :
<mat-card *ngFor="let commentaire of ep.commentairesAssistant">
<p>
{{commentaire.assistant}}
<ng-container *ngIf="commentaire.idAssistant == collaborateurConnecte.id">
<mat-icon (click)="modifierCommentaire(commentaire)">edit</mat-icon>
<mat-icon (click)="supprimerCommentaire(commentaire.id)">delete</mat-icon>
</ng-container>
</p>
<p>{{commentaire.commentaire}}</p>
</mat-card>
<!--
<ul>
<li *ngFor="let commentaire of ep.commentairesAssistant">
<p>Assistant : {{commentaire.assistant}}</p>
<p>{{commentaire.commentaire}}</p>
</li>
</ul>
-->
</ng-container>
<mat-card>
</mat-card>

@ -1,131 +0,0 @@
import { analyzeAndValidateNgModules } from '@angular/compiler';
import { Component, Inject, Input } from '@angular/core';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { CollaborateurDTO, CommentaireAssistantDTO, EpDTO } from '@shared/api-swagger';
import { AuthService } from '@shared/auth/auth.service';
import { Subscription } from 'rxjs';
/**
* Composant pour permettre au référent d'ajouter son commentaire et à tous les participants de le consulter
*/
@Component({
selector: 'ep-commentaires-assistant',
templateUrl: './ep-commentaires-assistant.component.html'
})
export class EpCommentairesAssistantComponent {
@Input() ep : EpDTO;
@Input() collaborateurConnecte : CollaborateurDTO;
dialogAjoutModificationSubscription : Subscription;
dialogSuppressionSubscription : Subscription;
constructor(private matDialog: MatDialog) {}
aDejaCommente() {
return this.ep.commentairesAssistant != undefined && this.ep.commentairesAssistant.some( c => c.idAssistant == this.collaborateurConnecte.id);
}
nouveauCommentaire() {
this.ouvrirSaisiCommentaire(undefined);
}
modifierCommentaire(commentaire : CommentaireAssistantDTO) {
this.ouvrirSaisiCommentaire(commentaire);
}
supprimerCommentaire(id : number) {
const dialogRef: MatDialogRef<DialogEPSupprimerCommentaireAssistant> = this.matDialog.open(DialogEPSupprimerCommentaireAssistant);
this.dialogSuppressionSubscription = dialogRef.afterClosed().subscribe(
reponse => {
if(reponse)
this.ep.commentairesAssistant = this.ep.commentairesAssistant.filter( c => c.id != id);
}
);
}
ouvrirSaisiCommentaire(data?: any) {
const dialogRef: MatDialogRef<DialogEPAjouterCommentaireAssistant> = this.matDialog.open(DialogEPAjouterCommentaireAssistant, { data: data});
this.dialogAjoutModificationSubscription = dialogRef.afterClosed().subscribe(
reponse => {
if(reponse != undefined && reponse.nouveauCommentaire)
this.ajouterCommentaire(reponse.commentaire);
}
);
}
ajouterCommentaire(commentaire : CommentaireAssistantDTO) {
commentaire.idAssistant = this.collaborateurConnecte.id;
commentaire.assistant = this.collaborateurConnecte.nom + " " + this.collaborateurConnecte.prenom;
if(this.ep.commentairesAssistant == undefined) {
this.ep.commentairesAssistant = [];
}
this.ep.commentairesAssistant.push(commentaire);
}
ngOnDestroy() {
this.dialogAjoutModificationSubscription?.unsubscribe();
this.dialogSuppressionSubscription?.unsubscribe();
}
}
/**
* Composant pour faire afficher un pop up pour l'ajout d'un commentaire assistant
*/
@Component( {
selector: "dialog-ep-ajouter-commentaire",
templateUrl: "./dialog-ep-ajouter-commentaire-assistant.html"
})
export class DialogEPAjouterCommentaireAssistant {
commentaire : string = "";
nouveauCommentaire : boolean = true;
commentaireDTO : CommentaireAssistantDTO;
constructor(private dialogRef : MatDialogRef<DialogEPAjouterCommentaireAssistant>, @Inject(MAT_DIALOG_DATA) public data: CommentaireAssistantDTO) {
if(data != undefined) {
this.commentaireDTO = data;
this.commentaire = this.commentaireDTO.commentaire;
this.nouveauCommentaire = false;
}
}
enregistrer() {
if(this.nouveauCommentaire) {
this.commentaireDTO = {
idAssistant : "",
commentaire : this.commentaire
}
}
else {
this.commentaireDTO.commentaire = this.commentaire;
}
const reponse : any = {
nouveauCommentaire: this.nouveauCommentaire,
commentaire : this.commentaireDTO
}
this.dialogRef.close(reponse);
}
annuler() {
this.dialogRef.close(undefined);
}
}
/**
* Composant pour afficher un pop permettant la validation ou non de la suppression d'un commentaire
*/
@Component( {
selector: "dialog-ep-supprimer-commentaire-assistant",
templateUrl: "./dialog-ep-supprimer-commentaire-assistant.html"
})
export class DialogEPSupprimerCommentaireAssistant {
constructor( private dialogRef: MatDialogRef<DialogEPSupprimerCommentaireAssistant>) {}
valider(reponse : boolean) {
this.dialogRef.close(reponse);
}
}

@ -1,15 +0,0 @@
<ng-container *ngIf="demande == undefined">
<h3>Aucune demande de délégation en cours</h3>
</ng-container>
<ng-container *ngIf="demande != undefined">
<h3>Demande de délégation en cours :</h3>
<p> Receveur : {{demande.referent.nom}} {{demande.referent.prenom}}</p>
<p> Date de la demande : {{demande.dateDemande | date: 'dd/MM/yyyy'}}</p>
<p> Raison de la demande : {{demande.raisonDemande }}</p>
<p> {{afficherEtatDemande(demande.etatDemande)}}</p>
<ng-container *ngIf="demande.etatDemande == etatDemande.Rejetee" >
<p> Date réponse : {{demande.dateReponse | date: 'dd/MM/yyyy'}}</p>
<p> Raison refus : {{demande.raisonRefus}} </p>
</ng-container>
</ng-container>

@ -1,22 +0,0 @@
import { Component, Input} from '@angular/core';
import { AfficherEtatDemandeDelegation, DemandeDelegationDTO, EpDTO, EtatDemande } from '@shared/api-swagger';
/**
* Composant pour faire une demande de délégation et voir la dernière en cours
*/
@Component({
selector: 'ep-demande-delegation',
templateUrl: './ep-demande-delegation.component.html'
})
export class EpDemandeDelegationComponent{
etatDemande : any = EtatDemande;
@Input() demande: DemandeDelegationDTO;
constructor() {}
afficherEtatDemande(etat: EtatDemande) {
return AfficherEtatDemandeDelegation(etat);
}
}

@ -1,2 +0,0 @@
<h3 *ngIf="demandesFormation == undefined || demandesFormation == []">Aucune demande de formation</h3>
<demandes-formation-table *ngIf="demandesFormation != undefined && demandesFormation.length != 0" [displayedColumns]="displayedColumns" [estAffichageEP]="estAffichageEP" [demandesFormation]="demandesFormation" ></demandes-formation-table>

@ -1,19 +0,0 @@
import { Component, Input } from '@angular/core';
import { DemandeFormationDTO } from '@shared/api-swagger';
/**
* Composant pour ajouter et voir les demandes de formation
*/
@Component({
selector: 'ep-demandes-formation',
templateUrl: './ep-demandes-formation.component.html'
})
export class EpDemandesFormationComponent {
@Input() demandesFormation : Array<DemandeFormationDTO>;
estAffichageEP : boolean = true;
displayedColumns : Array<string> = ["libelle", "description", "etat", "demanderh"];
constructor() {}
}

@ -1,8 +0,0 @@
<ng-container *ngIf="engagements == undefined || engagements.length == 0">
<h3>Aucun engagements pris</h3>
</ng-container>
<ng-container *ngIf="engagements != undefined && engagements.length != 0">
<engagements-table [displayedColumns]="displayedColumns" [estAffichageEP]="estAffichageEP" [engagementsSaisis]="engagements"></engagements-table>
</ng-container>

@ -1,15 +0,0 @@
import { Component, Input } from "@angular/core";
import { EngagementDTO } from "@shared/api-swagger";
@Component({
selector: "ep-engagements",
templateUrl: "./ep-engagements.component.html"
})
export class EpEngagementsCompenent {
@Input()engagements : EngagementDTO[];
displayedColumns : string[] = ["action", "dispositif", "modalite", "datelimite", "etat"];
estAffichageEP : boolean = true;
constructor(){}
}

@ -1,21 +0,0 @@
<ng-container *ngIf="ep.objectifs != undefined && ep.objectifs != []">
<h3>Nouveaux objectifs</h3>
<ul>
<li *ngFor= "let objectif of ep.objectifs; let index = index" >
Objectif {{index +1}} : {{objectif.libelle}}
</li>
</ul>
</ng-container>
<ng-container *ngIf="ep.objectifsPrecedent != undefined && ep.objectifsPrecedent != []">
<h3>Objectifs précédents</h3>
<ul>
<li *ngFor= "let objectif of ep.objectifsPrecedent; let index = index">
<p [ngClass]="objectif.statutObjectif"> Objectif {{index +1}} : {{objectif.libelle}} ({{afficherStatutObjectif(objectif.statutObjectif)}})</p>
<p *ngIf="objectif.commentaire != undefined && objectif.commentaire != ''"> Commentaire : {{objectif.commentaire}}</p>
</li>
</ul>
</ng-container>

@ -1,14 +0,0 @@
li {
margin-bottom: 1%;
}
.Atteint {
color: green
}
.NonAtteint{
color: red
}
.Partiel {
color: orange
}

@ -1,19 +0,0 @@
import { Component, Input } from "@angular/core";
import { afficherStatutObjectif, EpDTO, StatutObjectif } from "@shared/api-swagger";
@Component({
selector : "ep-objectifs",
templateUrl: "ep-objectifs.component.html",
styleUrls: ["ep-objectifs.component.scss"]
})
export class EpObjectifsComponent {
@Input() ep : EpDTO;
constructor(){}
afficherStatutObjectif(statut: StatutObjectif) {
return afficherStatutObjectif(statut);
}
}

@ -1,11 +0,0 @@
<ng-container *ngIf="ep.participants == undefined || ep.participants == []">
<h3> Aucun participant</h3>
</ng-container>
<ng-container *ngIf="ep.participants != undefined && ep.participants != []">
<ul>
<li *ngFor=" let participant of ep.participants">
{{participant.participant}}
</li>
</ul>
</ng-container>

@ -1,16 +0,0 @@
import { Component, Input, OnInit } from '@angular/core';
import { EpDTO } from '@shared/api-swagger';
/**
* Composant pour afficher la liste des participants de l'EP
*/
@Component({
selector: 'ep-participants',
templateUrl: './ep-participants.component.html'
})
export class EpParticipantsComponent {
@Input() ep : EpDTO;
constructor() {}
}

@ -1,39 +0,0 @@
<h3>Proposer au moins une date</h3>
<mat-chip-list>
Préférences du collaborateur :
<mat-chip *ngFor="let choix of choixTypeEntretien; let index = index">
N°{{index+1}} {{choix.libelle}}
</mat-chip>
</mat-chip-list>
<ng-container *ngIf="propositionsRdvEntretien.length != nbPropositionMax ">
<div>
<mat-form-field>
<input matInput [(ngModel)]="dateProposee" [ngxMatDatetimePicker]="dateProposeePicker" placeholder="Proposer une date" [min]="dateMin">
<mat-datepicker-toggle matSuffix [for]="dateProposeePicker"> </mat-datepicker-toggle>
<ngx-mat-datetime-picker #dateProposeePicker></ngx-mat-datetime-picker>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Choisir le type d'entretien</mat-label>
<mat-select [(value)]="choixEntretien">
<mat-option></mat-option>
<mat-option *ngFor="let choix of choixTypeEntretien; let index = index" [value]="choix">N°{{index+1}} {{choix.libelle}}</mat-option>
</mat-select>
</mat-form-field>
<p *ngIf="choixEntretien != undefined">Choix : {{choixEntretien.libelle}}</p>
</div>
<div>
<button mat-raised-button (click)="enregistrerChoix()">Ajouter proposition</button>
</div>
</ng-container>
<ul>
<li *ngFor="let proposition of propositionsRdvEntretien; let index = index">
Proposition {{index+1}} : {{proposition.typeEntretien.libelle.toLowerCase()}} le {{proposition.dateEntretien | date : "dd/MM/yyyy à hh:mm"}}
<mat-icon (click)="annulerProposition(proposition)">delete</mat-icon>
</li>
</ul>
<button mat-raised-button color="primary">Valider les dates proposés</button>

@ -1,42 +0,0 @@
import { Component, Input } from '@angular/core';
import { RDVEntretienDTO, TypeEntretienDTO } from '@shared/api-swagger';
/**
* Composant permettant au référent de proposer ses dates d'EP à partir des préférences de lieu d'entretien du collaborateur
*/
@Component({
selector: 'ep-propositions-dates',
templateUrl: './ep-propositions-dates.component.html'
})
export class EpPropositionsDatesComponent {
nbPropositionMax = 3;
dateMin: Date;
dateProposee: Date;
choixEntretien : TypeEntretienDTO;
@Input() choixTypeEntretien : Array<TypeEntretienDTO>;
propositionsRdvEntretien : Array<RDVEntretienDTO> = [];
constructor() {
this.dateMin = new Date();
this.dateMin.setDate( this.dateMin.getDate() +1);
}
enregistrerChoix() {
if(this.dateProposee != undefined && this.choixEntretien != undefined) {
let rdv : RDVEntretienDTO = {
dateEntretien : this.dateProposee,
typeEntretien : this.choixEntretien
};
this.propositionsRdvEntretien.push(rdv);
this.dateProposee = undefined;
this.choixEntretien = undefined;
}
}
annulerProposition(proposition:RDVEntretienDTO) {
this.propositionsRdvEntretien = this.propositionsRdvEntretien.filter( p => p!= proposition);
}
}

@ -1,7 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
/** /**
* Composant permettant de faire la demande d'augmentation de salaire
*/ */
@Component({ @Component({
selector: 'app-ep-augmentation-salaire', selector: 'app-ep-augmentation-salaire',

@ -0,0 +1 @@
<h1>Consultation choix date</h1>

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
/**
*/
@Component({
selector: 'app-ep-choix-date',
templateUrl: './ep-choix-date.component.html'
})
export class EpChoixDateComponent implements OnInit {
constructor() {}
ngOnInit() {
}
}

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
/**
*/
@Component({
selector: 'app-ep-commentaire-assistant',
templateUrl: './ep-commentaire-assistant.component.html'
})
export class EpCommentaireAssistantComponent implements OnInit {
constructor() {}
ngOnInit() {
}
}

@ -1,7 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
/** /**
* Composant pour permettre au référent d'ajouter son commentaire et à tous les participants de le consulter
*/ */
@Component({ @Component({
selector: 'app-ep-commentaire-referent', selector: 'app-ep-commentaire-referent',

@ -1,7 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
/** /**
* Ce composant sert peut-ête à rien...
*/ */
@Component({ @Component({
selector: 'app-ep-consultation', selector: 'app-ep-consultation',

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
/**
*/
@Component({
selector: 'app-ep-demande-delegation',
templateUrl: './ep-demande-delegation.component.html'
})
export class EpDemandeDelegationComponent implements OnInit {
constructor() {}
ngOnInit() {
}
}

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
/**
*/
@Component({
selector: 'app-ep-demandes-formation',
templateUrl: './ep-demandes-formation.component.html'
})
export class EpDemandesFormationComponent implements OnInit {
constructor() {}
ngOnInit() {
}
}

@ -0,0 +1 @@
<h1>Consultation participants </h1>

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
/**
*/
@Component({
selector: 'app-ep-participants',
templateUrl: './ep-participants.component.html'
})
export class EpParticipantsComponent implements OnInit {
constructor() {}
ngOnInit() {
}
}

@ -0,0 +1,2 @@
<app-nav-menu></app-nav-menu>
<h1>New participant </h1>

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
/**
*/
@Component({
selector: 'app-new-participant',
templateUrl: './new-participant.component.html'
})
export class NewParticipantComponent implements OnInit {
constructor() {}
ngOnInit() {
}
}

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
/**
*/
@Component({
selector: 'app-ep-propositions-dates',
templateUrl: './ep-propositions-dates.component.html'
})
export class EpPropositionsDatesComponent implements OnInit {
constructor() {}
ngOnInit() {
}
}

@ -1,7 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
/** /**
* Composant pour vérifier que la signature des deux parties
*/ */
@Component({ @Component({
selector: 'app-ep-signature', selector: 'app-ep-signature',

@ -1,3 +0,0 @@
<app-nav-menu></app-nav-menu>
<h1>Liste des EP collaborateurs signés</h1>
<ep-table [typeRechercheEP]="typeRechercheEP" [displayedColumns]="displayedColumns" (eventEmitter)="eventEmitter($event)"></ep-table>

@ -1,40 +0,0 @@
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { epTypeRecherche } from '@shared/utils/cles';
/**
* Composant qui permet la consultation de la liste des EP signés
*/
@Component({
selector: 'app-ep-signes',
templateUrl: './ep-signes.component.html'
})
export class EpSignesComponent {
displayedColumns: string[] = ["agence", "collaborateur", "referent", "datearrivee", "statutep", "typeep", "dateentretien", "consultation"];
typeRechercheEP : string = epTypeRecherche.EPSignes;
constructor(private router: Router){}
/**
* Evènement permettant de choisir si l'on souhaite ouvrir les détails du collaborateur, du référent ou bien de l'EP
*
* @param event Evènement reçu par le composant enfant, contient le type de l'évènement (référent, ep, collaborateur) et les données ep
*/
eventEmitter(event: any) {
switch(event.type) {
case "collaborateur":
if(event.ep.collaborateur != undefined)
this.router.navigate(["/collaborateurs", event.ep.collaborateur.id])
break;
case "referent":
if(event.ep.referent != undefined)
this.router.navigate(["/referents", event.ep.referent.id])
break;
case "ep":
this.router.navigate(["/ep", event.ep.id]);
break;
}
}
}

@ -1,22 +1,2 @@
<app-nav-menu></app-nav-menu> <app-nav-menu></app-nav-menu>
<h2>Vos EP</h2> <h1>Liste des EP collaborateurs</h1>
<ng-container *ngIf="idCollaborateur == undefined">
<mat-spinner></mat-spinner>
</ng-container>
<ng-container *ngIf="idCollaborateur != undefined">
<mat-tab-group mat-align-tabs="start">
<mat-tab label="EP signés">
<ep-table [rechercherParBU]="false" [rechercherParDate]="true" [typeRechercheEP]="epTypeRecherche.RechercheEPCollaborateursSignes" [displayedColumns]="displayedColumnsEPSignes" [idCollaborateur]="idCollaborateur" (eventEmitter)="ouvrirEP($event)" ></ep-table>
</mat-tab>
<mat-tab label="EP référent">
<ep-table [rechercherParBU]="false" [rechercherParDate]="true" [typeRechercheEP]="epTypeRecherche.RechercheEPReferentSignes" [displayedColumns]="displayedColumnsEPReferent" [idCollaborateur]="idCollaborateur" (eventEmitter)="ouvrirEP($event)" ></ep-table>
</mat-tab>
<mat-tab label="EP Participant">
TODO
</mat-tab>
</mat-tab-group>
</ng-container>

@ -1,13 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { CollaborateurDTO } from '@shared/api-swagger';
import { AuthService } from '@shared/auth/auth.service';
import { cles, epTypeRecherche } from '@shared/utils/cles';
import { Role } from '@shared/utils/roles';
/** /**
* Composant pour faire afficher les EP signés, référent et participants du connecté
*/ */
@Component({ @Component({
selector: 'app-ep', selector: 'app-ep',
@ -15,43 +8,8 @@ import { Role } from '@shared/utils/roles';
}) })
export class EpComponent implements OnInit { export class EpComponent implements OnInit {
constructor() {}
role = Role;
/**
* Le rôle de l'utilisateur.
*/
userRole : string;
displayedColumnsEPSignes : string[] = ["referent", "statutep","typeep", "dateentretien", "consultation"];
displayedColumnsEPReferent : string[] = ["agence", "collaborateur", "datearrivee", "statutep","typeep", "dateentretien", "consultation"];
displayedColumnsEPParticipant : string[] = ["referent", "statutep","typeep", "dateentretien", "consultation"];
epTypeRecherche : any = epTypeRecherche;
idCollaborateur: string;
constructor(private authService: AuthService, private router: Router){
this.userRole = this.authService.firstRole;
}
ngOnInit() { ngOnInit() {
this.setIdCollaborateur();
}
setIdCollaborateur() {
if(sessionStorage.getItem(cles.sessionKeyConnectee) == undefined) {
setTimeout( () => this.setIdCollaborateur(), 1000);
}
else {
const collaborateurConnecte : CollaborateurDTO = JSON.parse(sessionStorage.getItem(cles.sessionKeyConnectee));
this.idCollaborateur = collaborateurConnecte.id;
}
}
ouvrirEP(event : any) {
if(event.type == "ep")
this.router.navigate(["/ep", event.ep.id]);
} }
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save