Skip to content

Add independent incident scope for event types#355

Open
level09 wants to merge 2 commits into
mainfrom
feat/eventtype-incident-flag
Open

Add independent incident scope for event types#355
level09 wants to merge 2 commits into
mainfrom
feat/eventtype-incident-flag

Conversation

@level09

@level09 level09 commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Event types now have an independent Incidents scope, separate from Bulletins. Previously the Incidents screen reused the for_bulletin flag, 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 established for_incident pattern already used by Labels.

How it works

  • Model/API/validation: new Eventtype.for_incident column, serialized in to_dict, accepted in from_json and the validation model; the eventtypes API now accepts typ=for_incident.
  • Admin editor: a "For Incidents" checkbox (three equal columns: Actors / Bulletins / Incidents) and a matching table column.
  • Incident consumers point at the new flag instead of 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.
  • Seed data (enferno/data/eventtypes.csv): new for_incident column, set equal to for_bulletin per row so fresh installs match the migration backfill.

Migration

c7d2e9f4a1b8 adds the column and backfills for_incident = for_bulletin for 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_for helper extended to support incident-scoped types. All eventtype lookup tests pass.

@level09 level09 requested a review from apodacaduron as a code owner June 27, 2026 18:49
@level09 level09 self-assigned this Jun 27, 2026
@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f0cda649-f82f-40b7-8278-36199abce25e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/eventtype-incident-flag

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant