Skip to content

[Rails] Don't pass orphaned Stories (e.g. no Places or Speakers) to React #956

@rudokemper

Description

@rudokemper

Currently, it's not possible to create a Story without selecting at least one Place and at least one Speaker.

However, it is possible to delete Places and Speakers, which if done can leave a Story "orphaned" (e.g. it exists but has no Places, or Speakers, or both).

It's fine to keep it this way on the Rails side for now -- we need to think about our data structures more -- but we should handle this on the React side.

What is happening now is that the stories will still show up in StoryList. Only, if there are no Speakers, nothing will show at the top, and (worse) if there are no Places, clicking on the card does nothing.

Let's filter out any stories that have 0 Places or 0 Speakers on the React front end. This also means we should filter out any markers on the map that ONLY have stories that have been filtered out.

Acceptance criteria:

  • If I create a Story, a Place, and a Speaker, and then I delete the Place OR the Speaker (or both), the Story should continue to exist in Rails but it should not be passed to React (e.g. it doesn't show up in StoryList component).
  • If I create a Story, a Place, and a Speaker, and I delete the Speaker, the Story should not be passed to React, and the Place should also not be passed to React (IF is the only Story associated with it; it should continue to appear on the map if it has other Stories with the minimum validation of >1 Place and >1 Speaker).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions