### Description  
This PR introduces a user preference to toggle the visibility of the 
contribution heatmap on their profile page. Users can now enable or disable 
this feature through the edit profile section. Referencing #5804 

**Changes include:**  
- Added `show_contribution_heatmap` boolean field to the `users` table 
(default: `true`)  
- Added a checkbox in the profile edit form to manage heatmap visibility  
- Updated the `users` controller to respect this preference when rendering 
profile data  
- Added a test to ensure the feature works as expected  

### How has this been tested?  
The changes have been verified through:  
1. Automated tests  
2. Manual testing by creating a new user and toggling the setting in the edit 
profile form  

### Screenshots:
<img width="973" alt="Screenshot 2025-03-27 at 09 02 05" 
src="https://github.com/user-attachments/assets/d775daf1-fef6-4070-ad55-423dc23bb571"
 />

You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/5853

-- Commit Summary --

  * Add show_contribution_heatmap to the table via migration and update the 
profile controller
  * Add checkbox for contribution heatmap visibility on edit profile
  * Include heatmap data in user controller response based on preference
  * Add tests for heatmap visibility according to user preference

-- File Changes --

    M app/controllers/profiles_controller.rb (1)
    M app/controllers/users_controller.rb (38)
    M app/models/user.rb (63)
    M app/views/profiles/edit.html.erb (9)
    M config/locales/en.yml (3)
    A db/migrate/20250317000001_add_show_contribution_heatmap_to_users.rb (5)
    M db/structure.sql (88)
    M test/controllers/users_controller_test.rb (18)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/5853.patch
https://github.com/openstreetmap/openstreetmap-website/pull/5853.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5853
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to