django-cms / djangocms-versioning

General purpose versioning package for Django CMS 4 and above.
Other
33 stars 29 forks source link

fix: Copy language menu #299

Closed fsbraun closed 1 year ago

fsbraun commented 1 year ago

Description

djangocms-versioning patches the toolbar and rebuilds the copy language menu to copy from the latest (potentially draft) version of the other language.

If no version of another language existed the toolbar threw an exception when trying to get the link for the action. With the toolbar raising an exception the page content becomes uneditable.

This PR greys out languages which do not have any published or draft version available to copy a language from.

Checklist

codecov[bot] commented 1 year ago

Codecov Report

Merging #299 (f9e8c91) into master (e6a33ea) will decrease coverage by 1.22%. The diff coverage is 60.00%.

@@            Coverage Diff             @@
##           master     #299      +/-   ##
==========================================
- Coverage   87.61%   86.39%   -1.23%     
==========================================
  Files          29       23       -6     
  Lines        1591      801     -790     
  Branches      260      106     -154     
==========================================
- Hits         1394      692     -702     
+ Misses        141       82      -59     
+ Partials       56       27      -29     
Impacted Files Coverage Δ
djangocms_versioning/cms_toolbars.py 94.36% <50.00%> (-1.35%) :arrow_down:
djangocms_versioning/helpers.py 90.90% <100.00%> (ø)
djangocms_versioning/admin.py
djangocms_versioning/models.py
djangocms_versioning/forms.py
djangocms_versioning/cms_config.py
djangocms_versioning/__init__.py
djangocms_versioning/conf.py

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