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

fix: Consistent use of action buttons #392

Merged
merged 10 commits into from
Mar 28, 2024

Conversation

fsbraun
Copy link
Member

@fsbraun fsbraun commented Mar 12, 2024

Description

This PR makes the use of action buttons ("Publish", "Unpublish", "Discard", "Archive") consistent:

  • Buttons appear if they can be applied in principle to the content object (i.e. "Publish" for draft content objects)
  • If the user cannot execute the action for any reason, e.g., missing permissions, the button is disabled.

Currently, for example, a user w/o publishing permission will not see a "Publish" button. After this PR they will see one (if the object is a draft) but it will be disabled.

This is also the behaviour of the core.

Additionally, the same rules apply for "archive" which so far did not check any conditions if the user can archive the object, and "unlock version" which so far had only hard-coded checks and did not use the conditions framework.

Related resources

Checklist

  • I have opened this pull request against master
  • I have added or modified the tests when changing logic
  • I have followed the conventional commits guidelines to add meaningful information into the changelog
  • I have read the contribution guidelines and I have joined #workgroup-pr-review on
    Slack to find a “pr review buddy” who is going to review my pull request.

@fsbraun fsbraun requested a review from Aiky30 March 12, 2024 19:42
Copy link

codecov bot commented Mar 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.50%. Comparing base (f90c5b2) to head (09e633e).
Report is 11 commits behind head on master.

❗ Current head 09e633e differs from pull request most recent head e7b95ed. Consider uploading reports for the commit e7b95ed to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #392      +/-   ##
==========================================
+ Coverage   90.88%   91.50%   +0.62%     
==========================================
  Files          72       72              
  Lines        2546     2579      +33     
  Branches      361      367       +6     
==========================================
+ Hits         2314     2360      +46     
+ Misses        168      155      -13     
  Partials       64       64              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fsbraun fsbraun requested a review from marksweb March 27, 2024 19:01
@fsbraun fsbraun merged commit f43c923 into django-cms:master Mar 28, 2024
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants