Feature/persistent public shift filter#71
Open
postgnostic wants to merge 3 commits intoHaDiNet:masterfrom
Open
Feature/persistent public shift filter#71postgnostic wants to merge 3 commits intoHaDiNet:masterfrom
postgnostic wants to merge 3 commits intoHaDiNet:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds persistence for “public shift” filtering so a user’s preference to hide/exclude public shifts can be remembered across visits (not only via URL parameters).
Changes:
- Introduces a
CalendarFiltermodel (with migrations) to store per-user public-shift filter preferences. - Updates
ShiftFilterMixinto load persisted filter state when no relevant query params are present and to persist changes when the filter form is valid. - Extends the shift filter form + template to support “Hide public shifts” and excluding public organizations.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/shiftings/shifts/utils/filter_mixin.py |
Persist/load public shift filter state via CalendarFilter; apply new public-shift Q filters. |
src/shiftings/shifts/forms/filters.py |
Adds hide_public_shifts + exclude_public_orgs_field; computes list of public orgs to present. |
src/shiftings/shifts/templates/shifts/template/shift_url_filter_form.html |
Renders new public-shift filter controls (hide + exclude-by-org accordion). |
src/shiftings/cal/models/filter.py |
New CalendarFilter model to store preferences. |
src/shiftings/cal/models/__init__.py |
Exports CalendarFilter. |
src/shiftings/cal/migrations/0001_initial.py |
Creates CalendarFilter tables/relations. |
src/shiftings/shifts/migrations/0007_alter_recurringshift_color_alter_shifttype_color.py |
Alters shift color defaults/samples (appears unrelated to stated PR goal). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| cal_filter.hide_public_shifts = cleaned_data.get('hide_public_shifts', False) | ||
| cal_filter.save() | ||
| cal_filter.hidden_public_organizations.set( | ||
| cleaned_data.get('exclude_public_orgs_field') or [] |
Collaborator
There was a problem hiding this comment.
This seems like an optional change, but would be better. When you implement or fix other features, please include this and squash it into the commit this belongs to.
src/shiftings/shifts/migrations/0007_alter_recurringshift_color_alter_shifttype_color.py
Show resolved
Hide resolved
Contributor
Author
|
2 things todo:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.