-
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: add questioning page #95
Conversation
cd3a991
to
bb8efdc
Compare
3d4f80f
to
2d80b52
Compare
3fb8461
to
1c9a8ac
Compare
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.
Un petit changement concernant l'utilisation de watch() sinon c'est bon.
src/ui/Contact/ContactFormDialog.tsx
Outdated
error={errors.lastName?.message} | ||
{...register("lastName")} | ||
onResetField={() => onResetField("lastName")} | ||
isEmpty={watch("lastName") === ""} |
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.
Cette approche risque de créer beaucoup de rerender je pense que dans ce cas là tu devrais passer par des champs contrôler ou brancher la logique de détection du vide directement dans Field
src/ui/Form/Field.tsx
Outdated
props.isEmpty === false ? ( | ||
<IconButton sx={{ mr: 2 }} size="small" onClick={props.onResetField}> | ||
<CloseIcon /> | ||
</IconButton> | ||
) : undefined |
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.
Essayer la syntaxe suivante :
props.isEmpty && <IconButton sx={{ mr: 2 }} size="small" onClick={props.onResetField}>
<CloseIcon />
</IconButton>
src/ui/Questioning/StatesCard.tsx
Outdated
const status = formData.get("status")?.toString(); | ||
|
||
if (!status) { | ||
toggleDialog(undefined); |
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.
Ce undefined me semble bizarre, il faudrait avoir un état "closed" plutôt histoire d'être cohérent
src/ui/Form/Field.tsx
Outdated
@@ -23,6 +32,7 @@ type Props = Pick<TextFieldProps, "onChange" | "onBlur" | "name" | "label" | "re | |||
labelOutside?: boolean; | |||
options?: { label: string; value: string }[]; | |||
selectoptions?: string[]; | |||
onResetField?: () => void; |
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.
"onReset" serait suffisant, je ne pense pas que "field" apporte de l'information ici
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.
Aussi, on pourrait se demander si il est pertinent d'exposer cette propriété. Le clique sur un "reset" devrait vider la valeur du champs (est donc plutôt déclencher un onChange à vide 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.
Bien vu, j'ai supprimé onResetField et j'utilise onChange à la place
src/ui/Form/Field.tsx
Outdated
field.value !== "" && ( | ||
<IconButton sx={{ mr: 2 }} size="small" onClick={onResetField}> | ||
<CloseIcon /> | ||
</IconButton> | ||
) |
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.
Conditionner l'affichage de ce endAdornment si onResetField est présent. Certains champs pourrait ne pas être reset
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.
Plus besoin si j'utilise onChange à la place (tous les fields ont une fonction onChange et d'après la maquette cette fonctionnalité doit toujours être présente lorsqu'il y a une valeur ) ^^
src/ui/Form/Field.tsx
Outdated
endAdornment: field.value !== "" && ( | ||
<IconButton size="small" onClick={onResetField}> | ||
<CloseIcon /> | ||
</IconButton> | ||
), | ||
}} |
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.
Conditionner l'affichage de ce endAdornment si onResetField est présent. Certains champs pourrait ne pas être reset
src/ui/Form/Field.tsx
Outdated
endAdornment: field.value !== "" && ( | ||
<IconButton size="small" onClick={onResetField}> | ||
<CloseIcon /> | ||
</IconButton> | ||
), |
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.
Conditionner l'affichage de ce endAdornment si onResetField est présent. Certains champs pourrait ne pas être reset
src/ui/Questioning/StatesCard.tsx
Outdated
</Row> | ||
{questioning.dateLastEvent && ( | ||
<Typography variant="bodyMedium"> | ||
{new Date(Date.parse(questioning.dateLastEvent)).toLocaleDateString()} |
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.
Créer un composant pour ça pour éviter la répétition
<FormattedDate date={questioning.dateLastEvent}/>
src/ui/Questioning/StatesCard.tsx
Outdated
/> | ||
{questioning.dateLastCommunication && ( | ||
<Typography variant="bodyMedium"> | ||
{new Date(Date.parse(questioning.dateLastCommunication)).toLocaleDateString()} |
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.
Créer un composant pour ça pour éviter la répétition
<FormattedDate date={questioning.dateLastEvent}/>
Quality Gate passedIssues Measures |
No description provided.