Mise en place du routing au sein des différents modules

master
Yanaël GRETTE 4 years ago
parent ae03725a06
commit 19efd9401d
  1. 36
      src/app/app-routing.module.ts
  2. 1
      src/app/app.component.html
  3. 3
      src/app/app.module.ts
  4. 2
      src/app/collaborateurs/collaborateurs.component.html
  5. 20
      src/app/collaborateurs/collaborateurs.module.ts
  6. 21
      src/app/collaborateurs/collaborateurs.routing.module.ts
  7. 2
      src/app/demandes-delegation/demandes-delegation.component.html
  8. 16
      src/app/demandes-delegation/demandes-delegation.module.ts
  9. 21
      src/app/demandes-delegation/demandes-delegation.routing.module.ts
  10. 2
      src/app/demandes-formation/demandes-formation.component.html
  11. 9
      src/app/demandes-formation/demandes-formation.module.ts
  12. 21
      src/app/demandes-formation/demandes-formation.routing.module.ts
  13. 2
      src/app/ep-saisie/ep-saisie.component.html
  14. 16
      src/app/ep-saisie/ep-saisie.module.ts
  15. 21
      src/app/ep-saisie/ep-saisie.routing.module.ts
  16. 2
      src/app/ep/ep.component.html
  17. 16
      src/app/ep/ep.module.ts
  18. 21
      src/app/ep/ep.routing.module.ts
  19. 2
      src/app/formations/formations.component.html
  20. 22
      src/app/formations/formations.module.ts
  21. 21
      src/app/formations/formations.routing.module.ts
  22. 11
      src/app/home/home.module.ts
  23. 2
      src/app/referents/referents.component.html
  24. 14
      src/app/referents/referents.module.ts
  25. 21
      src/app/referents/referents.routing.module.ts
  26. 6
      src/app/shared/nav-menu/nav-menu-assistante/nav-menu-assistante.component.html
  27. 2
      src/app/shared/nav-menu/nav-menu-assistante/nav-menu-assistante.component.ts
  28. 4
      src/app/shared/nav-menu/nav-menu-commercial/nav-menu-commercial.component.html
  29. 4
      src/app/shared/nav-menu/nav-menu-rh/nav-menu-rh.component.html
  30. 6
      src/app/shared/nav-menu/nav-menu.component.html
  31. 15
      src/app/shared/nav-menu/nav-menu.module.ts
  32. 60
      src/app/shared/utils/paths.ts

@ -4,21 +4,51 @@ import { RouterModule } from '@angular/router';
import { Routes } from '@angular/router';
import { AppAuthGuard } from './app.authguard';
import { HomeComponent } from './home/home.component';
import { HomeComponent } from './home/';
import { paths_collaborateurs, paths_demandes_delegation, paths_demandes_formation,
paths_ep, paths_saisie_ep, paths_formation, paths_home, paths_referents } from '@shared/utils/paths';
const routes: Routes = [
{
path: '',
redirectTo: '/home',
redirectTo: paths_home.path,
pathMatch: 'full'
},
{
path: 'home',
path: paths_home.path,
component: HomeComponent,
canActivate: [AppAuthGuard],
pathMatch: 'full'
},
{
path: paths_collaborateurs.path,
loadChildren: () => import('./collaborateurs/collaborateurs.module').then(m=> m.CollaborateursModule)
},
{
path: paths_demandes_delegation.path,
loadChildren: () => import('./demandes-delegation/demandes-delegation.module').then(m=> m.DemandesDelegationModule)
},
{
path: paths_demandes_formation.path,
loadChildren: () => import('./demandes-formation/demandes-formation.module').then(m=> m.DemandesFormationModule)
},
{
path: paths_ep.path,
loadChildren: () => import('./ep/ep.module').then(m=> m.EpModule)
},
{
path: paths_saisie_ep.path,
loadChildren: () => import('./ep-saisie/ep-saisie.module').then(m=> m.EpSaisieModule)
},
{
path: paths_formation.path,
loadChildren: () => import('./formations/formations.module').then(m=> m.FormationsModule)
},
{
path: paths_referents.path,
loadChildren: () => import('./referents/referents.module').then(m=> m.ReferentsModule)
}
];
@NgModule({

@ -1,4 +1,3 @@
<!--<app-nav-menu></app-nav-menu>-->
<div class="container">
<router-outlet></router-outlet>
</div>

@ -4,6 +4,7 @@ import { NgModule, DoBootstrap } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { FormsModule } from '@angular/forms';
import { KeycloakAngularModule, KeycloakService } from 'keycloak-angular';
import { RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
@ -33,6 +34,7 @@ let keycloakService: KeycloakService = new KeycloakService();
],
imports: [
BrowserModule,
BrowserAnimationsModule,
KeycloakAngularModule,
AppRoutingModule,
HttpClientModule,
@ -44,6 +46,7 @@ let keycloakService: KeycloakService = new KeycloakService();
DemandesFormationModule,
DemandesDelegationModule,
EpSaisieModule
],
providers: [
{

@ -0,0 +1,2 @@
<app-nav-menu></app-nav-menu>
<h1> Liste des collaborateurs </h1>

@ -1,10 +1,7 @@
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule } from '@angular/forms';
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { MaterialModule } from "@shared/angular-material/angular-material.module";
@ -12,12 +9,13 @@ import {NavMenuModule} from '@shared/nav-menu/nav-menu.module';
import { CollaborateursComponent } from "./collaborateurs.component";
import { DetailsCollaborateurComponent } from "./details-collaborateur/details-collaborateur.component";
import { EvaluationComponent } from "./formations-collaborateur/details-evaluation/evaluation.component";
import { EditEvaluationComponent } from "./formations-collaborateur/edit-evaluation/edit-evaluation.component";
import { FormationsCollaboateurComponent } from "./formations-collaborateur/formations-collaborateur.component";
import { CollaborateursRoutingModule } from "./collaborateurs.routing.module";
@NgModule({
declarations: [
DetailsCollaborateurComponent, EvaluationComponent, EditEvaluationComponent,
@ -27,10 +25,12 @@ import { FormationsCollaboateurComponent } from "./formations-collaborateur/form
CollaborateursComponent
],
imports: [
BrowserAnimationsModule,
FormsModule,
//FormsModule,
CommonModule,
MaterialModule,
NavMenuModule
NavMenuModule,
CollaborateursRoutingModule,
RouterModule
],
})
export class CollaborateursModule {}

@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { CollaborateursComponent } from "./collaborateurs.component";
const routes: Routes = [
{
path:'',
component: CollaborateursComponent,
pathMatch: 'full'
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class CollaborateursRoutingModule {}

@ -0,0 +1,2 @@
<app-nav-menu></app-nav-menu>
<h1>Liste des demandes de délégations</h1>

@ -1,10 +1,7 @@
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule } from '@angular/forms';
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { MaterialModule } from "@shared/angular-material/angular-material.module";
@ -13,6 +10,8 @@ import {NavMenuModule} from '@shared/nav-menu/nav-menu.module';
import { DemandesDelegationComponent } from './demandes-delegation.component';
import { DemandeDelegationComponent } from './details-demande-delegation/demande-delegation.component';
import { DemandesDelegationRoutingModule } from './demandes-delegation.routing.module';
@NgModule({
declarations: [ DemandesDelegationComponent, DemandeDelegationComponent
@ -20,10 +19,11 @@ import { DemandeDelegationComponent } from './details-demande-delegation/demande
exports: [ DemandesDelegationComponent
],
imports: [
BrowserAnimationsModule,
FormsModule,
MaterialModule,
NavMenuModule
NavMenuModule,
DemandesDelegationRoutingModule,
RouterModule
],
})
export class DemandesDelegationModule {}

@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { DemandesDelegationComponent } from "./demandes-delegation.component";
const routes: Routes = [
{
path:'',
component: DemandesDelegationComponent,
pathMatch: 'full'
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class DemandesDelegationRoutingModule {}

@ -0,0 +1,2 @@
<app-nav-menu></app-nav-menu>
<h1>Liste des demandes de formation </h1>

@ -1,6 +1,6 @@
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { NgModule } from "@angular/core";
@ -13,6 +13,7 @@ import {NavMenuModule} from '@shared/nav-menu/nav-menu.module';
import { DemandesFormationComponent } from './demandes-formation.component';
import { DemandeFormationComponent } from './details-demande-formation/demande-formation.component'
import { NewDemandeFormationComponent } from './new-demande-formation/new-demande-formation.component'
import { DemandesFormationsRoutingModule } from './demandes-formation.routing.module';
@NgModule({
declarations: [ DemandesFormationComponent, DemandeFormationComponent,
@ -22,10 +23,10 @@ import { NewDemandeFormationComponent } from './new-demande-formation/new-demand
DemandesFormationComponent
],
imports: [
BrowserAnimationsModule,
FormsModule,
MaterialModule,
NavMenuModule
NavMenuModule,
DemandesFormationsRoutingModule,
RouterModule
],
})
export class DemandesFormationModule {}

@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { DemandesFormationComponent } from "./demandes-formation.component";
const routes: Routes = [
{
path:'',
component: DemandesFormationComponent,
pathMatch: 'full'
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class DemandesFormationsRoutingModule {}

@ -0,0 +1,2 @@
<app-nav-menu></app-nav-menu>
<h1>Saisie EP </h1>

@ -1,10 +1,7 @@
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule } from '@angular/forms';
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router'
import { MaterialModule } from "@shared/angular-material/angular-material.module";
@ -15,6 +12,7 @@ import { EpaSaisieComponent } from './epa-saisie/epa-saisie.component';
import { EpsSaisieComponent } from './eps-saisie/eps-saisie.component';
import { EpaSixAnsSaisieComponent } from './epa-six-ans-saisie/epa-six-ans-saisie.component';
import { EpSaisieRoutingModule } from './ep-saisie.routing.module';
@NgModule({
declarations: [EpSaisieComponent, EpsSaisieComponent, EpaSaisieComponent,
@ -23,10 +21,12 @@ import { EpaSixAnsSaisieComponent } from './epa-six-ans-saisie/epa-six-ans-saisi
exports: [EpSaisieComponent
],
imports: [
BrowserAnimationsModule,
FormsModule,
//BrowserAnimationsModule,
//FormsModule,
MaterialModule,
NavMenuModule
NavMenuModule,
EpSaisieRoutingModule,
RouterModule
],
})
export class EpSaisieModule {}

@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { EpSaisieComponent } from "./ep-saisie.component";
const routes: Routes = [
{
path:'',
component: EpSaisieComponent,
pathMatch: 'full'
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class EpSaisieRoutingModule {}

@ -0,0 +1,2 @@
<app-nav-menu></app-nav-menu>
<h1>Liste des EP collaborateurs</h1>

@ -1,10 +1,7 @@
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule } from '@angular/forms';
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { MaterialModule } from "@shared/angular-material/angular-material.module";
@ -24,6 +21,9 @@ import { EpaComponent } from "./ep-consultation/epa/epa.component";
import { EpaSixAnsComponent } from "./ep-consultation/epa-six-ans/epa-six-ans.component";
import { EpsComponent } from "./ep-consultation/eps/eps.component";
import { EpRoutingModule } from './ep.routing.module';
/**/
@NgModule({
declarations: [EpComponent, EpAugmentationSalaireComponent, EpChoixDateComponent,
@ -34,10 +34,10 @@ EpSignatureComponent, EpaComponent, EpaSixAnsComponent, EpsComponent
exports: [EpComponent
],
imports: [
BrowserAnimationsModule,
FormsModule,
MaterialModule,
NavMenuModule
NavMenuModule,
EpRoutingModule,
RouterModule
],
})
export class EpModule {}

@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { EpComponent } from "./ep.component";
const routes: Routes = [
{
path:'',
component: EpComponent,
pathMatch: 'full'
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class EpRoutingModule {}

@ -0,0 +1,2 @@
<app-nav-menu></app-nav-menu>
<h1>Liste des formations </h1>

@ -1,19 +1,18 @@
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule } from '@angular/forms';
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 { FormationsComponent } from './formations.component';
import { NewFormationComponent } from './new-formation/new-formation.component'
import { FormationComponent } from './details-formation/formation.component'
import { EditFormationComponent } from './edit-formation/edit-formation.component'
import { NewFormationComponent } from './new-formation/new-formation.component';
import { FormationComponent } from './details-formation/formation.component';
import { EditFormationComponent } from './edit-formation/edit-formation.component';
import { FormationsRoutingModule } from './formations.routing.module';
@NgModule({
declarations: [ FormationsComponent, NewFormationComponent,
FormationComponent, EditFormationComponent
@ -22,10 +21,11 @@ import { EditFormationComponent } from './edit-formation/edit-formation.componen
FormationsComponent
],
imports: [
BrowserAnimationsModule,
FormsModule,
CommonModule,
MaterialModule,
NavMenuModule
NavMenuModule,
RouterModule,
FormationsRoutingModule
],
})
export class FormationsModule {}

@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { FormationsComponent } from "./formations.component";
const routes: Routes = [
{
path:'',
component: FormationsComponent,
pathMatch: 'full'
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class FormationsRoutingModule {}

@ -1,9 +1,7 @@
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule } from '@angular/forms';
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { RouterModule } from '@angular/router';
import { FormsModule } from '@angular/forms';
import { MaterialModule } from "@shared/angular-material/angular-material.module";
@ -23,10 +21,11 @@ import {NavMenuModule} from '@shared/nav-menu/nav-menu.module';
HomeComponent
],
imports: [
BrowserAnimationsModule,
CommonModule,
FormsModule,
MaterialModule,
NavMenuModule
NavMenuModule,
RouterModule
],
})
export class HomeModule {}

@ -0,0 +1,2 @@
<app-nav-menu></app-nav-menu>
<h1>Liste des référents</h1>

@ -1,10 +1,6 @@
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule } from '@angular/forms';
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { RouterModule } from '@angular/router';
import { MaterialModule } from "@shared/angular-material/angular-material.module";
@ -12,6 +8,7 @@ import {NavMenuModule} from '@shared/nav-menu/nav-menu.module';
import { ReferentsComponent } from './referents.component';
import { DetailsReferentComponent } from './details-referent/details-referent.component';
import { ReferentsRoutingModule } from './referents.routing.module';
@NgModule({
declarations: [ DetailsReferentComponent, ReferentsComponent
@ -19,10 +16,11 @@ import { DetailsReferentComponent } from './details-referent/details-referent.co
exports: [ ReferentsComponent
],
imports: [
BrowserAnimationsModule,
FormsModule,
CommonModule,
MaterialModule,
NavMenuModule
NavMenuModule,
RouterModule,
ReferentsRoutingModule
],
})
export class ReferentsModule {}

@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ReferentsComponent } from "./referents.component";
const routes: Routes = [
{
path:'',
component: ReferentsComponent,
pathMatch: 'full'
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class ReferentsRoutingModule {}

@ -3,7 +3,7 @@
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #menuCollaborateurs="matMenu">
<button mat-menu-item>Liste des collaborateurs</button>
<button mat-menu-item>Liste des EPs collaborateurs non signés</button>
<button mat-menu-item routerLink="/collaborateurs">Liste des collaborateurs</button>
<button mat-menu-item routerLink="/ep">Liste des EP</button>
</mat-menu>
<button mat-button>Liste des référents</button>
<button mat-button routerLink="/referents">Liste des référents</button>

@ -1,5 +1,5 @@
import { Component } from "@angular/core";
import { CommonModule } from "@angular/common";
/**
* Le nav-menu qui sera affiché pour l'assistante.
* La navigation des assistantes : accès à la liste des référents, accès à la liste des collaborateurs, accès à la liste de tous les EP.

@ -3,8 +3,8 @@
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #menuCollaborateurs="matMenu">
<button mat-menu-item>Liste de tous les collaborateurs</button>
<button mat-menu-item routerLink="/collaborateurs">Liste de tous les collaborateurs</button>
<button mat-menu-item>Liste des collaborateurs suivis</button>
</mat-menu>
<button mat-button>Liste des formations</button>
<button mat-button routerLink="/formations">Liste des formations</button>
<button mat-button>EP effectués</button>

@ -4,7 +4,7 @@
</button>
<mat-menu #menuFormation="matMenu">
<button mat-menu-item>Ajouter une nouvelle formation</button>
<button mat-menu-item>Liste des formations</button>
<button mat-menu-item routerLink="/formations">Liste des formations</button>
</mat-menu>
<button mat-button [matMenuTriggerFor]="menuDemande">
<span>Demande de formations</span>
@ -12,5 +12,5 @@
</button>
<mat-menu #menuDemande="matMenu">
<button mat-menu-item>Créer une nouvelle demande de formation</button>
<button mat-menu-item>Liste des demandes</button>
<button mat-menu-item routerLink="/demandesformation">Liste des demandes</button>
</mat-menu>

@ -1,10 +1,10 @@
<header>
<mat-card>
<!--Mettre l'icon APSIDE-->
<img src="../../assets/img/logo.png">
<img routerLink="/home" src="../../assets/img/logo.png">
<!--LIEN VERS HOME-->
<button mat-button>Accueil</button>
<!--RESTE MENU EN FONCTION DES ROLES-->
<button mat-button routerLink="/home">Accueil</button>
<!--MENU EN FONCTION DES ROLES-->
<app-nav-menu-assistante *ngIf="this.userRole == role.assistante"></app-nav-menu-assistante>
<app-nav-menu-collaborateur *ngIf="this.userRole == role.collaborateur"></app-nav-menu-collaborateur>
<app-nav-menu-commercial *ngIf="this.userRole == role.commercial"></app-nav-menu-commercial>

@ -1,9 +1,7 @@
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule } from '@angular/forms';
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { RouterModule } from '@angular/router';
import { MaterialModule } from "../angular-material/angular-material.module";
@ -14,14 +12,13 @@ import { NavMenuCommercialComponent } from "./nav-menu-commercial/nav-menu-comme
import { NavMenuRHComponent } from "./nav-menu-rh/nav-menu-rh.component";
@NgModule({
declarations: [
NavMenuComponent, NavMenuAssistanteComponent, NavMenuCollaborateurComponent,
declarations: [ NavMenuComponent, NavMenuAssistanteComponent, NavMenuCollaborateurComponent,
NavMenuCommercialComponent, NavMenuRHComponent
],
imports: [
BrowserAnimationsModule,
FormsModule,
MaterialModule
CommonModule,
MaterialModule,
RouterModule
],
exports: [NavMenuComponent]
})

@ -0,0 +1,60 @@
const paths_collaborateurs = {
base: "/collaborateurs",
path: "collaborateurs",
formation: "formations",
evaluation: "evaluation",
edit: "edit"
};
const paths_demandes_delegation = {
base: "/demandesdelegation",
path: "demandesdelegation"
};
const paths_demandes_formation = {
base: "/demandesformation",
path: "demandesformation",
new: "nouvelledemande"
};
const paths_ep = {
base: "/ep",
path: "ep",
salaire: "augmentationsalaire",
choixdate: "choixdate",
demandedelegation: "demandedelegation",
demandesformation: "demandesformation",
propositiondate: "propositiondate",
participants: "participants",
commentaireAssistante: "commentaireassistante",
commentaireReferent: "commentairereferent"
};
const paths_saisie_ep = {
base: "/saisieep",
path: "saisieep",
epa: "epa",
eps: "eps",
epa6ans: "epasixans"
};
const paths_formation = {
base: "/formations",
path: "formations",
new: "nouvelleformation",
evaluation: "evaluation"
};
const paths_home = {
base: "/home",
path: "home"
};
const paths_referents = {
base: "/referents",
path: "referents"
};
export { paths_collaborateurs, paths_demandes_delegation, paths_demandes_formation,
paths_ep, paths_saisie_ep, paths_formation, paths_home, paths_referents};
Loading…
Cancel
Save