Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: 7605 delete translations#8123

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
jrief wants to merge3 commits intodjango-cms:main
base:main
Choose a base branch
Loading
fromjrief:fix-7605-delete-translations

Conversation

jrief
Copy link
Contributor

@jriefjrief commentedJan 28, 2025
edited by sourcery-aibot
Loading

Description

Adds a second item to the context menu in the page tree. Now one can decide, if he wants to delete a page with all translations or just to delete the page in the current translation.

Screenshot 2025-01-28 at 15 55 09
  • I have opened this pull request againstdevelop-4
  • I have added or modified the tests when changing logic
  • I have followedthe conventional commits guidelines to add meaningful information into the changelog
  • I have read thecontribution guidelines and I have joined the channel #pr-reviews on ourDiscord Server to find a “pr review buddy” who is going to review my pull request.

Summary by Sourcery

New Features:

  • Added a second item to the context menu in the page tree to allow users to choose between deleting a page with all translations or just the current translation.

@sourcery-aiSourcery AI
Copy link
Contributor

sourcery-aibot commentedJan 28, 2025
edited
Loading

Reviewer's Guide by Sourcery

This pull request introduces a new option in the page tree context menu to allow users to delete a page with all translations or just the current translation. It also includes changes to the styles and templates to support the new functionality.

Sequence diagram for page deletion process

sequenceDiagram    actor User    participant UI as Page Tree UI    participant Backend as Django CMS Backend    participant DB as Database    User->>UI: Opens page context menu    UI->>User: Shows delete options    alt Delete all translations        User->>UI: Clicks 'Delete all translations'        UI->>Backend: Request delete page with all translations        Backend->>DB: Delete page and all translations        DB-->>Backend: Confirm deletion        Backend-->>UI: Return success        UI-->>User: Show success message    else Delete current translation        User->>UI: Clicks 'Delete this translation'        UI->>Backend: Request delete current translation        Backend->>DB: Delete current translation only        DB-->>Backend: Confirm deletion        Backend-->>UI: Return success        UI-->>User: Show success message    end
Loading

File-Level Changes

ChangeDetailsFiles
Added a new 'delete all translations' option to the page tree context menu.
  • Added a new menu item to the actions dropdown inactions_dropdown.html.
  • Added logic topageadmin.py to pass the current page content to the template.
  • Added a data attribute to the menu inmenu.html to pass the current language.
cms/templates/admin/cms/page/tree/actions_dropdown.html
cms/admin/pageadmin.py
cms/templates/admin/cms/page/tree/menu.html
Updated the iconography to include a new 'dumpster' icon.
  • Added a new icon definition for 'dumpster' in_iconography.scss.
  • Added a new css class for the dumpster icon.
cms/static/cms/sass/components/_iconography.scss
Updated CSS files to include the new icon and adjust styles.
  • Added the new icon to the font definitions incms.base.css.
  • Added the new icon to the font definitions incms.admin.css.
  • Updated the styles incms.pagetree.css to accommodate the new menu item.
  • Updated the styles incms.welcome.css to accommodate the new icon.
  • Updated the styles incms.wizard.css to accommodate the new icon.
cms/static/cms/css/4.1.1/cms.admin.css
cms/static/cms/css/4.1.1/cms.base.css
cms/static/cms/css/4.1.1/cms.pagetree.css
cms/static/cms/css/4.1.1/cms.welcome.css
cms/static/cms/css/4.1.1/cms.wizard.css

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment@sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with@sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write@sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write@sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment@sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment@sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment@sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment@sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment@sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access yourdashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-aisourcery-aibot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hey@jrief - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Please add tests to verify both deletion modes (single translation vs all translations) work correctly and don't accidentally delete unintended content
  • Consider adding a confirmation dialog when deleting all translations to prevent accidental deletion
Here's what I looked at during the review
  • 🟢General issues: all looks good
  • 🟢Security: all looks good
  • 🟢Testing: all looks good
  • 🟢Complexity: all looks good
  • 🟢Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

sourcery-ai[bot] reacted with thumbs up emojisourcery-ai[bot] reacted with thumbs down emoji
@vinitkumarvinitkumar changed the titleFix 7605 delete translationsfix: 7605 delete translationsFeb 18, 2025
@vinitkumar
Copy link
Member

@fsbraun Do you think this should make cut for 4.2/5?

@github-actionsGitHub Actions
Copy link

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@github-actionsgithub-actionsbot added stale and removed stale labelsMay 6, 2025
@@ -277,9 +277,14 @@ def actions_menu(self, request, object_id, extra_context=None):
raise self._get_404_exception(object_id)

site = get_site(request)
preview_language = request.GET.get('language')
page_content = page.get_content_obj(request.GET.get('language'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
page_content=page.get_content_obj(request.GET.get('language'))
page_content=page.get_content_obj(preview_language)

@github-actionsGitHub Actions
Copy link

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@PeterW-LWLPeterW-LWLPeterW-LWL left review comments

@sourcery-aisourcery-ai[bot]sourcery-ai[bot] left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@jrief@vinitkumar@PeterW-LWL

[8]ページ先頭

©2009-2025 Movatter.jp