Add independent incident scope for event types#355
Open
level09 wants to merge 2 commits into
Open
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
Event types now have an independent Incidents scope, separate from Bulletins. Previously the Incidents screen reused the
for_bulletinflag, so an event type assignable to Bulletins was automatically assignable to Incidents, with no way to scope a type to Incidents alone. This adds a third toggle alongside the existing Actors and Bulletins ones, mirroring the establishedfor_incidentpattern already used by Labels.How it works
Eventtype.for_incidentcolumn, serialized into_dict, accepted infrom_jsonand the validation model; the eventtypes API now acceptstyp=for_incident.for_bulletin: the event picker (incidents.html) and the search/filter sidebar (IncidentSearchBox.js), matching how the Actor and Bulletin search boxes use their own flags.enferno/data/eventtypes.csv): newfor_incidentcolumn, set equal tofor_bulletinper row so fresh installs match the migration backfill.Migration
c7d2e9f4a1b8adds the column and backfillsfor_incident = for_bulletinfor existing rows, so the Incidents event-type list is unchanged on day one. Admins can then curate it independently. No data is removed; existing incident events keep their types regardless of the flag.Tests
Eventtype CRUD test exercises the new field; factory and
create_eventtype_forhelper extended to support incident-scoped types. All eventtype lookup tests pass.