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
31 changes: 28 additions & 3 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18142,10 +18142,12 @@ components:
description: The message. Required.
visual_type:
type: string
enum: [name_change, vimeo, image, none]
enum: [name_change, vimeo, image, intro_animation, storyboard, none]
description: >-
The name-change animation (Makerble's own only), a Vimeo video, an uploaded image (with `image` and
`image_alt`), or nothing. Changing it from `image` removes the image and its alt text.
`image_alt`), a feature's Intro animation (`intro_animation`, with `intro_key`; Makerble's own only), an
animation of its own (`storyboard`; Makerble's own only), or nothing. Changing it from `image` removes the
image and its alt text.
name_changes:
type: array
minItems: 1
Expand All @@ -18170,6 +18172,20 @@ components:
type: string
maxLength: 250
description: For `image`, required. What the image shows, read out by screen readers.
intro_key:
type: string
description: |
For `intro_animation`: the key of the Intro (guidance panel) whose animation the popup plays, such as
`checklists`. It must have a storyboard. The popup plays the Intro's storyboard as it is when shown, so a
later change to the Intro's animation changes the announcement's too; if the Intro loses its animation, the
popup shows no visual. The usual choice for a feature's announcement.
storyboard:
type: object
additionalProperties: true
description: |
For `storyboard`: an animation of the announcement's own, for when the Intro's doesn't fit (for example when
only one part of a feature is new). The same format and rules as an Intro's storyboard (`archetype`,
`loop_seconds`, `alt`, `steps`); one that breaks them is refused with 422, naming the problem.
learn_more_url:
type: string
nullable: true
Expand Down Expand Up @@ -18324,7 +18340,7 @@ components:
type: string
visual_type:
type: string
enum: [name_change, vimeo, image, none]
enum: [name_change, vimeo, image, intro_animation, storyboard, none]
name_changes:
type: array
items:
Expand Down Expand Up @@ -18362,6 +18378,15 @@ components:
type: string
nullable: true
description: For the `image` visual, the image's alt text; null otherwise.
intro_key:
type: string
nullable: true
description: For `intro_animation`, the key of the Intro whose animation it plays; null otherwise.
storyboard:
type: object
nullable: true
additionalProperties: true
description: For `storyboard`, the announcement's own animation storyboard; null otherwise.
starts_on:
type: string
format: date
Expand Down
6 changes: 3 additions & 3 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4507,7 +4507,7 @@ function buildDocsPage() {
<div class="section-desc">
<p>An Announcement is a popup that each signed-in user in its audience sees once, between its start and end dates. There are two kinds. Makerble's own "What's new in Makerble" popups, for example "Projects are now Workspaces", are written by Makerble staff in Site Overview › Announcements; their <code>scope_type</code> is <code>null</code>. An Organisation's, Workspace's or Team's announcements are written by the people who look after it, for the colleagues there: <code>scope_type</code> is <code>Charity</code>, <code>Project</code> or <code>Team</code>, with <code>scope_id</code>.</p>
<p>System Access users can see and change every announcement. Anyone else can see and change only those for places where they hold the role now: an Organisation Admin, for their Organisation and its Workspaces and Teams; a Workspace editor (Project Editor), for that Workspace; a Team leader, for that Team. Someone who can make announcements nowhere gets <code>403</code>.</p>
<p><code>visual_type</code> is <code>name_change</code> (an animation of 1 to 3 <code>name_changes</code>, old name → new name), <code>vimeo</code> (a Vimeo video at <code>vimeo_url</code>), <code>image</code> (an uploaded picture, such as a screenshot, shown whole with its <code>image_alt</code> for screen readers; returned as <code>image_url</code>) or <code>none</code>. <code>audience</code> is <code>everyone</code>, <code>colleagues</code> (everyone except Contacts with a login) or <code>administrators</code> (Organisation Admins); a place's announcement is always for its colleagues (an Organisation's colleagues, a Workspace's editors, reporters and observers, or a Team's members and leaders), can't use <code>name_change</code>, and its <code>learn_more_url</code> can be any https page. <code>status</code> stores <code>draft</code> or <code>scheduled</code>; <code>current_status</code> also says whether a scheduled one is <code>live</code> or has <code>ended</code>.</p>
<p><code>visual_type</code> is <code>name_change</code> (an animation of 1 to 3 <code>name_changes</code>, old name → new name), <code>vimeo</code> (a Vimeo video at <code>vimeo_url</code>), <code>image</code> (an uploaded picture, such as a screenshot, shown whole with its <code>image_alt</code> for screen readers; returned as <code>image_url</code>), <code>intro_animation</code> (the animation of a feature's Intro, by its <code>intro_key</code>; the popup plays the Intro's storyboard as it is when shown, and nothing if the Intro loses it), <code>storyboard</code> (an animation of its own, with the same rules as an Intro's <code>storyboard</code>, for when the Intro's doesn't fit) or <code>none</code>. The two animations are for Makerble's own only. <code>audience</code> is <code>everyone</code>, <code>colleagues</code> (everyone except Contacts with a login) or <code>administrators</code> (Organisation Admins); a place's announcement is always for its colleagues (an Organisation's colleagues, a Workspace's editors, reporters and observers, or a Team's members and leaders), can't use <code>name_change</code>, and its <code>learn_more_url</code> can be any https page. <code>status</code> stores <code>draft</code> or <code>scheduled</code>; <code>current_status</code> also says whether a scheduled one is <code>live</code> or has <code>ended</code>.</p>
<p>Makerble's own can be narrowed further. <code>roles</code> shows it only to people holding at least one of the listed roles, in place of <code>audience</code>: <code>organisation_admin</code>, <code>editor</code> (Workspace editor), <code>reporter</code>, <code>observer</code>, <code>team_leader</code>, <code>active_participant</code> (Contact with a login) and <code>survey_portal_user</code>; Contacts with a login and Survey Portal users are left out unless their own role is listed. <code>audience_rules</code> targets people by behaviour, as JSON over named facts, for example <code>{"all": [{"fact": "distance_travelled_not_set_up"}]}</code> for people whose organisation hasn't set up Distance Travelled. Each rule is exactly one of <code>{fact, params}</code>, <code>{all: [rules]}</code>, <code>{any: [rules]}</code> or <code>{not: rule}</code>, at most 5 deep and 10 facts. List Announcement Facts gives the facts and their params; an unknown fact or param returns <code>422</code> naming the rule. Both are for System Access users only.</p>
<p>Makerble's own can also be limited to some pages with <code>page_keys</code>, so a feature is announced where it lives: <code>["contacts"]</code> shows it only when someone opens Manage Contacts, including when they move there from another page without reloading. A page key is the key of the page's Intro (its Show/Hide Guidance panel), such as <code>contacts</code>, <code>events</code>, <code>checklists</code>, <code>surveys</code> or <code>tasks</code>; pages without an Intro can't be chosen. An empty list (the default) means any page. An unknown key returns <code>422</code> listing the keys available. System Access users only.</p>
</div>
Expand Down Expand Up @@ -4542,8 +4542,8 @@ function buildDocsPage() {
{ code: "201", cls: "response-2xx", desc: "Announcement created (a draft unless <code>status</code> is <code>scheduled</code>)" },
{ code: "403", cls: "response-4xx", desc: "The user doesn't hold the role on that place, or (with no place) doesn't have System Access" },
{ code: "404", cls: "response-4xx", desc: "The Organisation, Workspace or Team doesn't exist" },
{ code: "422", cls: "response-4xx", desc: "Validation failed, e.g. no headline, a headline over 90 characters, a Vimeo visual with a YouTube link, an image without alt text, a file that isn't a PNG, JPG, GIF or WebP image or is over 5 MB, or the name change animation for a place" }
], "Body: <code>scope_type</code> and <code>scope_id</code> (whose announcement; leave out for one of Makerble's own), <code>title</code> (headline, up to 90), <code>body</code> (message, up to 280), <code>visual_type</code>, <code>name_changes: [{old_name, new_name}]</code> (1 to 3), <code>vimeo_url</code>, <code>image</code> and <code>image_alt</code> (for <code>image</code>: a PNG, JPG, GIF or WebP file of up to 5 MB, sent as a file in a <code>multipart/form-data</code> request or in JSON as <code>{filename, data}</code> with the data in base64, and its alt text, up to 250 characters, both required), <code>learn_more_url</code> (a Makerble User Guide page for Makerble's own; any https page for a place's), <code>training_material_id</code> (a place's announcement only: one of its Organisation's Training materials, linked for the colleagues it is shared with), <code>button_label</code> (default \"Got it\"), <code>feature_tour_id</code> (Makerble's own only: a feature tour; while it is live the button says \"Take the tour\" and starts it), <code>audience</code>, <code>roles</code>, <code>audience_rules</code> and <code>page_keys</code> (Makerble's own only; see above), <code>starts_on</code>, <code>ends_on</code>, <code>status</code>.")}
{ code: "422", cls: "response-4xx", desc: "Validation failed, e.g. no headline, a headline over 90 characters, a Vimeo visual with a YouTube link, an image without alt text, an <code>intro_key</code> whose Intro has no animation, a storyboard that breaks the rules, a file that isn't a PNG, JPG, GIF or WebP image or is over 5 MB, or the name change animation for a place" }
], "Body: <code>scope_type</code> and <code>scope_id</code> (whose announcement; leave out for one of Makerble's own), <code>title</code> (headline, up to 90), <code>body</code> (message, up to 280), <code>visual_type</code>, <code>name_changes: [{old_name, new_name}]</code> (1 to 3), <code>vimeo_url</code>, <code>image</code> and <code>image_alt</code> (for <code>image</code>: a PNG, JPG, GIF or WebP file of up to 5 MB, sent as a file in a <code>multipart/form-data</code> request or in JSON as <code>{filename, data}</code> with the data in base64, and its alt text, up to 250 characters, both required), <code>intro_key</code> (for <code>intro_animation</code>), <code>storyboard</code> (for <code>storyboard</code>), <code>learn_more_url</code> (a Makerble User Guide page for Makerble's own; any https page for a place's), <code>training_material_id</code> (a place's announcement only: one of its Organisation's Training materials, linked for the colleagues it is shared with), <code>button_label</code> (default \"Got it\"), <code>feature_tour_id</code> (Makerble's own only: a feature tour; while it is live the button says \"Take the tour\" and starts it), <code>audience</code>, <code>roles</code>, <code>audience_rules</code> and <code>page_keys</code> (Makerble's own only; see above), <code>starts_on</code>, <code>ends_on</code>, <code>status</code>.")}
${endpointCard("PATCH", "/announcements/{id}", "Update an Announcement", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "Announcement ID" }
], [
Expand Down
Loading