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

feat: Universal support for django CMS v3 and v4 #631

Merged
merged 27 commits into from
Dec 21, 2022
Merged

feat: Universal support for django CMS v3 and v4 #631

merged 27 commits into from
Dec 21, 2022

Conversation

fsbraun
Copy link
Member

@fsbraun fsbraun commented Oct 10, 2022

If PR merges django cms v4 compatibility into the current develop branch. It's objective is to unite the two current develop branches (develop and support/4.0.x) into one branch so that the next release of djangocms-text-ckeditor will support versions 3 and 4 of django CMS universally.

This PR essentially adds the changes of the support/4.0.x branch to the develop branch and adds appropriate case handling for django CMS v3.x and v4.

  • The key difference is the way child plugins for a Text plugin are created and deleted.
  • The javascript frontend needs to supply the position parameter to create child plugins for v4 (also supplied though not relevant for v3)
  • Additionally the improved handling of ghost plugins has been ported forward.
  • Fixtures have been added to the tests so they can run both on django CMS v3.x and v4.

Tests pass for Django 2.2, 3.1, 3.2, and 4.0 and django CMS 3.7, 3.7, 3.9., 3.10, 3.11 and 4.0-develop.

utils.py adds an is_cms_v4 property which is True for django CMS v4+ and false for django CMS v3. It also has a property cms_placeholder_add_plugin which contains the unreversed name of the add plugin endpoint (which differs between v3 and v4).

As with the current support/4.0.x branch tests currently run w/o using djangocms-versioning.

@codecov
Copy link

codecov bot commented Oct 10, 2022

Codecov Report

Merging #631 (5a10d43) into master (c8d5fce) will increase coverage by 6.24%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #631      +/-   ##
==========================================
+ Coverage   69.93%   76.18%   +6.24%     
==========================================
  Files          16       20       +4     
  Lines         449      932     +483     
  Branches       49      124      +75     
==========================================
+ Hits          314      710     +396     
- Misses        118      196      +78     
- Partials       17       26       +9     
Impacted Files Coverage Δ
djangocms_text_ckeditor/apps.py 100.00% <100.00%> (ø)
djangocms_text_ckeditor/cms_plugins.py 73.89% <100.00%> (ø)
djangocms_text_ckeditor/forms.py 100.00% <100.00%> (ø)
djangocms_text_ckeditor/models.py 89.13% <100.00%> (ø)
djangocms_text_ckeditor/utils.py 89.89% <100.00%> (+0.65%) ⬆️
djangocms_text_ckeditor/widgets.py 81.53% <100.00%> (+0.58%) ⬆️
djangocms_text_ckeditor/__init__.py 100.00% <0.00%> (ø)
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

tests/fixtures.py Fixed Show fixed Hide fixed
Copy link
Member

@vinitkumar vinitkumar left a comment

Choose a reason for hiding this comment

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

Please check my one review comment

djangocms_text_ckeditor/cms_plugins.py Show resolved Hide resolved
@fsbraun fsbraun merged commit 3d09c69 into django-cms:master Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants