Repository navigation
Needs Attention overview, header pill and alert silencing; remove manual alerts - #206
Merged
Merged
Conversation
…idebar section Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ual alerts Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
#205 was squash-merged, so keep this branch's versions of the files it changes on top of it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Stacked on #205 (base is that PR's branch). When #205 is squash-merged and its branch is deleted, GitHub should retarget this to
main. Because #205 is squash-merged, this branch will then needmainmerged into it once (as happened with #203); I will do that.What it does
reports/attention.py, works out what needs attention. The header pill, the overview page and the Reports page all read from it, so they agree. Each item has a stable key (low_stock:consumable:12). Adding a source means writing a function and registering it; the README explains how. This is also what a future email job should use, with the keys and levels to avoid sending the same alert twice./reports/alerts/, rewritten). Grouped by source, with a link to each item and why it is flagged. Managers and admins get a Silence button (with the confirm dialog). Silenced items stay listed under Silenced (N) with Turn back on.Consumable.alerts_silenced(migrationconsumables/0002, default off). A silenced consumable also leaves the Low Stock and Expiring Soon tiles, their filtered lists, and the reorder list, so every count agrees. The overview shows silenced items; the pill does not count them.Alertmodel and its migrations are kept; the table had 0 rows in the 8 November backup. The Reports page's Active Alerts card became a Needs Attention card and its recent-alerts list is gone./reports/dashboard/stats/still returns analertsnumber, now the attention count.Things to check
Not in this PR
The low-count source and per-sample silence (#196), email notifications (Django email is not configured), and moving Start Audit out of Quick Actions.
Verification
reports/test_attention.py(31 tests: both sources, levels, keys, the 30-day window, silenced consumables leaving the tile, filter and reorder list, the overview page and roles, the silence endpoint including refusals and bad input, the Reports page card, removal of the old URLs) and the dashboard pill tests. Existing tests that patched theAlertmodel now patch the attention summary. Full suite: 688 tests, OK.makemigrations --checkis clean.python manage.py migratelocally for the new column.🤖 Generated with Claude Code