Skip to content

T3003 decouple theme from child protection page#286

Open
Danielgergely wants to merge 4 commits into14.0from
T3003-decouple-theme-from-child-protection-page
Open

T3003 decouple theme from child protection page#286
Danielgergely wants to merge 4 commits into14.0from
T3003-decouple-theme-from-child-protection-page

Conversation

@Danielgergely
Copy link
Member

  • FIX: added new form validation attributes to .js file
  • REFACTOR: changed required="true" to required="required"
  • REFACTOR: removed 2025 theme buttons and titles from child protection page
  • REFACTOR: extended the validation logic to include all the check boxes
  • REFACTOR: removed theme_compassion_2025 from website_child_protection/manifest.py dependency list
  • FEAT: created override templates for the child protection page and thank you page
  • FEAT: aded template to manifes
  • REFACTOR: added ids to templates in website child protection for easier identification
  • STYLE: pre-commit

… charter

- FIX: added new form validation attributes to .js file
- REFACTOR: changed required="true" to required="required"
- REFACTOR: removed 2025 theme buttons and titles from child protection page
- REFACTOR: extended the validation logic to include all the check boxes
- REFACTOR: removed theme_compassion_2025 from website_child_protection/__manifest__.py dependency list
- FEAT: created override templates for the child protection page and thank you page
- FEAT: aded template to manifes
- REFACTOR: added ids to templates in website child protection for easier identification
- STYLE: pre-commit
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Danielgergely, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request aims to improve the modularity and maintainability of the child protection page by decoupling its direct dependency on a specific theme module. It achieves this by moving theme-specific styling and components into dedicated override templates within the theme itself, while simultaneously enhancing the form's validation logic to ensure all required checkboxes are explicitly agreed upon before submission.

Highlights

  • Theme Decoupling: Decoupled the theme_compassion_2025 module from the website_child_protection module's dependencies, improving modularity.
  • Template Overrides: Introduced new override templates within theme_compassion_2025 to customize the child protection and thank you pages, ensuring theme consistency without direct dependency.
  • Enhanced Form Validation: Extended form validation logic on the child protection page to require all four agreement checkboxes to be checked before submission.
  • Attribute Standardization: Standardized HTML required attributes from true to required for consistency.
  • Element Identification: Added unique IDs to key elements in the child protection templates for easier identification and overriding.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • theme_compassion_2025/manifest.py
    • Added views/child_protection_override.xml to the list of views.
  • theme_compassion_2025/views/child_protection_override.xml
    • Created a new XML file defining template overrides for the child protection charter page and its confirmation page.
    • Replaced default submit buttons and titles with theme_compassion_2025's custom ThemedButtonComponent and TitleComponent.
  • website_child_protection/manifest.py
    • Removed theme_compassion_2025 from the module's dependencies.
  • website_child_protection/static/src/js/website_child_protection.js
    • Replaced a single agreed boolean form field with four distinct boolean fields (read_check, validation_check, legal_check, understand_check) for more granular agreement tracking.
  • website_child_protection/templates/child_protection_charter.xml
    • Updated required="true" attributes to required="required" for all checkboxes.
    • Renamed the agreed checkbox to understand_check.
    • Replaced theme-specific button and title components with generic HTML elements and Bootstrap classes, preparing for theme decoupling.
    • Added id attributes to the submit button container, thank you page title, and thank you page card for easier targeting.
  • website_child_protection/wizards/agreement_child_protection_charter_form.py
    • Imported _ for translation and ValidationError for custom exceptions.
    • Replaced the single agreed boolean field with four new boolean fields (read_check, validation_check, legal_check, understand_check).
    • Implemented a validation check in the create method to ensure all four new boolean fields are true before proceeding.
    • Adjusted the super() call and iteration logic to accommodate the new validation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist
Copy link
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@Danielgergely
Copy link
Member Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively decouples the website_child_protection module from theme_compassion_2025 by removing the direct dependency and using template overrides for theming. The changes are well-structured, including updates to form validation on both the frontend and backend. I've added a few review comments with suggestions to fix a typo, improve component usage for better maintainability, and align with modern Python syntax.

- FEAT: added de/fr/it translation to the 2025 theme for the overridden child protection and thank you pages
- FIX: pre-commit -> using attributes instead of replace
- STYLE: pre-commit
- FIX: removed commented out old translations from website_child_protection .po files
- FIX: added z-index: -1 to thank you page section so it does not cover the language selector
- FIX: removed explicit type in super().create()
@Danielgergely
Copy link
Member Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively decouples the theme_compassion_2025 from the website_child_protection module by removing the direct dependency and using override templates for styling. The form validation has also been improved to handle multiple checkboxes. The changes are logical and well-implemented. I've included a couple of comments on potential issues regarding an incomplete translation file and the use of an inline style that could affect the layout.

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.

1 participant

Comments