Fix champs bloquants pour les préavis d'accès aux services#4948
Fix champs bloquants pour les préavis d'accès aux services#4948
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
louptheron
left a comment
There was a problem hiding this comment.
Je sais que c'est en draft, mais p'tit comment :)
fbd5901 to
180e4ff
Compare
|
Je vois que les tests e2e sont instable sur master, es-ce que le test qui fail sur cet PR est lié a cette PR a priori? |
|
Je viens aussi de voir que dans les templates de préavis, la date de débarque est affiché dans tout les cas il semble, je me demande si il faut aussi supprimer les champs la bas: |
| ?.logbookMessage | ||
| ?.message as PNO? | ||
|
|
||
| val year = |
There was a problem hiding this comment.
Est-ce que tu peux rajouter un test unitaire dans CreateOrUpdateManualPriorNotificationUTests.kt pour tester ce case expectedLandingDate à null ?
There was a problem hiding this comment.
Test ajouté dans 2868b5d
Mais j'ai un gros doute, j'ai du changer le dernier assert qui verifie isBeingSent de true a false
assertThat(
allValues
.first()
.logbookMessageAndValue.value.isBeingSent,
).isFalseEs-ce que c'est normal dans le cas purpose != LAN?
There was a problem hiding this comment.
Oui c'est normal que ça soit false car tu passes fishingCatches = listOf(),
Donc isPriorNotificationZero est à true :
val isPriorNotificationZero = fishingCatches.all { it.weight == null || it.weight == 0.0 }
// If the prior notification is not in verification scope,
// we pass `isBeingSent` as `true` in order to ask the workflow to send it.
val isBeingSent = !isInVerificationScope && isPartOfControlUnitSubscriptions && !isPriorNotificationZero
180e4ff to
80b6837
Compare
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
5ee1909 to
2868b5d
Compare
|
Question sur le Dans function fillTemplate(html: string, data: TemplateData): string {
return html.replace(/{(.*?)}/g, (_, key) => (data[key] !== null && data[key] !== undefined ? String(data[key]) : ''))
}On dirait une grosse antipattern. Ça rend la maintenance compliquée parce-qu’il n'y a pas de type checking ni de logique imbriquée possible.
|
Je crois qu'à la base y'avait ce même template dans le code Python donc le but c'était de s'en approcher.
Oui OK pour moi. |
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
|



Fixes #4857 #4446
email_body_template.jinja:base_template.jinja:template.tsNotes:
purpose === LAN(frontend/src/features/PriorNotification/components/ManualPriorNotificationForm/Form.tsx)purpose === LAN. (frontend/src/features/PriorNotification/components/ManualPriorNotificationForm/constants.ts)template.tsétait une antipattern (formating via string.replace), du coup j'ai remplacé par une vrai template string 01b77f3