django-cms / djangocms-versioning

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

feat: Optional loose versioning rules #296

Closed fsbraun closed 1 year ago

fsbraun commented 1 year ago

Description

The default rules of versioning allow a clear history of what was published when. This implies that once a version is unpublished it may not be published again. Instead a new draft can be created (using revert) that then can be published. This PR introduces an optional loose versioning rule set where versions are cerated for changes in content only.

Strict versioning rules

Use if you need transparency what was published when.

The default and so far only allowed transitions for a specific version object are: transitions-strict

New loose versioning option

Use if you not regularly need to know exactly what was published when but it is sufficient to have an overview what different content was created in the past.

New rules can be activated by setting DJANGOCMS_VERSIONING_STRICT = False in settings.py. Then archived and unpublished versions can be published again w/o creating a new version object first: transitions-loose

Creation date and last modified date to not reflect when a now unpublished version was public in this scenario. You will have to go back to the StateTracking model.

Related resources

Checklist

codecov[bot] commented 1 year ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@abc8ea7). Click here to learn what that means. The diff coverage is 100.00%.

:exclamation: Current head fb59289 differs from pull request most recent head 1e16a93. Consider uploading reports for the commit 1e16a93 to get more accurate results

@@            Coverage Diff            @@
##             master     #296   +/-   ##
=========================================
  Coverage          ?   89.94%           
=========================================
  Files             ?       68           
  Lines             ?     2257           
  Branches          ?      300           
=========================================
  Hits              ?     2030           
  Misses            ?      172           
  Partials          ?       55           
Impacted Files Coverage Δ
djangocms_versioning/cms_toolbars.py 95.70% <100.00%> (ø)
djangocms_versioning/conf.py 100.00% <100.00%> (ø)
djangocms_versioning/models.py 94.85% <100.00%> (ø)
djangocms_versioning/test_utils/test_helpers.py 100.00% <100.00%> (ø)

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

lgtm-com[bot] commented 1 year ago

This pull request introduces 1 alert when merging 3076c0425243b27c1b863ac0f1b819736145c8d8 into e6a33eac1a1ce6c82810da4eff9e5397394604a4 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 1 year ago

This pull request introduces 1 alert when merging e7e51901779e5d2a3662b80f94b588b1064d0e0a into e6a33eac1a1ce6c82810da4eff9e5397394604a4 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 1 year ago

This pull request introduces 1 alert when merging 036b8f4ac01936e903015b940c3ccd8f89fef2e4 into 31f14df4a7624d4be60282c11ec38f0108026e69 - view on LGTM.com

new alerts: