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

[DONE] Fix the bug in the playlist application #1000

Merged

Conversation

SebastienCozeDev
Copy link
Contributor

@SebastienCozeDev SebastienCozeDev commented Oct 30, 2023

Before sending your pull request, make sure the following are done :

  • You have read our contribution guidelines.
  • Your PR targets the develop branch.
  • The title of your PR starts with [WIP] or [DONE].

Bug fixes

  • Fix the playlist sorting.
  • Fix the filters on the page listing the playlists.
  • Fix the auto-play.
  • Fix the error 500 for AnonymousUser in playlist.
  • Fix enriched videos in playlists.

@SebastienCozeDev SebastienCozeDev force-pushed the SebastienCozeDev/fix_playlist_app branch from ed1d9f4 to f28fab4 Compare November 7, 2023 10:09
@SebastienCozeDev SebastienCozeDev marked this pull request as ready for review November 9, 2023 12:57
Copy link

gitguardian bot commented Nov 9, 2023

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
Once a secret has been leaked into a git repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@SebastienCozeDev SebastienCozeDev force-pushed the SebastienCozeDev/fix_playlist_app branch 3 times, most recently from 27b76bf to 7afe706 Compare November 9, 2023 14:24
@SebastienCozeDev SebastienCozeDev changed the title [WIP] Fix the bug in the playlist application [DONE] Fix the bug in the playlist application Nov 9, 2023
@ptitloup
Copy link
Contributor

ptitloup commented Nov 9, 2023

Ok pour moi niveau fonctionnel - RAS

Copy link
Contributor

@AymericJak AymericJak left a comment

Choose a reason for hiding this comment

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

Pas testé, mais quelques remarques à apporter :)

pod/enrichment/templates/enrichment/edit_enrichment.html Outdated Show resolved Hide resolved
pod/enrichment/templates/enrichment/edit_enrichment.html Outdated Show resolved Hide resolved
pod/enrichment/templates/enrichment/edit_enrichment.html Outdated Show resolved Hide resolved
pod/enrichment/templates/enrichment/edit_enrichment.html Outdated Show resolved Hide resolved
pod/enrichment/templates/enrichment/edit_enrichment.html Outdated Show resolved Hide resolved
pod/playlist/utils.py Outdated Show resolved Hide resolved
pod/playlist/utils.py Outdated Show resolved Hide resolved
pod/video/models.py Outdated Show resolved Hide resolved
pod/video/templates/videos/video_aside.html Show resolved Hide resolved
pod/video/templates/videos/video_aside.html Outdated Show resolved Hide resolved
Copy link
Collaborator

@Badatos Badatos left a comment

Choose a reason for hiding this comment

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

quelques remarques ci-dessous

.gitguardian.yml Outdated Show resolved Hide resolved
pod/enrichment/templates/enrichment/edit_enrichment.html Outdated Show resolved Hide resolved
pod/enrichment/templates/enrichment/edit_enrichment.html Outdated Show resolved Hide resolved
@@ -0,0 +1,6 @@
{% load i18n %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

pas besoin d'i18n a priori sur cette page ^^

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On utilise directement ce template pour remplacer la page en AJAX. C'est fait dans la vue get_video de l'app playlist.

pod/enrichment/tests/test_views.py Show resolved Hide resolved
pod/video/templates/videos/video_aside.html Outdated Show resolved Hide resolved
@SebastienCozeDev SebastienCozeDev changed the title [DONE] Fix the bug in the playlist application [WIP] Fix the bug in the playlist application Nov 9, 2023
@SebastienCozeDev SebastienCozeDev changed the title [WIP] Fix the bug in the playlist application [DONE] Fix the bug in the playlist application Nov 10, 2023
<div class="card-body card-text text-center">
{% include "videos/link_video.html" with hide_favorite_link=True %}
</div>
<div class="card" id="card-enrichment-informations" style="display: none;">
Copy link
Contributor

Choose a reason for hiding this comment

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

On pourrait regarder implement si enrichment est dans l'URL courant, fait un truc du genre :

{% if "enrichment" in request.URL %} {% include information %}{% endif %}

pod/enrichment/templates/enrichment/edit_enrichment.html Outdated Show resolved Hide resolved
pod/enrichment/templates/enrichment/group_enrichment.html Outdated Show resolved Hide resolved
pod/enrichment/tests/test_views.py Outdated Show resolved Hide resolved
pod/enrichment/views.py Show resolved Hide resolved
pod/playlist/utils.py Show resolved Hide resolved
pod/video/models.py Outdated Show resolved Hide resolved
pod/video/templates/videos/video_edit.html Outdated Show resolved Hide resolved
@SebastienCozeDev
Copy link
Contributor Author

SebastienCozeDev commented Nov 10, 2023

Est-ce possible de tester en le retirant ?

C'est effectivement fonctionnel pour ce template

On pourrait regarder implement si enrichment est dans l'URL courant, fait un truc du genre :

{% if "enrichment" in request.URL %} {% include information %}{% endif %}

On a besoin de la div pour pouvoir refresh à chaque vidéo :

const idElements = [
    'card-manage-video',
    'card-takenote',
    'card-share',
    'card-disciplines',
    'card-types',
]
for (let id of idElements) {
    if (document.getElementById(id)) refreshElementWithDocumentFragment(`#${id}`, pageAside);
}

@ptitloup

<div class="card-body card-text text-center">
{% include "videos/link_video.html" with hide_favorite_link=True %}
</div>
<div class="card" id="card-enrichment-informations" style="display: none;">
Copy link
Contributor

Choose a reason for hiding this comment

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

as-tu tester ce point ?

Copy link
Contributor

@AymericJak AymericJak left a comment

Choose a reason for hiding this comment

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

Good !

@AymericJak
Copy link
Contributor

Ah non, un test ne passe pas.

Corrige comme suit pour le type de retour :

from typing import Union

def function() -> Union[str, None]:

@SebastienCozeDev
Copy link
Contributor Author

SebastienCozeDev commented Nov 10, 2023

as-tu tester ce point ?

Oui

@ptitloup

@SebastienCozeDev
Copy link
Contributor Author

On pourrait regarder implement si enrichment est dans l'URL courant, fait un truc du genre :

{% if "enrichment" in request.URL %} {% include information %}{% endif %}

On a besoin de la div des deux côtés. Sinon, on aura aucun moyen de l'afficher pour les vidéos enriches lors de la lecture de la playlist.

@ptitloup

Copy link
Contributor

@ptitloup ptitloup left a comment

Choose a reason for hiding this comment

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

ok pour moi, le point sur l'inclusion des templates en cas de vidéos enrichies reste un mystère mais qui n'enleve en rien la quelité de cette contribution. Merci bcp

@ptitloup ptitloup merged commit 3040f59 into EsupPortail:develop Nov 10, 2023
4 checks passed
vsabatie pushed a commit to vsabatie/Pod that referenced this pull request Nov 22, 2023
* Fix the playlists sorting

* 🐛 Fix the autoplay

* 🐛 Fix enriched videos in playlists

* 🎨 Fix flake8

* 🐛 Fix the error 500 for AnonymousUser in playlist

* 🐛 Fix enriched videos in playlists

* 🐛 Fix the numberPlaylists condition

* 🔒 Fix GitGuardian

* 🎨 Add line at the end file

* 🎨 Replace 'var' by 'let' when it is possible

* 🎨 Rename illegible identifier

* Add aria-hidden attribute

* 📝 Add JSDocs

* 📝 Add PyDocs

* 🎨 Improve condition

* Create a real request error

* Rename 'enrichmentinformations_card.html to 'enrichment_informations_card_aside.html'

* 🎨 Fix flake8

* 🐛 Replace enrichmentinformations_card by erichment_informations_card_aside

* Remove unused load

* Re-add aria-hidden attributes

* Update the quotation marks

* 📝 Update PyDoc

* 🐛 Fix coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants