Closed fsbraun closed 1 year ago
Merging #319 (f5c5fcb) into master (7e41d8a) will increase coverage by
0.53%
. The diff coverage is92.90%
.
@@ Coverage Diff @@
## master #319 +/- ##
==========================================
+ Coverage 89.99% 90.53% +0.53%
==========================================
Files 68 68
Lines 2259 2324 +65
Branches 301 314 +13
==========================================
+ Hits 2033 2104 +71
+ Misses 171 165 -6
Partials 55 55
Impacted Files | Coverage Δ | |
---|---|---|
djangocms_versioning/forms.py | 100.00% <ø> (ø) |
|
djangocms_versioning/admin.py | 89.13% <85.71%> (+0.37%) |
:arrow_up: |
djangocms_versioning/indicators.py | 91.07% <92.85%> (+11.07%) |
:arrow_up: |
djangocms_versioning/cms_config.py | 81.77% <100.00%> (+1.17%) |
:arrow_up: |
djangocms_versioning/cms_toolbars.py | 95.95% <100.00%> (ø) |
|
djangocms_versioning/datastructures.py | 95.40% <100.00%> (-0.16%) |
:arrow_down: |
djangocms_versioning/helpers.py | 91.48% <100.00%> (+0.37%) |
:arrow_up: |
djangocms_versioning/managers.py | 85.24% <100.00%> (+2.55%) |
:arrow_up: |
djangocms_versioning/test_utils/blogpost/admin.py | 100.00% <100.00%> (ø) |
|
djangocms_versioning/versionables.py | 100.00% <100.00%> (+8.33%) |
:arrow_up: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
@Aiky30 I've updated the PR.
I do not expect additional backwards incompatible behavior. This version of versioning will not work with Django CMS 4.0 anyways since it does not use monkey patching.
All elements were tested, but only indirectly. I added tests to explicitly test especially the new query sets.
@Aiky30 OK, I'm ready for round three! Thanks for asking for the test for get_{field}_from_request
. The test (now added) revealed that I was looking for that method in the ChangeList
class while it should be in the model admin class. 🙌
The only open point is the import of cms.pagetree.css
which I believe is ok:
cms.pagetree.css
contains: icons.scss
, dropdown.scss
, legend.scss
, and node-state.scss
which are needed by this PRcms.pagetree.css
also contains tree.scss
which is not needed by this PR.I figured that css.pagetree.css
will be available in the browser cache with a high probability, and there is little chance of erroneous cross-styling as long as you do not have .jstree
or .cms-tree-item-xxx
or .cms-pagetree-xxx
in your changelist admin templates. (If you have to have you will not be able to use the mixin.)
Thanks for talking the time to look through this. I appreciate the comments (and the additional coverage prevented a bug 🙂).
Description
This PR refactors the indicators.py setup to allow using indicators outside the PageTree (i.e. other versioned models). Existing functionality does not change.
latest_content()
has been added to theadmin_manager
query set. It respects prefetched content objects reducing db accessesUsage
The status indicator for versioning can be added to a ModelAdmin by:
Remarks:
cms.pagetree.css
(not the js) from the core into the admin formExtendedVersionAdminMixin
.ExtendedIndicatorVersionAdminMixin
combines state indicators and the extended versioning admin.Example: djangocms-alias
This is the result of relpacing![image](https://user-images.githubusercontent.com/16904477/218501724-322914ae-f64a-4c8e-9c6a-80a9ffc09c7c.png)
ExtendedVersionAdminMixin
withExtendedIndicatorVersionAdminMixin
for djangocms-alias:Checklist
master