8000 fix: Allow frontend editing of page title fields by fsbraun · Pull Request #8131 · django-cms/django-cms · GitHub
[go: up one dir, main page]

Skip to content

fix: Allow frontend editing of page title fields #8131

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

Merged
merged 3 commits into from
Feb 3, 2025

Conversation

fsbraun
Copy link
Member
@fsbraun fsbraun commented Feb 3, 2025

Description

This PR fixes #7689 by adding the missing class property title_frontend_editable_fields to PageAdmin.

Related resources

Checklist

  • I have opened this pull request against develop-4
  • 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 the channel #pr-reviews on our Discord Server to find a “pr review buddy” who is going to review my pull request.

Summary by Sourcery

Fix the frontend editing capability for page title fields by introducing the title_frontend_editable_fields property in PageAdmin and add a corresponding test to ensure the functionality works as expected.

Bug Fixes:

  • Fix the issue allowing frontend editing of page title fields by adding the missing class propert 8000 y title_frontend_editable_fields to PageAdmin.

Tests:

  • Add a test to verify the page edit field endpoint for frontend editing of page title fields.

Copy link
Contributor
sourcery-ai bot commented Feb 3, 2025

Reviewer's Guide by Sourcery

This pull request addresses issue #7689 by adding the 'title_frontend_editable_fields' property to the PageAdmin class, enabling frontend editing of page title fields. Additionally, a new test was added to verify the functionality of the page title field editing endpoint.

Class diagram showing PageAdmin changes

classDiagram
    class PageAdmin {
        +search_fields: list
        +title_frontend_editable_fields: list
        +has_module_permission(request)
        +move_form: MovePageForm
        +inlines: list
    }
    note for PageAdmin "Added title_frontend_editable_fields
for frontend title editing capability"
Loading

File-Level Changes

Change Details Files
Added a new test for page title field editing endpoint
  • Introduced a new test method 'test_page_edit_field_endpoint' in the test_admin.py file.
  • The test checks if the page title field is editable via the frontend by sending a GET request to the endpoint and verifying the response contains the expected input field.
cms/tests/test_admin.py
Added 'title_frontend_editable_fields' property to PageAdmin
  • Added a new class property 'title_frontend_editable_fields' to the PageAdmin class.
  • The property includes fields 'title', 'menu_title', and 'page_title' to allow frontend editing.
cms/admin/pageadmin.py

Assessment against linked issues

Issue Objective Addressed Explanation
#7689 Fix the missing 'title_frontend_editable_fields' property in PageAdmin for CMS4
#7689 Enable frontend editing of page title fields in the admin interface
#7689 Resolve the 500 error when attempting to edit page title fields

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 your dashboard 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

@fsbraun fsbraun added needs to be backported Commits need to be backported 4.1 5.0 labels Feb 3, 2025
@fsbraun fsbraun requested a review from vinitkumar February 3, 2025 17:57
Copy link
Contributor
@sourcery-ai sourcery-ai bot left a 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 and they look great!

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.

Copy link
Member
@vinitkumar vinitkumar left a comment

Choose a reason for hiding this comment

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

Looks good to me. Let's get this merged and released 🚢 🚀

@vinitkumar vinitkumar merged commit 5f36e1c into develop-4 Feb 3, 2025
53 checks passed
@vinitkumar vinitkumar deleted the fix/issue-7689 branch February 3, 2025 19:42
fsbraun added a commit to fsbraun/django-cms that referenced this pull request Feb 3, 2025
fsbraun added a commit that referenced this pull request Feb 4, 2025
* fix: Placeholder page getter failed for unpublished pages (#8115)

* Fix: Placeholder page getter fails for unpublished pages

* Update cms/models/placeholdermodel.py

* Update cms/models/placeholdermodel.py

* fix: Allow frontend editing of page title fields (#8131)
@fsbraun fsbraun removed the needs to be backported Commits need to be backported label Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] CMS4 render_model doesn't work for title attributes
2 participants
0