diff --git a/openapi.yaml b/openapi.yaml index bbcdb02..d896776 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -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 @@ -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 diff --git a/server.js b/server.js index 5edd8b6..f8e7e4e 100644 --- a/server.js +++ b/server.js @@ -4270,6 +4270,7 @@ function buildDocsPage() {

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 403.

visual_type is name_change (an animation of 1 to 3 name_changes, old name → new name), vimeo (a Vimeo video at vimeo_url) or none. audience is everyone, colleagues (everyone except Contacts with a login) or administrators (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 name_change, and its learn_more_url can be any https page. status stores draft or scheduled; current_status also says whether a scheduled one is live or has ended.

Makerble's own can be narrowed further. roles shows it only to people holding at least one of the listed roles, in place of audience: organisation_admin, editor (Workspace editor), reporter, observer, team_leader, active_participant (Contact with a login) and survey_portal_user; Contacts with a login and Survey Portal users are left out unless their own role is listed. audience_rules targets people by behaviour, as JSON over named facts, for example {"all": [{"fact": "distance_travelled_not_set_up"}]} for people whose organisation hasn't set up Distance Travelled. Each rule is exactly one of {fact, params}, {all: [rules]}, {any: [rules]} or {not: rule}, at most 5 deep and 10 facts. List Announcement Facts gives the facts and their params; an unknown fact or param returns 422 naming the rule. Both are for System Access users only.

+

Makerble's own can also be limited to some pages with page_keys, so a feature is announced where it lives: ["contacts"] 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 contacts, events, checklists, surveys or tasks; pages without an Intro can't be chosen. An empty list (the default) means any page. An unknown key returns 422 listing the keys available. System Access users only.

✓ @@ -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: scope_type and scope_id (whose announcement; leave out for one of Makerble's own), title (headline, up to 90), body (message, up to 280), visual_type, name_changes: [{old_name, new_name}] (1 to 3), vimeo_url, learn_more_url (a Makerble User Guide page for Makerble's own; any https page for a place's), training_material_id (a place's announcement only: one of its Organisation's Training materials, linked for the colleagues it is shared with), button_label (default \"Got it\"), audience, roles and audience_rules (Makerble's own only; see above), starts_on, ends_on, status.")} + ], "Body: scope_type and scope_id (whose announcement; leave out for one of Makerble's own), title (headline, up to 90), body (message, up to 280), visual_type, name_changes: [{old_name, new_name}] (1 to 3), vimeo_url, learn_more_url (a Makerble User Guide page for Makerble's own; any https page for a place's), training_material_id (a place's announcement only: one of its Organisation's Training materials, linked for the colleagues it is shared with), button_label (default \"Got it\"), audience, roles, audience_rules and page_keys (Makerble's own only; see above), starts_on, ends_on, status.")} ${endpointCard("PATCH", "/announcements/{id}", "Update an Announcement", true, [ { name: "id", in: "path", type: "integer", required: true, desc: "Announcement ID" } ], [