-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add overview page with different states and route from step 1 * add charts on audit card * split page in sub components * fix donut theme prop ts check * add conditions to dispay some data * add breadcrumb link, back link on audit page and meta component * update buttons label and remove account page breadcrumb * redesign copy block and update nav items * add meta desc * remove step four page and redirect links to overview instead * add redirect from /partage to /synthese * add new props to progress bar and delete sticky indicators component * move title above sticky header + remove validate button * add toast when audit is done and set publicationDate * make main action in audit row to take full width * update audit creation email content * only send audit creation email when not connected * fix condition to show auditor infos when creating audit * add back links on pages * get audit edit id in report route and show back link on report page * improve responsiveness of header * remove back link on report page + make sure report link are in new tab * add notes button + modal * remove notes tab * fix markdown button type + textarea height * remove edit id in report fetch data * fix accessibility labels * remove markdown button in notes modal * add correct toast wording when updating audit notes * align badge width step title * remove settings link in header dropdown * move audit alert banners from step three to overview page * rename breadcrumb first item when connected * add back link to audit page when not connected * add utility class to remove external icon + fix icon in overview steps buttons * add close button to copy block success message * publish audit when using dev button * update audit finished toast wording for other audit types * update audit creation email content * update icon + highlight first nav link + update copy success message
- Loading branch information
1 parent
b641355
commit efddcef
Showing
43 changed files
with
1,321 additions
and
914 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Injectable, NestMiddleware } from "@nestjs/common"; | ||
import { JwtService } from "@nestjs/jwt"; | ||
import type { Request } from 'express'; | ||
import { AuthenticationJwtPayload } from "./jwt-payloads"; | ||
|
||
/** | ||
* Extract the authentication token and verifies it. | ||
* No error is thrown if there is no token or if the token is invalid. Use the | ||
* AuthRequired decorator if you want a route to only accept authenticated requests. | ||
*/ | ||
@Injectable() | ||
export class UserMiddleware implements NestMiddleware { | ||
constructor(private readonly jwt: JwtService) {} | ||
|
||
use(req: Request, res: any, next: (error?: any) => void) { | ||
const token = this.extractTokenFromHeader(req); | ||
|
||
if (!token) { | ||
next() | ||
return | ||
} | ||
|
||
this.jwt.verifyAsync(token) | ||
.then(payload => { | ||
req['user'] = payload; | ||
next() | ||
}) | ||
.catch(next) | ||
} | ||
|
||
private extractTokenFromHeader(request: Request): string | undefined { | ||
const [type, token] = request.headers.authorization?.split(' ') ?? []; | ||
return type === 'Bearer' ? token : undefined; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
import { renderMailTemplate } from './render-mjml-template'; | ||
|
||
export interface AuditCreationEmailData { | ||
auditorName: string; | ||
procedureName: string; | ||
auditUrl: string; | ||
overviewUrl: string; | ||
reportUrl: string; | ||
} | ||
|
||
|
@@ -17,13 +16,12 @@ export function html(data: AuditCreationEmailData): string { | |
|
||
export function plain(data: AuditCreationEmailData): string { | ||
return ` | ||
Bonjour ${data.auditorName}, vous venez de créer l’audit "${data.procedureName}". | ||
Bonjour, vous venez de créer l’audit "${data.procedureName}". | ||
Vous trouverez ci-dessous le lien administrateur de l’audit. Pensez bien à le conserver, c’est le seul moyen de reprendre l’édition de l’audit. | ||
${data.auditUrl} | ||
Voici le lien de la synthèse d’audit (privé) permettant d’accéder aux documents suivants : l’audit, le rapport d’audit et la déclaration d’accessibilité (dans le cas d’un audit 106 critères). Pensez-bien à conserver ce lien, c’est le seul moyen d’accéder à vos documents. | ||
${data.overviewUrl} | ||
Vous trouverez ci-dessous le lien public du rapport d’audit. Il vous permet de consulter et vérifier le rapport d’audit. Vous devrez le partager une fois que l’audit sera terminé. | ||
${data.reportUrl} | ||
Voici le lien du rapport d’audit (public) : ${data.reportUrl} | ||
Vous avez une question ? Vous pouvez nous contacter en utilisant l’adresse e-mail [email protected]. | ||
`; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.