-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: contribution zod #1056
feat: contribution zod #1056
Conversation
…s-dune-maj-des-données
…s-dune-maj-des-données
* feat: zod validation page info * feat: implementation page info validation avec zod * feat: clean deepPartial * chore: clean --------- Co-authored-by: Victor Zeinstra <[email protected]>
…s-dune-maj-des-données
…s-dune-maj-des-données
|
GitGuardian id | Secret | Commit | Filename | |
---|---|---|---|---|
8246187 | Generic High Entropy Secret | db42d1a | .npmrc | View secret |
8246187 | Generic High Entropy Secret | 999b06d | .npmrc | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
</Box> | ||
<Box sx={{ width: "30%" }}> | ||
{answer && ( | ||
{answer?.id && answer?.statuses && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On peut avoir dans commentaire sans avoir des statuses non ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En effet, il faut plutôt gérer le cas en dessous comme pour les comments :
<Comments
answerId={answer.id}
comments={answer.answerComments ?? []}
statuses={answer.statuses ?? []}
/>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oui dans ce cas, il attend un tableau vide. La vérif check uniquement qu'il ne soit pas null ou undefined
@@ -30,7 +30,9 @@ function concatAndSort( | |||
})[] = [...comments, ...statuses]; | |||
return all | |||
.map((notif) => { | |||
notif.createdAtDate = new Date(notif.createdAt); | |||
notif.createdAtDate = notif?.createdAt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c'est pas possible de ne pas avoir de createdAd
. tu as eu le cas ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pas dans les contrib, c'est vrai. Mais dans les pages info j'ai le cas ou l'on commence à créer une page et du coup il n'y a pas de createdAt encore généré. Je ne sais pas si plus tard, on aura ce cas ici. Je peux le remettre en obligatoire dans zod
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah non je mélange avec le createdAt de answer. Dans tous les cas, je vais mettre tous nos createdAt en obligatoire dans les types contrib. Ca sera mieux en effet.
|
||
const StyledFormHelperText = styled(FormHelperText)(({ theme }) => { | ||
return { | ||
color: theme.palette.error.main, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -54,9 +56,20 @@ export const FormRadioGroup = ({ | |||
/> | |||
))} | |||
</RadioGroup> | |||
{error && error.message === "Required" ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{error && error.message === "Required" ? ( | |
{error && error.message === "Required" ?? ( |
<StyledFormHelperText> | ||
Un élément doit être sélectionner | ||
</StyledFormHelperText> | ||
) : null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
) : null} | |
)} |
</Box> | ||
<Box sx={{ width: "30%" }}> | ||
{answer && ( | ||
{answer?.id && answer?.statuses && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En effet, il faut plutôt gérer le cas en dessous comme pour les comments :
<Comments
answerId={answer.id}
comments={answer.answerComments ?? []}
statuses={answer.statuses ?? []}
/>
kaliReferences: data.id | ||
? formatKaliReferences(data.id, data.kaliReferences) | ||
: [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comme on ne peut pas créer des réponses mais seulement en éditer, on doit toujours avoir un id aussi.
const aggregatedRow = rows.flatMap(({ answers }) => | ||
answers?.length ? (answers as Answer[]) : [] | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Etrange, on ne peut pas avoir de question sans liste de réponse, pour on vérifie que c'est un tableau ici ?
@@ -22,7 +23,10 @@ export const QuestionRow = (props: { row: QueryQuestion }) => { | |||
<TableCell component="th" scope="row"> | |||
<strong>{row.order}</strong> - {row.content} | |||
</TableCell> | |||
<StatusRecap answers={row.answers} uniqKey={`${row.id}-statuses`} /> | |||
<StatusRecap | |||
answers={row.answers as Answer[]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourquoi devoir faire un as maintenant ? On perd en typage ici 🤔
@@ -37,15 +37,15 @@ export const EditQuestionAnswerList = ({ | |||
{answers?.map((answer) => { | |||
return ( | |||
<TableRow | |||
key={answer.agreement.id} | |||
key={answer?.agreement?.id} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment l'answer peut être undefined ici ?
|
||
const answerRelationSchema = answerBaseSchema.extend({ | ||
agreement: agreementSchema.optional(), | ||
statuses: z.array(answerStatusSchema).optional(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On n'a pas une liste de status même vide ?
otherReferences: z.array(otherReferenceSchema), | ||
cdtnReferences: z.array(cdtnReferenceSchema), | ||
contentFichesSpDocument: documentSchema.nullable().optional(), | ||
question: questionBaseSchema.optional(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a obligatoirement un question associée
cdtnReferences: z.array(cdtnReferenceSchema), | ||
contentFichesSpDocument: documentSchema.nullable().optional(), | ||
question: questionBaseSchema.optional(), | ||
answerComments: z.array(commentsSchema).optional(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem, mais la liste peut être vide non ?
}); | ||
|
||
export const questionRelationSchema = questionBaseSchema.extend({ | ||
answers: z.array(answerBaseSchema.deepPartial()).optional(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Une question à obligatoriement une liste de réponse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sauf si on l'inclus pas dans le graphql
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je pense qu'il faut bien distinguer les typages de backend et les typages de frontend
_createdAt && | ||
createdAt && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oui, une référence ne peut pas avoir de createdAt null
* feat: contrib answer CC hover + CC search + delete question * fix: permettre accordéon dans accordéon * chore: review * chore: fix test --------- Co-authored-by: Victor Zeinstra <[email protected]>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
🎉 Deployment for commit 3ac2d7a : IngressesDocker images
|
No description provided.