Skip to content
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

refactor(documentation): partie 5, ajout de la vue de consultation de détail du modèle document de l'app documentation #789

Closed
wants to merge 6 commits into from

Conversation

vincentporte
Copy link
Contributor

@vincentporte vincentporte commented Sep 25, 2024

Issue #765

Description

🎸 Ajout de la vue de detail de Document et de ses gabarits

Type de changement

🎢 Nouvelle fonctionnalité (changement non cassant qui ajoute une fonctionnalité).
🎨 changement d'UI

Points d'attention

🦺 suite PR #786
🦺 Mise à jour de breadcrumb
🦺 Ajout d'un test manquant concernant le remplacement des images dans parse_response_to_soup
🦺 Enrichissement de parse_response_to_soup pour rendre les snapshot agnostiques vis-à-vis des dates de mises à jour

Captures d'écran (optionnel)

DocumentDetailView

image

@vincentporte vincentporte added python Pull requests that update Python code templating technical debt labels Sep 25, 2024
@vincentporte vincentporte self-assigned this Sep 25, 2024

iframe_regex = r"((<div>)?<iframe[^>]*>.*?<\/iframe>(<\/div>)?)"

for match, starts_with, ends_with in re.findall(iframe_regex, text, re.DOTALL):

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data

This [regular expression](1) that depends on a [user-provided value](2) may run slow on strings starting with '<iframe' and with many repetitions of '<iframe'. This [regular expression](3) that depends on a [user-provided value](2) may run slow on strings starting with '<iframe>' and with many repetitions of '<iframe>'.
@vincentporte vincentporte changed the base branch from master to 765-part4 September 25, 2024 07:52
@vincentporte vincentporte changed the title refactor(documentation): partie 5, ajout des vues de consultation du modèle document de l'app documentation refactor(documentation): partie 5, ajout de la vue de consultation de détail du modèle document de l'app documentation Sep 30, 2024
@vincentporte vincentporte marked this pull request as ready for review September 30, 2024 14:52
Copy link
Contributor

@hellodeloo hellodeloo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

[
(lambda document: None, "document_detail_view"),
(
lambda document: setattr(document, "partner", PartnerFactory(for_snapshot=True)) or document.save(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu peux utiliser un def pour avoir plusieurs statements, au lieu de jouer avec le fait que setattr retourne None 🙈
Ça permettrait aussi de faire l’assignement directement, sans passer par setattr. 🤷

<div class="col-12 col-lg-3 vertical-line">
<p class="h3 text-decoration-none d-inline-block">Les autres fiches du thème {{ document.category.name }}</p>
<ul class="nav nav-tabs flex-column">
{% for document_in_category in document.category.documents.all %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J’imagine qu’on souhaitera exclure document.pk de la liste ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests that update Python code technical debt templating
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants