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
18 changes: 18 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16667,6 +16667,19 @@ components:
- fact: distance_travelled_not_set_up
params:
across: all_organisations
page_keys:
type: array
items:
type: string
description: |
Makerble's own only (System Access users). The pages it shows on, by the key of each page's
Show/Hide Guidance panel: for example `contacts` (Manage Contacts), `events`, `checklists` or
`surveys`. Someone sees it when they open one of those pages, including when they move between
pages without reloading. Pages without a guidance panel have no key and can't be chosen. An
empty list (the default) means any page. An unknown key is refused with 422, listing the keys
available. Sent, it replaces
the list.
example: [contacts]
starts_on:
type: string
format: date
Expand Down Expand Up @@ -16781,6 +16794,11 @@ components:
type: object
additionalProperties: true
description: Behaviour rules over named facts; `{}` for none. See Create an Announcement.
page_keys:
type: array
items:
type: string
description: The guidance panel keys of the pages it shows on; empty for any page. See Create an Announcement.
starts_on:
type: string
format: date
Expand Down
3 changes: 2 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4270,6 +4270,7 @@ function buildDocsPage() {
<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>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>
<div class="callout callout-tip">
<span class="callout-icon">✓</span>
Expand Down Expand Up @@ -4303,7 +4304,7 @@ function buildDocsPage() {
{ 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>audience</code>, <code>roles</code> and <code>audience_rules</code> (Makerble's own only; see above), <code>starts_on</code>, <code>ends_on</code>, <code>status</code>.")}
], "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>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