Skip to content

Stream

Stream displays a series of dispatches based on a query. The query can be either stream or interval but a stream query - present to past descending - is more natural for the view.

Options object

Provide either a query or a list of queries using smart-switcher

  • options
    • query - dispatch query for a simple stream
    • smart-switcher - an array of switcher configurations
    • default - default choice when smart switcher is used
    • spacer - start the stream with a gap using standard measure property, e.g. "200px", "10vh"
    • component - angenda | simple | user | info | full

Smart switcher

The smart switcher array can be a series of configurations that each can be a single entry or can be an expansion.

  • Object
    • name - display name shown in the dropdown
    • condition - rule for displaying the entry
    • query - dispatch query
    • users - optional user query; will show the users at the top of teh stream
    • id - unique identifier so the setting can be saved
    • kind - simple | program | query-program

Version 4 Actions

  • filter
  • actions: Array
    • icon
    • label
    • query
{
  "filter": {
    "actions": [
      {
        "icon": "user",
        "label": "Your posts",
        "query": "current user, no swimlanes"
      },
      {
        "icon": "users",
        "label": "All users",
        "query": "all users, no swimlanes"
      },
      {
        "icon": "star",
        "label": "Swimlanes",
        "query": "all swimlanes"
      }
    ]
  }
}

Simple

Simple list will show the specific queries and users

Program

Expansion kind that will show an entry for each program that a user is in, managed by the require list, sorted descending by start date. Limit can be used to restrict the count.

  • Object
    • require - string array; used by program kinds and excludes any program entry missing the attribute such as cohortId
    • limit - maximum count to show for expansion kinds
    • query - dispatch query for each program entry; $cohort and $program will be replaced by the appropriate ids
    • users - optional user query; will show the users at the top of teh stream
    • .. other options from above

Query-program

Expansion kind that will use the program query to generate a list of programs.

  • Object
    • list - program query
    • query - dispatch query for each program entry; $cohort and $program will be replaced by the appropriate ids
    • users - optional user query; will show the users at the top of teh stream
    • .. other options from above

Examples

{
  "default": "community",
  "smart-switcher": [
    {
      "condition": "user is admin",
      "list": "current user ^ program ending from -1 to +26 weeks with [active] participant=trainer",
      "query": "given cohort [$cohort], given trackers [graduation, reflection, journal, joined] on user",
      "id": "trainer",
      "name": "Training: {baseName} - {cohortName}",
      "users": "given cohort [$cohort] limit 500",
      "kind": "query-program"
    },
    {
      "query": "given cohort [$cohort], given trackers [reflection, graduation, journal, joined] on user",
      "users": "given cohort [$cohort] limit 500",
      "id": "clan",
      "limit": 3,
      "require": [
        "cohortId"
      ],
      "kind": "program"
    },
    {
      "query": "current user [program], given trackers[graduation, journal, reflection] on user",
      "users": "program as current limit 500",
      "name": "Current program",
      "id": "active"
    },
    {
      "query": "all users, given trackers[graduation, journal, journalPublic, reflection] on user, given swimlanes [kenzai,kenzai-update]",
      "name": "Community",
      "id": "community"
    }
  ]
}