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
183 changes: 183 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1617,6 +1617,112 @@ paths:
$ref: '#/components/responses/ForbiddenError'
"422":
$ref: '#/components/responses/UnprocessableEntityList'
/tour_stops:
get:
tags: [Feature Tours]
summary: List the stops a tour can use
description: |
Lists every stop Makerble knows: the stops Welcome Tours and feature tours are built from. Each one focuses
on one part of one page, such as the Filters button on Contacts. Use a stop's `key` as the `stop_key` of a
feature tour's or a Welcome Tour's stop.

Stops come in registry order, grouped by feature (`group_name`, such as Contacts, Checklists, Registers or
Results Canvas; "Other" for a stop with no group). Each says which page it opens (`page`), whether it waits
for Next or for a click, Makerble's default wording, the wording it shows instead when the person has
nothing on that page yet (`empty`), and who it is shown to (`shown_to`). A stop the person can't use is
skipped when the tour runs.

Each stop also says how many feature tours and Welcome Tours use it. Send `group_name` to list one
feature's stops. Marketing and Admin users can change a stop's default title and text with
`PATCH /tour_stops/{key}`.

System Access users (Makerble staff) only. Anyone else gets 403.
operationId: listTourStops
security: [{tokenAuth: []}]
parameters:
- $ref: '#/components/parameters/Page'
- $ref: '#/components/parameters/PerPage'
- name: group_name
in: query
required: false
description: Only the stops in this feature group, e.g. `Registers`
schema:
type: string
example: Registers
responses:
"200":
description: Paginated stops
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedTourStopDefinitions'
example:
page: 1
page_size: 1
page_count: 36
total_count: 36
data:
- key: contacts_filters
label: 'Contacts: Filters'
group_name: Contacts
page: Contacts (contacts)
action: click
action_label: Waits for a click
default_title: Narrow the list down
default_body: Filters let you see just the people you need, such as one year group.
empty: null
shown_to: Skipped for someone who is not a member of the organisation
feature_tour_count: 1
welcome_tour_count: 0
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/ForbiddenError'
/tour_stops/{key}:
patch:
tags: [Feature Tours]
summary: Change a stop's default wording
description: |
Changes Makerble's default title and text for one stop, as Site Overview › Tour Stops does. Every
Welcome Tour and feature tour stop that has no wording of its own shows the new default straight away.

Only the fields sent change. A field sent empty, or the same as Makerble's original wording, goes back to
the original. Returns the stop as `GET /tour_stops` lists it.

Marketing and Admin users (Makerble staff) only. Support users and anyone else get 403.
operationId: updateTourStop
security: [{tokenAuth: []}]
parameters:
- name: key
in: path
required: true
description: The stop's key, from `GET /tour_stops`
schema:
type: string
example: contacts_table
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TourStopWordingInput'
example:
default_title: Your contacts
responses:
"200":
description: The stop with its new default wording
content:
application/json:
schema:
$ref: '#/components/schemas/TourStopDefinition'
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/ForbiddenError'
"404":
$ref: '#/components/responses/NotFound'
"422":
$ref: '#/components/responses/UnprocessableEntityList'
/feature_tours/{id}:
parameters:
- name: id
Expand Down Expand Up @@ -19342,6 +19448,10 @@ components:
type: string
nullable: true
description: Which part of which page the stop focuses on
group_name:
type: string
nullable: true
description: The feature the stop belongs to, such as Contacts or Registers; "Other" when it has none, null for a stop Makerble no longer knows
action:
type: string
enum: [next, click, ""]
Expand Down Expand Up @@ -19400,6 +19510,79 @@ components:
description: Up to 600 characters; empty means Makerble's default
_destroy:
type: boolean
TourStopDefinition:
type: object
description: One of the stops Makerble knows, for building a Welcome Tour or a feature tour
properties:
key:
type: string
description: The stop's key, sent as `stop_key` when adding it to a tour
label:
type: string
description: Which part of which page the stop focuses on
group_name:
type: string
description: The feature the stop belongs to, such as Contacts or Registers; "Other" when it has none
page:
type: string
description: The page the stop opens, as a page name and its key, a path, or in words when it is worked out for each person
action:
type: string
enum: [next, click]
description: Whether the stop waits for Next or asks the person to click something
action_label:
type: string
description: '`action` in words: "Next button" or "Waits for a click"'
default_title:
type: string
nullable: true
description: Makerble's title for the stop
default_body:
type: string
nullable: true
description: Makerble's wording for the stop
empty:
type: object
nullable: true
description: What the stop shows someone who can open its page but has nothing on it yet; null when it is skipped instead
properties:
title:
type: string
body:
type: string
page:
type: string
nullable: true
description: The page the empty variant opens, when it isn't the stop's own page
shown_to:
type: string
description: Who sees the stop, e.g. "Only for Organisation Editors" or "Skipped for someone without a Checklist"
feature_tour_count:
type: integer
description: How many feature tours use the stop
welcome_tour_count:
type: integer
description: How many Welcome Tours use the stop
TourStopWordingInput:
type: object
properties:
default_title:
type: string
maxLength: 120
description: Makerble's title for the stop; empty goes back to the original
default_body:
type: string
maxLength: 600
description: Makerble's text for the stop; empty goes back to the original
PaginatedTourStopDefinitions:
allOf:
- $ref: '#/components/schemas/PaginationEnvelope'
- type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/TourStopDefinition'
PaginatedFeatureTours:
allOf:
- $ref: '#/components/schemas/PaginationEnvelope'
Expand Down
18 changes: 17 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4784,7 +4784,7 @@ function buildDocsPage() {
<h2 class="section-title">Feature Tours</h2>
<div class="section-desc">
<p>A feature tour is a short guided tour that introduces one feature to people who already use Makerble. Unlike a Welcome Tour it belongs to no Organisation: Makerble staff write it once. A <code>live</code> tour with a <code>page_key</code> is offered by "Take the tour" on that page's Intro (the Show/Hide Guidance panel at the top of a Manage page, such as <code>contacts</code>); each Intro has at most one live tour. <code>auto_prompt</code> offers it once, the first time someone opens its page.</p>
<p>Each stop is one of the stops Welcome Tours use, named by <code>stop_key</code>, and shows Makerble's <code>default_title</code> and <code>default_body</code> unless it has its own <code>title</code> or <code>body</code>. System Access users (Makerble staff) only; anyone else gets <code>403</code>.</p>
<p>Each stop is one of the stops Welcome Tours use, named by <code>stop_key</code>, and shows Makerble's <code>default_title</code> and <code>default_body</code> unless it has its own <code>title</code> or <code>body</code>. <code>GET /tour_stops</code> lists every stop Makerble knows, grouped by feature, with the page each opens and its default wording. System Access users (Makerble staff) only; anyone else gets <code>403</code>.</p>
</div>
<div class="endpoint-list">
${endpointCard("GET", "/feature_tours", "List feature tours", true, [
Expand All @@ -4795,6 +4795,22 @@ function buildDocsPage() {
{ code: "200", cls: "response-2xx", desc: "Paginated feature tours, each with its stops in order" },
{ code: "403", cls: "response-4xx", desc: "The user doesn't have System Access" }
])}
${endpointCard("GET", "/tour_stops", "List the stops a tour can use", true, [
{ name: "group_name", type: "string", required: false, desc: "Only the stops in this feature group, e.g. <code>Registers</code>" },
{ name: "page", type: "integer", required: false, desc: "Page number" },
{ name: "per_page", type: "integer", required: false, desc: "Records per page (default 10, max 200)" }
], [
{ code: "200", cls: "response-2xx", desc: "Paginated stops in registry order, each with its <code>key</code> (a tour stop's <code>stop_key</code>), <code>label</code>, <code>group_name</code>, <code>page</code>, <code>action</code>, default wording, <code>empty</code> variant, <code>shown_to</code>, and how many feature tours and Welcome Tours use it" },
{ code: "403", cls: "response-4xx", desc: "The user doesn't have System Access" }
], "The stops Welcome Tours and feature tours are built from. The list is the same for everyone and changes only when Makerble releases new stops.")}
${endpointCard("PATCH", "/tour_stops/{key}", "Change a stop's default wording", true, [
{ name: "key", in: "path", type: "string", required: true, desc: "The stop's key, from <code>GET /tour_stops</code>" }
], [
{ code: "200", cls: "response-2xx", desc: "The stop with its new default wording" },
{ code: "403", cls: "response-4xx", desc: "The user isn't a Marketing or Admin user" },
{ code: "404", cls: "response-4xx", desc: "No stop has this key" },
{ code: "422", cls: "response-4xx", desc: "Validation failed, e.g. a title over 120 characters" }
], "Body: <code>default_title</code>, <code>default_body</code>. Only the fields sent change; an empty one goes back to Makerble's original. Every tour stop without its own wording shows the new default.")}
${endpointCard("GET", "/feature_tours/{id}", "Get a feature tour", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "Feature tour ID" }
], [
Expand Down
Loading