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
94 changes: 91 additions & 3 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14842,7 +14842,11 @@ paths:
page in the Makerble User Guide (`https://makerble.atlassian.net/wiki/spaces/MCPD/...`); and a
`vimeo_url` that is empty or one of `https://vimeo.com/<id>`, `https://vimeo.com/<id>/<hash>`
(unlisted videos) or `https://player.vimeo.com/video/<id>?h=<hash>`. An empty `vimeo_url` puts the
page back to its fallback visual. A broken rule answers `422` with every message in `errors`.
page back to its fallback visual.

`storyboard` is the Intro's animation, drawn from Makerble building blocks when there is no Vimeo
link (see `GuidancePanelStoryboard` for its rules). Send it as an object, or `null` to remove it.
A broken rule answers `422` with every message in `errors`.
operationId: updateGuidancePanel
security: [{tokenAuth: []}]
requestBody:
Expand Down Expand Up @@ -23951,6 +23955,86 @@ components:
name:
type: string

GuidancePanelStoryboardStep:
type: object
description: |
One step of an Intro animation. Steps play in order, evenly spread across the loop.

- `appear` puts a building block on the stage: `block` (required), and optionally an `id` that later
steps target, a `text` label and, for a `chart_bar` only, a `value` from 0 to 100 (required for it).
- `move_cursor`, `click`, `highlight` and `check` act on the block whose `id` is `target`.
- `type` types `text` into the `field` whose `id` is `target`.
- `swap` replaces the label of the block whose `id` is `target` with `text`.
- `cut` clears the stage and starts a new scene; blocks from before it can't be targeted after it.
required: [type]
additionalProperties: false
properties:
type:
type: string
enum: [appear, move_cursor, click, type, highlight, check, swap, cut]
block:
type: string
enum: [top_bar, sidebar_item, table_row, card, button, field, chip, avatar, chart_bar]
id:
type: string
pattern: '^[a-z][a-z0-9_]{0,29}$'
target:
type: string
description: The `id` of a block that has appeared since the last `cut`
text:
type: string
maxLength: 40
value:
type: integer
minimum: 0
maximum: 100


GuidancePanelStoryboard:
type: object
nullable: true
description: |
An Intro's animation: a short loop of Makerble building blocks drawn in the panel's module colour,
shown when there is no Vimeo link. Up to 8,000 characters of JSON.
required: [archetype, loop_seconds, alt, steps]
additionalProperties: false
properties:
archetype:
type: string
enum: [assemble, flow, concept]
description: >-
`assemble`: the parts of a page of the feature come together. `flow`: a short walkthrough of using
the feature. `concept`: an animated metaphor for the idea behind it.
loop_seconds:
type: integer
minimum: 4
maximum: 20
alt:
type: string
minLength: 10
maxLength: 250
description: What the animation shows, read out by screen readers
steps:
type: array
minItems: 1
maxItems: 24
items:
$ref: '#/components/schemas/GuidancePanelStoryboardStep'
example:
archetype: flow
loop_seconds: 12
alt: "A coworker clicks Create a contact, types the contact's name, clicks Save and the contact appears in the list."
steps:
- { type: appear, block: button, id: create, text: "Create a contact" }
- { type: click, target: create }
- { type: cut }
- { type: appear, block: field, id: name, text: "Name" }
- { type: type, target: name, text: "Amira Patel" }
- { type: cut }
- { type: appear, block: table_row, id: amira, text: "Amira Patel" }
- { type: check, target: amira }


GuidancePanel:
type: object
description: |
Expand Down Expand Up @@ -23990,14 +24074,16 @@ components:
vimeo_url:
type: string
nullable: true
storyboard:
$ref: '#/components/schemas/GuidancePanelStoryboard'
fallback_visual:
type: string
nullable: true
description: The CSS animation, or the page's current image, shown when there is no Vimeo link
visual:
type: string
enum: [vimeo, animation, image, none]
description: What the panel shows beside its text now
enum: [vimeo, storyboard, animation, image, none]
description: What the panel shows beside its text now. A Vimeo link wins over a storyboard, and a storyboard over the fallback visual
updated_at:
type: string
format: date-time
Expand Down Expand Up @@ -24063,6 +24149,8 @@ components:
type: string
vimeo_url:
type: string
storyboard:
$ref: '#/components/schemas/GuidancePanelStoryboard'

PaginatedGuidancePanels:
allOf:
Expand Down
6 changes: 4 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3878,6 +3878,7 @@ function buildDocsPage() {
<p>A Guidance Panel is the Show/Hide Guidance introduction at the top of a Manage page, such as Manage Events or Manage Contact Groups: an eyebrow, a one-line headline, 2 to 5 points that each start with a short bold lead, the sentence shown to people who can't use the page's main button, a <strong>Learn more</strong> link to the page's article in the Makerble User Guide, and an optional Vimeo video. Panels are the same for every Organisation.</p>
<p><strong>Who can use these endpoints:</strong> only Makerble staff with System Access, with their own <code>X-User-Email</code> and <code>X-User-Token</code>. Anyone else, an API key and a connected app all get <code>403</code>. The same changes can be made in Site Overview › Guidance Panels, and every change, wherever it is made, is kept as a version that can be seen and restored.</p>
<p><strong>Rules:</strong> a headline of at most 80 characters; 2 to 5 points, each with a <code>lead</code> (up to 40 characters) and <code>text</code> (up to 200); a <code>user_guide_url</code> in the Makerble User Guide (<code>https://makerble.atlassian.net/wiki/spaces/MCPD/…</code>); and a <code>vimeo_url</code> that is empty or one of <code>https://vimeo.com/&lt;id&gt;</code>, <code>https://vimeo.com/&lt;id&gt;/&lt;hash&gt;</code> (unlisted) or <code>https://player.vimeo.com/video/&lt;id&gt;?h=&lt;hash&gt;</code>.</p>
<p><strong>Animation storyboard:</strong> when there is no Vimeo link, a panel can show a looping animation of Makerble building blocks, drawn in the page's module colour from its <code>storyboard</code>. A storyboard has an <code>archetype</code> (<code>assemble</code>, <code>flow</code> or <code>concept</code>), <code>loop_seconds</code> (4 to 20), <code>alt</code> (10 to 250 characters describing the animation for screen readers) and 1 to 24 <code>steps</code>. An <code>appear</code> step puts a <code>block</code> on the stage (<code>top_bar</code>, <code>sidebar_item</code>, <code>table_row</code>, <code>card</code>, <code>button</code>, <code>field</code>, <code>chip</code>, <code>avatar</code> or <code>chart_bar</code>, which needs a <code>value</code> from 0 to 100), with an optional <code>id</code> and <code>text</code> (up to 40 characters). <code>move_cursor</code>, <code>click</code>, <code>highlight</code>, <code>check</code>, <code>type</code> (into a <code>field</code>) and <code>swap</code> (new <code>text</code>) act on the block whose <code>id</code> is their <code>target</code>; <code>cut</code> clears the stage for the next scene. People who turn off motion see the last frame. The response's <code>visual</code> is <code>storyboard</code> while one is showing.</p>
</div>
<div class="endpoint-list">
${endpointCard("GET", "/guidance_panels", "List the Guidance Panels", true, [
Expand All @@ -3895,14 +3896,15 @@ function buildDocsPage() {
{ code: "403", cls: "response-4xx", desc: "No System Access" },
{ code: "404", cls: "response-4xx", desc: "No panel with that key" }
])}
${endpointCard("PATCH", "/guidance_panels/{key}", "Change a Guidance Panel's wording or video", true, [
${endpointCard("PATCH", "/guidance_panels/{key}", "Change a Guidance Panel's wording, video or animation", true, [
{ name: "key", in: "path", type: "string", required: true, desc: "The panel's key, e.g. <code>events</code>" },
{ name: "guidance_panel[eyebrow]", in: "body", type: "string", required: false, desc: "e.g. Makerble® Events" },
{ name: "guidance_panel[headline]", in: "body", type: "string", required: false, desc: "One line, at most 80 characters" },
{ name: "guidance_panel[points]", in: "body", type: "array", required: false, desc: "2 to 5 <code>{lead, text}</code>, in order; replaces the whole list" },
{ name: "guidance_panel[staff_text]", in: "body", type: "string", required: false, desc: "Shown instead of the main action to people who can't use it" },
{ name: "guidance_panel[user_guide_url]", in: "body", type: "string", required: false, desc: "A page in the Makerble User Guide" },
{ name: "guidance_panel[vimeo_url]", in: "body", type: "string", required: false, desc: "A Vimeo link, or empty to show the page's own image or animation" }
{ name: "guidance_panel[vimeo_url]", in: "body", type: "string", required: false, desc: "A Vimeo link, or empty to show the page's own image or animation" },
{ name: "guidance_panel[storyboard]", in: "body", type: "object", required: false, desc: "The animation shown when there is no Vimeo link (see above), or <code>null</code> to remove it" }
], [
{ code: "200", cls: "response-2xx", desc: "The changed panel and its last 10 versions; the page shows the change from its next load" },
{ code: "403", cls: "response-4xx", desc: "No System Access" },
Expand Down
Loading