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
59 changes: 56 additions & 3 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,9 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/AnnouncementInput'
multipart/form-data:
schema:
$ref: '#/components/schemas/AnnouncementInput'
examples:
makerble:
summary: One of Makerble's own (System Access users)
Expand Down Expand Up @@ -980,6 +983,18 @@ paths:
starts_on: "2026-12-01"
ends_on: "2026-12-08"
status: scheduled
image:
summary: With an image, sent as base64
value:
title: Surveys now have a Duplicate button
body: Copy a Survey, with its questions, in one click.
visual_type: image
image:
filename: duplicate-survey.png
data: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==
image_alt: The Duplicate button at the top of a Survey
learn_more_url: https://makerble.atlassian.net/wiki/spaces/MCPD/pages/123/Surveys
status: draft
responses:
"201":
description: The created Announcement
Expand Down Expand Up @@ -1068,6 +1083,9 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/AnnouncementInput'
multipart/form-data:
schema:
$ref: '#/components/schemas/AnnouncementInput'
example:
ends_on: "2026-12-15"
responses:
Expand Down Expand Up @@ -18078,6 +18096,17 @@ components:
type: string
maxLength: 40
example: Workspaces
AnnouncementImageUpload:
type: object
required: [filename, data]
properties:
filename:
type: string
example: workspaces.png
data:
type: string
format: byte
description: The file's contents in base64.
AnnouncementInput:
type: object
properties:
Expand Down Expand Up @@ -18113,8 +18142,10 @@ components:
description: The message. Required.
visual_type:
type: string
enum: [name_change, vimeo, none]
description: The name-change animation (Makerble's own only), a Vimeo video, or nothing.
enum: [name_change, vimeo, image, 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.
name_changes:
type: array
minItems: 1
Expand All @@ -18125,6 +18156,20 @@ components:
vimeo_url:
type: string
description: For `vimeo`, https://vimeo.com/<id>, https://vimeo.com/<id>/<hash> or https://player.vimeo.com/video/<id>?h=<hash>. Ignored for the other visuals.
image:
description: |
For `image`: a screenshot or illustration shown whole (never cropped) in the popup. A PNG, JPG, GIF or
WebP file of up to 5 MB; the type is read from the file itself. Send it as a file in a
`multipart/form-data` request, or in JSON as `{ "filename": "workspaces.png", "data": "<base64>" }`.
Required when creating an `image` announcement; leave it out on update to keep the saved image.
oneOf:
- type: string
format: binary
- $ref: '#/components/schemas/AnnouncementImageUpload'
image_alt:
type: string
maxLength: 250
description: For `image`, required. What the image shows, read out by screen readers.
learn_more_url:
type: string
nullable: true
Expand Down Expand Up @@ -18279,7 +18324,7 @@ components:
type: string
visual_type:
type: string
enum: [name_change, vimeo, none]
enum: [name_change, vimeo, image, none]
name_changes:
type: array
items:
Expand Down Expand Up @@ -18309,6 +18354,14 @@ components:
items:
type: string
description: The guidance panel keys of the pages it shows on; empty for any page. See Create an Announcement.
image_url:
type: string
nullable: true
description: For the `image` visual, a link to the uploaded image; null otherwise.
image_alt:
type: string
nullable: true
description: For the `image` visual, the image's alt text; null otherwise.
starts_on:
type: string
format: date
Expand Down
8 changes: 4 additions & 4 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>) 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>) 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>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,16 +4542,16 @@ 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, 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>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, 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>.")}
${endpointCard("PATCH", "/announcements/{id}", "Update an Announcement", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "Announcement ID" }
], [
{ code: "200", cls: "response-2xx", desc: "Announcement updated" },
{ code: "403", cls: "response-4xx", desc: "Not one the user may change" },
{ code: "404", cls: "response-4xx", desc: "Not found" },
{ code: "422", cls: "response-4xx", desc: "Validation failed, e.g. 4 name changes" }
], "Same body as create; only the fields sent change. Without <code>status</code>, a draft stays a draft and a scheduled announcement stays scheduled. Editing a live announcement doesn't show it again to people who have already seen it. An announcement never moves to another place, so <code>scope_type</code> and <code>scope_id</code> are ignored. For one of Makerble's own, send <code>schedule_on_next_free_days: true</code> to schedule it from the first day, from today, on which no other Makerble announcement starts, keeping its own length (14 days if it has no dates yet); any <code>status</code>, <code>starts_on</code> and <code>ends_on</code> sent are replaced. People see at most one Makerble announcement a day, so overlapping ones take turns. For a place's announcement this returns <code>422</code>.")}
], "Same body as create; only the fields sent change. Leave <code>image</code> out to keep the saved image; changing <code>visual_type</code> away from <code>image</code> removes it and its alt text. Without <code>status</code>, a draft stays a draft and a scheduled announcement stays scheduled. Editing a live announcement doesn't show it again to people who have already seen it. An announcement never moves to another place, so <code>scope_type</code> and <code>scope_id</code> are ignored. For one of Makerble's own, send <code>schedule_on_next_free_days: true</code> to schedule it from the first day, from today, on which no other Makerble announcement starts, keeping its own length (14 days if it has no dates yet); any <code>status</code>, <code>starts_on</code> and <code>ends_on</code> sent are replaced. People see at most one Makerble announcement a day, so overlapping ones take turns. For a place's announcement this returns <code>422</code>.")}
</div>
</section>

Expand Down
Loading