Skip to content

Commit

Permalink
fix(rights): fix 'facteur' guard
Browse files Browse the repository at this point in the history
  • Loading branch information
pYassine committed Dec 11, 2023
1 parent 63af2b7 commit 2f11763
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { ManageUsagersPageComponent } from "./components/manage-usagers-page/manage-usagers-page.component";
import { NgModule } from "@angular/core";
import { Routes, RouterModule } from "@angular/router";
import { AuthGuard } from "../../guards";

const routes: Routes = [
{
canActivate: [AuthGuard],
path: "",
component: ManageUsagersPageComponent,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { NgModule } from "@angular/core";
import { Routes, RouterModule } from "@angular/router";
import { FacteurGuard, AuthGuard } from "../../guards";

import { StepDecisionComponent } from "./components/step-decision/step-decision.component";
import { StepDocumentsComponent } from "./components/step-documents/step-documents.component";
Expand All @@ -10,37 +9,30 @@ import { StepRdvComponent } from "./components/step-rdv/step-rdv.component";

const routes: Routes = [
{
canActivate: [AuthGuard, FacteurGuard],
path: "nouveau",
component: StepEtatCivilComponent,
},
{
canActivate: [AuthGuard, FacteurGuard],
path: ":id/edit",
component: StepEtatCivilComponent,
},
{
canActivate: [AuthGuard, FacteurGuard],
path: ":id/edit/etat-civil",
component: StepEtatCivilComponent,
},
{
canActivate: [AuthGuard, FacteurGuard],
path: ":id/edit/documents",
component: StepDocumentsComponent,
},
{
canActivate: [AuthGuard, FacteurGuard],
path: ":id/edit/entretien",
component: StepEntretienComponent,
},
{
canActivate: [AuthGuard, FacteurGuard],
path: ":id/edit/rendez-vous",
component: StepRdvComponent,
},
{
canActivate: [AuthGuard, FacteurGuard],
path: ":id/edit/decision",
component: StepDecisionComponent,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@ import { ProfilDossierComponent } from "./components/pages/profil-dossier/profil
import { ProfilHistoriqueComponent } from "./components/pages/profil-historique/profil-historique.component";
import { ProfilGeneralSectionComponent } from "./components/pages/profil-general-section/profil-general-section.component";
import { ProfilDocumentsSectionComponent } from "./components/pages/profil-documents-section/profil-documents-section.component";
import { FacteurGuard } from "../../guards";

const routes: Routes = [
{ path: "dossier/:id", component: ProfilDossierComponent },
{ path: "historique/:id", component: ProfilHistoriqueComponent },
{ path: "courriers/:id", component: ProfilCourriersComponent },
{ path: "general/:id", component: ProfilGeneralSectionComponent },
{ path: "documents/:id", component: ProfilDocumentsSectionComponent },
{
path: "documents/:id",
component: ProfilDocumentsSectionComponent,
canActivate: [FacteurGuard],
},
];

@NgModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,15 @@
</div>
</div>

<ng-container *ngIf="context === 'HISTORY' && usager.historique.length > 1">
<button
class="btn btn-danger d-print-none"
type="button"
aria-label="Supprimer la dernière décision"
(click)="open(deleteDecisionConfirmation)"
>
<fa-icon [icon]="['fas', 'trash']" aria-hidden="true"></fa-icon>
</button>
</ng-container>
<button
class="btn btn-danger d-print-none"
type="button"
aria-label="Supprimer la dernière décision"
*ngIf="context === 'HISTORY' && usager.historique.length > 1 && isAdmin"
(click)="open(deleteDecisionConfirmation)"
>
<fa-icon [icon]="['fas', 'trash']" aria-hidden="true"></fa-icon>
</button>

<ng-template #deleteDecisionConfirmation let-modal>
<div class="modal-header bg-danger">
Expand Down
20 changes: 20 additions & 0 deletions packages/frontend/src/assets/files/news.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
[
{
"date": "2023-12-12",
"description": "",
"content": [
{
"type": "new",
"categorie": "Apparition du Nom d'usage dans le CERFA",
"message": [
"Un nouveau paramètre vous permet de faire apparaitre le nom d'usage d'un domicilié dans la ligne 'Nom' du Cerfa. Vous pouvez l'activer en vous rendant dans 'Informations de la structure' - 'Paramètres de la structure'"
]
},
{
"type": "new",
"categorie": "Mention du Pli Non Distribuable",
"message": [
"La mention 'pli non distribuable' qui est attribuée aux dossiers radiés peut désormais être désactivée manuellement, et disparaît automatiquement lors d'une nouvelle demande suite à une radiation"
]
}
]
},
{
"date": "2023-11-30",
"description": "",
Expand Down

0 comments on commit 2f11763

Please sign in to comment.