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
10 changes: 7 additions & 3 deletions docs/guide/batch-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ module.exports = {
icon: 'recycle-icon',
messages: {
progress: 'Resetting {{ type }}...',
completed: 'Reset {{ count }} {{ type }}.'
completed: 'Reset {{ count }} {{ type }}.',
completedWithFailures: 'Reset {{ count }} {{ type }} ({{ bad }} of {{ total }} failed).',
failed: 'Resetting {{ type }} failed.',
},
if: {
archived: false
Expand Down Expand Up @@ -65,11 +67,13 @@ The `icon` setting is the primary visible interface when the operation is not in
```javascript
messages: {
progress: 'Resetting {{ type }}...',
completed: 'Reset {{ count }} {{ type }}.'
completed: 'Reset {{ count }} {{ type }}.',
completedWithFailures: 'Reset {{ count }} {{ type }} ({{ bad }} of {{ total }} failed).',
failed: 'Resetting {{ type }} failed.',
},
```

The `messages` object properties are used in notifications that appear to tell the editor what is happening behind the scenes. The `progress` message appears when the operation begins and the `completed` messages appears when it is done.
The `messages` object properties are used in notifications that appear to tell the editor what is happening behind the scenes. The `progress` message appears when the operation begins and the `completed` messages appears when it is done. The `completedWithFailures` and `failed` messages are optional. The `completedWithFailures` message appears when it is done, but it contains some failures. The `failed` message appears when it is done and it has failed entirely.

They both can use the `type` interpolation key, which Apostrophe replaces with the piece type label. The `completed` message can also include a `count` interpolation key, which is replaced by the number of pieces that were updated.

Expand Down
4 changes: 3 additions & 1 deletion docs/reference/module-api/module-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,9 @@ module.exports = {
label: 'Reset',
messages: {
progress: 'Resetting {{ type }}...',
completed: 'Reset {{ count }} {{ type }}.'
completed: 'Reset {{ count }} {{ type }}.',
completedWithFailures: 'Reset {{ count }} {{ type }} ({{ bad }} of {{ total }} failed).',
failed: 'Resetting {{ type }} failed.'
},
// This assumes that the module added this in the `icons` configuration.
icon: 'recycle-icon',
Expand Down