-
Notifications
You must be signed in to change notification settings - Fork 7
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
Préavis – Consulter le détail des signalements à partir des tags signalements de la liste #3813
Préavis – Consulter le détail des signalements à partir des tags signalements de la liste #3813
Conversation
2bd0d92
to
b0663db
Compare
9cbb3d3
to
c13ac07
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.
Quelques commentaires et questions
...src/features/Logbook/components/VesselLogbook/LogbookMessages/messages/common/SpecyCatch.tsx
Outdated
Show resolved
Hide resolved
...src/features/Logbook/components/VesselLogbook/LogbookMessages/messages/common/SpecyCatch.tsx
Outdated
Show resolved
Hide resolved
...src/features/Logbook/components/VesselLogbook/LogbookMessages/messages/common/SpecyCatch.tsx
Show resolved
Hide resolved
@@ -46,6 +47,9 @@ export function Content({ detail, isValidatingOnChange, onClose, onSubmit, onVer | |||
|
|||
const [isCancellationConfirmationModalOpen, setIsCancellationConfirmationModalOpen] = useState(false) | |||
const [isInvalidationConfirmationModalOpen, setIsInvalidationConfirmationModalOpen] = useState(false) | |||
const [selectedVesselIdentity, setSelectedVesselIdentity] = useState<VesselIdentity | 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.
Pourquoi utiliser useState
et pas simplement un const
?
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.
Parce que cette valeur change à chaque fois qu'on sélectionne un nouveau navire, elle est ensuite passée à l'entête pour le mettre à jour, Ainsi que la première fois en tant que valeur initiale pour le champ FormikVesselSelect
ce qui permet d'éviter un appel API supplémentaire à l'ouverture du formulaire.
J'ai fait ça pour contribuer à l'amélioration des performances d'ouverture d'un formulaire manuel.
frontend/src/features/PriorNotification/components/ManualPriorNotificationForm/Form.tsx
Outdated
Show resolved
Hide resolved
...tures/PriorNotification/components/ManualPriorNotificationForm/fields/FormikVesselSelect.tsx
Outdated
Show resolved
Hide resolved
detail={detail} | ||
isNewPriorNotification={isNewPriorNotification} | ||
onClose={handleClose} | ||
selectedVesselIdentity={selectedVesselIdentity} |
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.
selectedVesselIdentity
n'était pas déjà dans detail
?
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.
selectedVesselIdentity
peut être différent de detail.vesselIdentity
lorsqu'on édite un préavis en modifiant le navire existant.
frontend/src/features/PriorNotification/components/ManualPriorNotificationForm/Form.tsx
Outdated
Show resolved
Hide resolved
...tures/PriorNotification/components/ManualPriorNotificationForm/fields/FormikVesselSelect.tsx
Outdated
Show resolved
Hide resolved
frontend/src/features/PriorNotification/components/ManualPriorNotificationForm/Form.tsx
Outdated
Show resolved
Hide resolved
...tures/PriorNotification/components/ManualPriorNotificationForm/fields/FormikVesselSelect.tsx
Outdated
Show resolved
Hide resolved
onChange: (nextVessel: VesselIdentity | undefined) => void | ||
readOnly?: boolean | undefined | ||
}> | ||
export function FormikVesselSelect({ onChange, readOnly }: FormikVesselSelectProps) { | ||
const defaultValueRef = useRef<VesselIdentity | undefined>(undefined) | ||
export function FormikVesselSelect({ initialVesselIdentity, onChange, readOnly }: FormikVesselSelectProps) { |
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 l'enlever vu qu'il y a le vesselId ?
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.
Voir le commentaire sur l’optimisation des appels.
c13ac07
to
b2d3458
Compare
...tures/PriorNotification/components/ManualPriorNotificationForm/fields/FormikVesselSelect.tsx
Outdated
Show resolved
Hide resolved
frontend/src/features/PriorNotification/components/PriorNotificationList/Row.tsx
Outdated
Show resolved
Hide resolved
const queryParams = { | ||
searched: searchQuery.toUpperCase() | ||
} | ||
const foundVesselsFromApi = await dispatch(vesselApi.endpoints.searchVessels.initiate(queryParams)).unwrap() |
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.
Avec un forceRefetch ?
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 n'est pas plutôt peu fréquent la mise à jour de la liste des navire dans la DB ? La pipeline les met à jour tous les combien ?
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 c'est vrai que c'est toutes les 3h, j'avais peur de rajouter encore du délai (car les utilisateurs laissent leur appli ouverte toute la journée) maius on peut essayer comme ça !
@@ -28,6 +26,7 @@ export type VesselSearchProps = Readonly< | |||
onChange: (nextVessel: VesselIdentity | undefined) => Promisable<void> | |||
onFocus?: () => Promisable<void> | |||
onVesselLinkClick?: (vessel: VesselIdentity) => Promisable<void> | |||
shouldCloseOnClickOutside?: boolean |
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 besoin de props je pense, il faut toujours close au clic en dehors
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.
Y compris sur la carte ? Parce que sur la carte il me semble que c'est "réduit" un peu largeur vers la droite quand on clique dehors (y compris avec les résultats affichés).
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 oui bien vu !
frontend/src/features/PriorNotification/components/PriorNotificationList/utils.tsx
Outdated
Show resolved
Hide resolved
) | ||
const isReportingFormDirty = useMainAppSelector(store => store.priorNotification.isReportingFormDirty) | ||
const vesselIdentity = useMainAppSelector(store => store.priorNotification.openedReportingListVesselIdentity) |
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 ne me souviens plus, pourquoi on a besoin de stocker ça dans redux ?
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.
Parce que la liste des signalements est ouverte à partir de 3 endroits différents ce qui serait micmac à gérer via des props si c'est bien ta question ? Et vesselIdentity
est ce qui sert à la fois au composant partagé <CurrentReportingList />
et au <CardHeader />
qui sont utilisés dans ce composant.
Quality Gate passedIssues Measures |
Linked issues