django-cms / djangocms-frontend

django CMS frontend is a plugin bundle for django CMS providing several components for the frontend, currently implemented with the popular Bootstrap 5 framework.
Other
55 stars 21 forks source link

feat: Adds BS5 modal components #234

Open mavoIn opened 2 months ago

mavoIn commented 2 months ago

As discussed in #233 I added a modal component. It works like the cards component. Basic documentation added as well.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 0% with 136 lines in your changes missing coverage. Please review.

Project coverage is 82.96%. Comparing base (f11feee) to head (bc44590). Report is 35 commits behind head on master.

Files with missing lines Patch % Lines
djangocms_frontend/contrib/modal/forms.py 0.00% 47 Missing :warning:
djangocms_frontend/contrib/modal/cms_plugins.py 0.00% 45 Missing :warning:
djangocms_frontend/contrib/modal/models.py 0.00% 26 Missing :warning:
...ms_frontend/contrib/modal/frameworks/bootstrap5.py 0.00% 13 Missing :warning:
djangocms_frontend/contrib/modal/constants.py 0.00% 5 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #234 +/- ## ========================================== - Coverage 86.93% 82.96% -3.97% ========================================== Files 120 125 +5 Lines 3107 3252 +145 Branches 330 337 +7 ========================================== - Hits 2701 2698 -3 - Misses 304 452 +148 Partials 102 102 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

fsbraun commented 2 months ago

So coool! 😎 I will look into it! Can you get the pre-commit stuff sorted out meanwhile?

mavoIn commented 2 months ago

Hi @fsbraun, it is my first pull request ever. Maybe you have to look over the code twice. 😇 I tested it locally. Meanwhile I use the forked version. Best mavoIn

fsbraun commented 2 months ago

Hey @mavoIn ! Can I ask you to do the following things:

I hopefully will be able to test the modal in a pet project tomorrow.

mavoIn commented 2 months ago

HI @fsbraun , Unfortunately, I have only been able to prepare a few test files for you. They are not complete. I am currently busy learning more. :D

fsbraun commented 2 months ago

Also, can you take a look at the import issue showing up in tests? And the migrations seem not up-to-date. You may update the initial migration - they are DB no-ops anyways.

mavoIn commented 2 months ago

Hello @fsbraun, thanks a lot for all your advices. I added the missing migrations and updated the documentation.

There are problems importing the tests because I was only able to insert a code framework from the collapse example. Please let me know so that you can fix the tests or I might have to ask friends for further support.

Best mavoIn

fsbraun commented 1 week ago

@mavoIn I see you have updated quite a few things! Thank you. Still, the tests are failing. Try running them locally: python ./run_tests.py. There seems to be an import issue, an attribute issue and maybe some tweaking for the migrations required.

mavoIn commented 1 week ago

I have some concerns about the structure:

  • Modal triggers should be possible anywhere on a page
  • The Modal plugin is not needed as far as I can see. I think the <div class="modal"></div> can go into the modal container.
  • I still would need to understand a use case with a static trigger. Can you give an exmaple?

Hi @fsbraun, what do you exactly mean with static trigger? Do you mean the requirement of the trigger inside the modal component? From my perspective i want to prevent user errors by using the loosely coupled modal trigger like it is done in the collapse example.
Best mavo