Chore subtasks

Changed

Context

While cleaning the shower, I noticed there are several indications of it's state of cleanliness.

  1. Are the glass windows clean?
  2. Is there grime on the walls?
  3. Is there soap scum in the shelves?
  4. Is the floor clean?

Cleaning the shower is a subtask of cleaning the bathroom.

A scoring of the shower's state could be derived from these sub parts.

Questions

How can I create a checklist interface with subtasks?
Could use reference widget and customize items available. But I want it on the front end.

Ideas

May need to build an HTMX component.

Done

Added as a bulleted list for now: https://inventory.mantra.network/chores/clean-shower

I used the Entity Reference HierarchyView Entity Reference Hierarchy on Drupal.org module, adding a Parent chore reference field on the Chore storage type.

Then created an entity reference view display, using the "chore" url query parameter as the contextual filter for parent chore. That query parameter was added to the Views Add ButtonView Views Add Button on Drupal.org for Entity PrepopopulateView Entity Prepopopulate on Drupal.org to fill in the Chore reference field.

Sub chores entity reference view.

Here's the end result:

Add chore log with filtered sub chores

Great! The two chores with Vacuum floor set as the parent appear here.

Display of chore w/ sub chores:

Inventory sub chore display