CnMassCopyDialog
Two-phase mass copy dialog with naming pattern. Allows users to define a naming pattern for copied items.
Try it
Wraps: NcDialog, NcButton, NcTextField

Props
| Prop | Type | Default | Description |
|---|---|---|---|
items | Array | [] | Items to copy ([\{ id, name \}]) |
nameField | String | 'title' | Field to display as item name |
nameFormatter | Function | null | Optional function (item) => string to format item names. Overrides nameField when provided. |
include | Array | [] | Link kinds a copy may take along (relationRows, incoming, files), from the page's config.copy.include. Each is offered ticked; the dialog shows the kinds, not every row's links. Empty keeps the dialog as it was. |
register | String | '' | Register slug of the items, for checking the server can copy links. Empty: the first item's @self.register. |
schema | String | '' | Schema slug of the items. Empty: the first item's @self.schema. |
dialogTitle | String | 'Copy items' | |
patternLabel | String | 'Naming pattern' | |
patternPlaceholder | String | '\{name\} (copy)' | |
emptyText | String | 'No items selected for copying.' | Message shown when all items have been removed from the list |
successText | String | 'Items successfully copied.' | Message shown in the result phase on success |
cancelLabel | String | 'Cancel' | |
closeLabel | String | 'Close' | Label for the close button shown in the result phase |
confirmLabel | String | 'Copy' | |
removeLabel | String | 'Remove from list' | Tooltip/label for the per-item remove button |
Events
| Event | Payload | Description |
|---|---|---|
confirm | \{ ids, getName, include? \} | Copy confirmed; include holds the ticked link kinds, only when the page lists links and the server can copy them |
close | — | Dialog closed |
Copying with links
With include the dialog adds a Links to take along section: the included kinds, ticked, one checkbox each. Each row is copied with one request to OpenRegister's copy endpoint carrying the same kinds, and the result lists the links the server refused, with their reason. Without the endpoint the section is read-only with a note and the copy carries the fields only. See CnCopyDialog.
Public Methods
| Method | Description |
|---|---|
setResult(\{ success?, error?, results? \}) | Set result per item |
Live demo
<template>
<div>
<button @click="open = true" style="padding: 6px 16px; border-radius: 4px; background: var(--color-primary-element); color: white; border: none; cursor: pointer;">Copy selected (2)</button>
<CnMassCopyDialog
v-if="open"
ref="dlg"
:items="[{ id: 1, title: 'Report A' }, { id: 2, title: 'Report B' }]"
@confirm="onConfirm"
@close="open = false" />
</div>
</template>
<script>
export default {
data() { return { open: false } },
methods: {
async onConfirm(payload) {
await new Promise(r => setTimeout(r, 800))
this.$refs.dlg.setResult({ success: true })
},
},
}
</script>
Usage
<CnMassCopyDialog
ref="massCopyDialog"
:items="selectedItems"
@confirm="onMassCopy"
@close="showMassCopy = false" />
Reference (auto-generated)
The tables below are generated from the SFC source via vue-docgen-cli. They reflect what's actually in CnMassCopyDialog.vue and update automatically whenever the component changes.
OpenRegister reliance
light: this component touches OpenRegister lightly. 0 direct references, 1 file reached through imports.
See the reliance overview for the filterable list.
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
include | Array<'relationRows'|'incoming'|'files'> | [] | Link kinds a copy may take along, from the page's config.copy.include (relationRows, incoming, files). Each is offered ticked. Empty keeps the dialog as it was. | |
register | string | '' | Register slug of the items, for checking the server can copy links. Empty: the first item's @self.register. | |
schema | string | '' | Schema slug of the items. Empty: the first item's @self.schema. | |
items | array | ✓ | — | Items to copy. Each must have an id property. |
nameField | string | 'title' | Property name used for display (e.g., 'title', 'name') | |
nameFormatter | func | null | Optional function to format the item name. Receives the item, returns a string. Overrides nameField when provided. | |
dialogTitle | string | () => t('nextcloud-vue', 'Copy items') | Dialog title | |
patternLabel | string | () => t('nextcloud-vue', 'Naming pattern') | Label for the naming pattern selector | |
emptyText | string | () => t('nextcloud-vue', 'No items selected for copying.') | Text when all items removed from list | |
successText | string | () => t('nextcloud-vue', 'Items successfully copied.') | Success message | |
cancelLabel | string | () => t('nextcloud-vue', 'Cancel') | Label for the cancel button (visible before the copy runs). | |
closeLabel | string | () => t('nextcloud-vue', 'Close') | Label for the close button (visible after copy completes). | |
confirmLabel | string | () => t('nextcloud-vue', 'Copy') | Label for the primary confirm button that triggers the copy. | |
removeLabel | string | () => t('nextcloud-vue', 'Remove from list') | Aria label for the per-row "remove from list" icon button. |
Events
| Name | Payload | Description |
|---|---|---|
close | — | Emitted when the dialog should close (cancel, close button, or auto-close after success). |
confirm | — | Emitted when the user confirms copying. Payload: { ids, getName, include? } where getName(item) returns the new name and include lists the ticked link kinds. |
Methods
| Name | Description |
|---|---|
setResult | Set the result of the copy operation. Call this from the parent after the API call completes. |