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
33 changes: 33 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9193,6 +9193,39 @@ paths:
"422":
$ref: '#/components/responses/UnprocessableEntity'

/impact_frameworks/{id}/copy:
post:
tags: [Library]
summary: Copy an Impact Framework
operationId: copyImpactFramework
description: |
Copies an Impact Framework (Template), as **Copy** on the Manage Impact Frameworks page does.
The copy is named `Copy of <name>` and keeps the original's stages, metrics (Activity and
Attendance trackers, Outcomes and the trackers placed on it), causes, description and colour,
but none of its projects: it is not added to any project. It is yours, private and unapproved,
in the original's organisation if you belong to it, otherwise among your own Impact Frameworks.

You may copy your own Impact Frameworks, any of an organisation you belong to, the Theory of
Change of a project you edit, and approved ImpactStore frameworks. Any other id answers `404`.
security: [{tokenAuth: []}]
parameters:
- name: id
in: path
required: true
description: The id of the Impact Framework (Template) to copy
schema:
type: integer
example: 7174
responses:
"201":
$ref: '#/components/responses/LibraryItemCreated'
"401":
$ref: '#/components/responses/Unauthorized'
"404":
$ref: '#/components/responses/NotFound'
"422":
$ref: '#/components/responses/UnprocessableEntity'

/referral_submissions:
post:
tags: [Signup Pages]
Expand Down
8 changes: 8 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2493,6 +2493,14 @@ function buildDocsPage() {
{ code: "409", cls: "response-4xx", desc: "Nothing created: <code>duplicates</code> lists items you can reuse instead of the new ones, each with its <code>entry</code>" },
{ code: "422", cls: "response-4xx", desc: "Invalid input (e.g. an Outcome in an Activity stage); nothing is created and the error names the entry" }
], "An Impact Framework (Template). Reuse trackers and Outcomes by id, and define only what's missing.")}
${endpointCard("POST", "/impact_frameworks/{id}/copy", "Copy an Impact Framework", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "The Impact Framework (Template) to copy: your own, one of an organisation you belong to, the Theory of Change of a project you edit, or an approved ImpactStore framework" }
], [
{ code: "201", cls: "response-2xx", desc: "Created: <code>data</code> is the copy, named <code>Copy of &lt;name&gt;</code>, as Get a library item shows it, plus <code>approved</code> (always <code>false</code>)" },
{ code: "401", cls: "response-4xx", desc: "Missing or invalid token" },
{ code: "404", cls: "response-4xx", desc: "No Impact Framework with that id that you may copy" },
{ code: "422", cls: "response-4xx", desc: "The copy could not be saved; the error says why. Nothing is created" }
], "The same as Copy on the Manage Impact Frameworks page: the stages and metrics are copied, the projects are not.")}
</div>
</section>

Expand Down
Loading