Skip to content

Data Model: Timeline Content

Joseph (Joey) Atwell edited this page Dec 17, 2018 · 7 revisions

The data model for the timeline content is formatted into an object with the first properties being about the timeline and the last property being an array.

The properties pertaining to the timeline are:

  • lastModified (date)
  • content [{json array}] - actual timeline info
  • id (optional) - is the same value as appUserId
  • appUserId (optional) - is saved with appUserId

For the array:

The main title (IParent) of the sections for the timeline content have the following properties:

  • title (string)
  • checkmark (boolean)
  • itemExpand (boolean)
  • dot (boolean)
  • topLevel (boolean) - to isolate styling
  • areAllStepsCompleted (boolean) - conditional property assigned during trackProgress function (see component wiki) for visual user feedback upon completion of category
  • children (array)

The children (IChild) of each section determines the content for that section. The children have the following properties:

  • title (string)
  • checkmark (boolean) - always false at this step
  • children (array) - this is where the to-do items live

For the main section titles, the itemExpand boolean is so that the user can expand that section. The dot is for the blue dot on the left of each title. The checkmark boolean is always false for the title.

For the children of children (IGrandChild), the very last children of the content (meaning that that item has an empty array for the children property) is the to do items for the timeline. The checkmark boolean is always true for the last children.

Example:

timeline = 
{
    "lastModified": date,
    "content": array =
    [
        {
            "title": 'Getting Out',
            "itemExpand": "false",
            "dot": "true",
            "topLevel": "true",
            "areAllStepsCompleted": "false",
            "children": [
                {
                    "title": 'Understanding the process of separating',
                    "checkmark": "false",
                    "children": [
                        {
                            "title": 'Find out your separation date',
                            "checkmark": "true",
                            "completed": "false",
                            "children": []
                        }
                    ]
                }
            ]
        }
    ]
    "id": "<equal to appUserId>",
    "appUserId": "<appUserId>"
}