Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8270,6 +8270,13 @@ paths:
("Warn and ask for a reason to skip") makes them give a reason, which is logged. On an update,
an action that doesn't mention it keeps its setting.

"Video (optional)": set `video_url` to a web link (`https://` or `http://`, up to 2048
characters) to a video about the step, for self-paced training. On the Checklist's page,
**Watch the journey** shows each step as a card with its video: a YouTube, Vimeo, Loom or
Google Drive link plays in the card, and any other link (SharePoint, Slack, an intranet)
opens in a new tab. Send an empty `video_url` to remove it; on an update, an action that
doesn't mention it keeps its video.

Participant Journey stages: send `stages`, in order, each with a `key` of your choosing, a
`name` and an `icon` (see `GET /checklists/stage_icons`; `clipboard` if left out), and give
each action the `stage_key` of its stage. The Journey view on the Checklist's profile page
Expand Down Expand Up @@ -8322,6 +8329,7 @@ paths:
owner_team_id: 18
allow_manual_completion: true
if_earlier_steps_not_done: "ask_reason"
video_url: "https://www.loom.com/share/22af2a7d40a54d0ba6d720140230b565"
responses:
"201":
description: The Checklist, with its actions, projects and contacts_count
Expand Down Expand Up @@ -8474,7 +8482,8 @@ paths:
Each action includes who is responsible for it: `owner_kind`, `owner_user_id`, `owner_team_id`,
`owner_relationship_side` and a readable `owner_description`, and its settings
`due_within_days`, `only_this_project`, `allow_manual_completion` and
`if_earlier_steps_not_done` (`remind` or `ask_reason`), and its `stage_id`. `stages` lists the
`if_earlier_steps_not_done` (`remind` or `ask_reason`), its `video_url` (null for none) and its
`stage_id`. `stages` lists the
Participant Journey stages in order, each with `id`, `name`, `icon`, `position` and `colour`.
An action whose type isn't chosen yet has a null `action_type` and `action_name` "Not set yet".
operationId: getChecklist
Expand Down
6 changes: 3 additions & 3 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2657,20 +2657,20 @@ function buildDocsPage() {
${endpointCard("GET", "/checklists/{id}", "Get a Checklist", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "Checklist ID" }
], [
{ code: "200", cls: "response-2xx", desc: "The Checklist with <code>stages</code> (<code>id, name, icon, position, colour</code>), <code>actions</code> (each with <code>stage_id</code>, <code>due_within_days</code>, its owner fields and <code>owner_description</code>; <code>action_name</code> is \"Not set yet\" while no type is chosen), <code>projects</code> and <code>contacts_count</code>" },
{ code: "200", cls: "response-2xx", desc: "The Checklist with <code>stages</code> (<code>id, name, icon, position, colour</code>), <code>actions</code> (each with <code>stage_id</code>, <code>due_within_days</code>, <code>video_url</code>, its owner fields and <code>owner_description</code>; <code>action_name</code> is \"Not set yet\" while no type is chosen), <code>projects</code> and <code>contacts_count</code>" },
{ code: "404", cls: "response-4xx", desc: "Not found, or another Organisation's" }
])}
${endpointCard("POST", "/checklists", "Create a Checklist", true, [], [
{ code: "201", cls: "response-2xx", desc: "The new Checklist" },
{ code: "403", cls: "response-4xx", desc: "Not an editor or reporter of the Organisation" },
{ code: "422", cls: "response-4xx", desc: "e.g. an action with every option unticked" }
], "Body: <code>charity_id</code>, <code>checklist: {name, description, stages: [{key, name, icon}], actions: [{action_type, title, description, stage_key, criteria, only_this_project, due_within_days, allow_manual_completion, if_earlier_steps_not_done, owner_kind, owner_user_id, owner_team_id, owner_relationship_side}]}</code>. <code>stages</code> are the optional Participant Journey stages, in order: each action joins one by naming its <code>key</code> in <code>stage_key</code>, and each stage's actions are kept together. <code>icon</code> is one of <code>GET /checklists/stage_icons</code> (<code>clipboard</code> by default). An action without an <code>action_type</code> is saved as \"Not set yet\" and can't be done until a type is chosen. <code>criteria</code> holds specific values under the type's <code>criteria_keys</code>, or <code>{any: true}</code> for any record of the kind; an action with neither is saved as \"Not set yet\" and can't be done until it is set. The owner fields are optional. <code>allow_manual_completion: true</code> (\"Allow colleagues to tick this off by hand with a note\") lets colleagues mark the action done by hand. <code>if_earlier_steps_not_done</code> (\"If earlier steps aren't done\") is <code>remind</code> (the default: a reminder colleagues can dismiss) or <code>ask_reason</code> (they must give a reason to skip the earlier steps). <code>only_this_project: true</code> (\"Only count records in this project\") counts only records made in the Project the Checklist was added to the Contact through. <code>due_within_days</code> (\"Due within N days of the checklist being added\", 0 to 3650) gives the action a deadline; leave it out for none.")}
], "Body: <code>charity_id</code>, <code>checklist: {name, description, stages: [{key, name, icon}], actions: [{action_type, title, description, video_url, stage_key, criteria, only_this_project, due_within_days, allow_manual_completion, if_earlier_steps_not_done, owner_kind, owner_user_id, owner_team_id, owner_relationship_side}]}</code>. <code>stages</code> are the optional Participant Journey stages, in order: each action joins one by naming its <code>key</code> in <code>stage_key</code>, and each stage's actions are kept together. <code>icon</code> is one of <code>GET /checklists/stage_icons</code> (<code>clipboard</code> by default). An action without an <code>action_type</code> is saved as \"Not set yet\" and can't be done until a type is chosen. <code>criteria</code> holds specific values under the type's <code>criteria_keys</code>, or <code>{any: true}</code> for any record of the kind; an action with neither is saved as \"Not set yet\" and can't be done until it is set. The owner fields are optional. <code>allow_manual_completion: true</code> (\"Allow colleagues to tick this off by hand with a note\") lets colleagues mark the action done by hand. <code>if_earlier_steps_not_done</code> (\"If earlier steps aren't done\") is <code>remind</code> (the default: a reminder colleagues can dismiss) or <code>ask_reason</code> (they must give a reason to skip the earlier steps). <code>only_this_project: true</code> (\"Only count records in this project\") counts only records made in the Project the Checklist was added to the Contact through. <code>due_within_days</code> (\"Due within N days of the checklist being added\", 0 to 3650) gives the action a deadline; leave it out for none. <code>video_url</code> (\"Video (optional)\") is a web link to a video about the step, shown in Watch the journey on the Checklist's page: YouTube, Vimeo, Loom and Google Drive videos play in place, other links open in a new tab.")}
${endpointCard("PATCH", "/checklists/{id}", "Update a Checklist", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "Checklist ID" }
], [
{ code: "200", cls: "response-2xx", desc: "The updated Checklist" },
{ code: "403", cls: "response-4xx", desc: "Not an editor or reporter of the Organisation" }
], "Actions with an <code>id</code> change; <code>{id, _destroy: true}</code> removes one; actions without an <code>id</code> are added. <code>due_within_days: null</code> removes an action's deadline. <code>stages</code> work the same way (<code>{id, name, icon, position}</code>, <code>{id, _destroy: true}</code>, or a new one with a <code>key</code>); an action's <code>stage_key</code> is a new stage's key or an existing stage's id, empty for no stage. A stage left without actions is removed.")}
], "Actions with an <code>id</code> change; <code>{id, _destroy: true}</code> removes one; actions without an <code>id</code> are added. <code>due_within_days: null</code> removes an action's deadline. An empty <code>video_url</code> removes an action's video. <code>stages</code> work the same way (<code>{id, name, icon, position}</code>, <code>{id, _destroy: true}</code>, or a new one with a <code>key</code>); an action's <code>stage_key</code> is a new stage's key or an existing stage's id, empty for no stage. A stage left without actions is removed.")}
${endpointCard("GET", "/checklists/stage_icons", "List the icons a Checklist stage can have", true, [], [
{ code: "200", cls: "response-2xx", desc: "<code>{data: [{icon, name}]}</code>: clipboard, calendar, people, chart, flag, message, home, heart, school, book" }
])}
Expand Down
Loading