-
Notifications
You must be signed in to change notification settings - Fork 4
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
Redesign de la fiche détaillée #968
base: main
Are you sure you want to change the base?
Conversation
479519e
to
cd0b426
Compare
cd0b426
to
e048df6
Compare
d90d030
to
2eae9d3
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.
Note pour plus tard : comprendre comment on passe de mobile vs desktop
@@ -22,5 +19,6 @@ test("Recherche et modification d'une recherche", async ({ page }) => { | |||
|
|||
await expect (page.locator("[data-search-solution-form-target=headerAddressPanel]")).toBeInViewport() | |||
await page.locator("button[data-testid=modifier-recherche]").click() | |||
await expect (page.locator("[data-search-solution-form-target=headerAddressPanel]")).toBeHidden() | |||
// TODO : revert |
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 adapt le test ou on le supprime ?
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 adapte !
class TestAdessesViewGetActionList: | ||
@pytest.mark.django_db | ||
class TestAdresseViewMixins: | ||
def test_iframe_mixin_is_carte(self): |
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.
ajouter un test test_iframe_mixin_is_not_…
?
Co-authored-by: Nicolas Oudard <[email protected]>
Co-authored-by: Nicolas Oudard <[email protected]>
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.
Manque d'XP sur notre setup Django pour donner à ma revue une pertinence sur la logique d'ensemble/métier.
Quelques commentaires de détails ajoutés pour améliorer code/perf par ci par là.
location = acteur.location | ||
|
||
if not (longitude and latitude and location and not acteur.is_digital): | ||
return "" |
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.
Le pattern python quand on veut signaler un manque c'est None
: raison particulière pour du ""
?
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.
OK je vois qu'on est dans du jinja donc je comprend le "", mais du coup voir ma remarque ci-dessous sur la séparation modelling vs. rendering.
* 111320 | ||
) | ||
if distance_meters >= 1000: | ||
return f"({round(distance_meters / 1000, 1)} km)".replace(".", ",") |
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 m'attendrais à séparer:
- la logique de modelling: une fonction qui retourne une distance en numérique, qu'on peut utiliser dans plusieurs endroits du code
- le rendering: un template qui prend la valeur de distance et décide de la logique l'affichage pour les êtres humains
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.
Nico avait mentionné une refacto avec des règles de nommage et séparation des concerns (ex: _labels
avec un _
vs bonus
sans): as-tu documenté/formalisé sur Notion? Si non je pense qu'il faudrait pour que je me mette à niveau 🙏
@@ -10,47 +10,6 @@ const DEFAULT_LOCATION: L.LatLngTuple = [46.227638, 2.213749] | |||
const DEFAULT_ZOOM: number = 5 | |||
const DEFAULT_MAX_ZOOM: number = 19 | |||
|
|||
// TODO : handle directly from DSFR module |
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.
@kolok penses-tu qu'il faille conserver quelque part ce mapping ?
# Even if this variable is mainly used when navigating on the Carte | ||
# or Formulaire views, it is used in templates as JSON and parsed to | ||
# be passed to Posthog analytics. | ||
# It is then required to be added on every view by default, because | ||
# the JSON parsing might raise an exception if the variable is undefined. | ||
"is_embedded": "carte" in request.GET or "iframe" in request.GET, | ||
} |
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.
@maxcorbeau @kolok est-ce clair ?
Description succincte du problème résolu
Carte notion
TODO
Description plus détaillée de l'intention, l'approche ou de l'implémentation (ce qui n’est pas visible directement en lisant le code)
Type de changement :
Auto-review
Les trucs à faire avant de demander une review :
.env.template
Comment tester
En local / staging :