-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix: Added the new delete confirmation for pages also to delete translation #8111
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: Added the new delete confirmation for pages also to delete translation #8111
Conversation
Reviewer's Guide by SourceryThis pull request improves the delete confirmation message for page translations by using the same message as for deleting pages. It also refactors the code to use a common mixin for both Sequence diagram for the improved page translation deletion processsequenceDiagram
actor Admin
participant PA as PageContentAdmin
participant PDM as PageDeleteMessageMixin
participant PC as PageContent
participant P as Page
participant PL as Plugins
Admin->>PA: Request delete translation
PA->>PDM: get_deleted_objects()
PDM-->>PA: Filtered objects to delete
PA->>PC: Delete page content
PA->>P: Update page cache
PA->>PL: Delete associated plugins
Note over PA,PL: Now handles multiple PageContent objects<br/>when versioning is enabled
PA-->>Admin: Show success message
Class diagram showing the new PageDeleteMessageMixin inheritanceclassDiagram
class PageDeleteMessageMixin {
+delete_confirmation_template: str
+get_deleted_objects(objs, request)
}
class PageAdmin {
}
class PageContentAdmin {
}
class ModelAdmin {
}
ModelAdmin <|-- PageAdmin
ModelAdmin <|-- PageContentAdmin
PageDeleteMessageMixin <|-- PageAdmin
PageDeleteMessageMixin <|-- PageContentAdmin
note for PageDeleteMessageMixin "New mixin for shared delete confirmation logic"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @fsbraun - I've reviewed your changes - here's some feedback:
Overall Comments:
- There are commented out test assertions in test_delete_translation() - these should either be fixed to match the new behavior or an explanation provided for why they were disabled
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my team tested all the functionally
….1 (#8112) * backport: Delete translation deletes all page content objects with the page/language combination * fix typo * Fix message action * Update cms/admin/pageadmin.py
Description
#8070 added an improved delete confirmation message for pages. The confirmation message for "delete translation" was kept unchanged. This PR adds the same message for delete translation:
PageAdmin
andPageContentAdmin
in a common mixinPageContent
objects when using versioning.Backport needed for the last point to the
release/4.1.x
branch.Related resources
Checklist
develop-4
Summary by Sourcery
Standardize the delete confirmation message for pages and translations.
Enhancements:
PageAdmin
andPageContentAdmin
.