-
-
Notifications
You must be signed in to change notification settings - Fork 6
feat: Log campaign actions from gang/list screen #1272
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a "Log Action" link to the Actions widget on the gang/list detail screen, allowing users to quickly log campaign actions directly from a gang's page with the gang pre-selected. The changes improve navigation and user experience when managing campaign actions.
- Adds gang pre-population logic to the campaign action form view
- Refactors URL parameter handling to use the
querystringtemplate tag consistently - Moves campaign action tests to a dedicated test file for better organization
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| gyrinx/core/views/campaign.py | Adds gang parameter extraction and form initialization; updates documentation for return_url context variable |
| gyrinx/core/tests/test_campaign_actions.py | New dedicated test file for campaign action tests; includes new test for gang pre-population functionality |
| gyrinx/core/tests/test_campaign.py | Removes campaign action filtering test (moved to dedicated file) |
| gyrinx/core/templates/core/includes/list_campaign_actions.html | Adds "Log Action" link with gang and return_url parameters; updates "View all actions" link to use querystring tag |
| gyrinx/core/templates/core/includes/campaign_action_item.html | Updates "Add outcome" link to use querystring tag for consistent URL parameter handling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Remove extraneous whitespace Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for i in range(55): | ||
| CampaignAction.objects.create( | ||
| campaign=campaign, | ||
| user=user1, |
Copilot
AI
Jan 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CampaignAction objects created in this loop are missing the owner field that is consistently set in the previous action creations (lines 53, 65, 77). This inconsistency could cause issues if the owner field is required or expected in other parts of the code.
| user=user1, | |
| user=user1, | |
| owner=user1, |
Adds a "Log Action" link to the "Actions" widget on the gang/list screen. When clicked, navigates to the existing "Log action" form, with the "Related gang" field set. Ensures return URLs are set correctly.
Closes #994.