Skip to content
Prev Previous commit
Next Next commit
fix(dialogs): migrate buttons to variant prop
In Nextcloud Vue v8 the `type` prop for dialog buttons
was deprecated and replaces with the `variant` prop.

In v9 the deprecated props are removed.
Use the `variant` prop in the deprecated `OC.dialogs`.

This is a follow up for #55726.

Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud authored and susnux committed Dec 17, 2025
commit 463a5bd0334c1faf4549dd3300fecb85d382aeb8
16 changes: 8 additions & 8 deletions core/src/OC/dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const Dialogs = {
? [
{
label: t('core', 'Yes'),
type: 'error',
variant: 'error',
callback: () => {
callback.clicked = true
callback(true)
Expand Down Expand Up @@ -148,7 +148,7 @@ const Dialogs = {
},
{
label: t('core', 'Yes'),
type: 'primary',
variant: 'primary',
callback: () => {
callback.clicked = true
callback(true)
Expand Down Expand Up @@ -271,7 +271,7 @@ const Dialogs = {
builder.addButton({
callback: legacyCallback(callback, button.type),
label: button.text,
type: button.defaultButton ? 'primary' : 'secondary',
variant: button.defaultButton ? 'primary' : 'secondary',
})
})
} else {
Expand All @@ -284,22 +284,22 @@ const Dialogs = {
buttons.push({
callback: legacyCallback(callback, FilePickerType.Choose),
label: node && !this.multiSelect ? t('core', 'Choose {file}', { file: target }) : t('core', 'Choose'),
type: 'primary',
variant: 'primary',
})
}
if (type === FilePickerType.CopyMove || type === FilePickerType.Copy) {
buttons.push({
callback: legacyCallback(callback, FilePickerType.Copy),
label: target ? t('core', 'Copy to {target}', { target }) : t('core', 'Copy'),
type: 'primary',
variant: 'primary',
icon: IconCopy,
})
}
if (type === FilePickerType.Move || type === FilePickerType.CopyMove) {
buttons.push({
callback: legacyCallback(callback, FilePickerType.Move),
label: target ? t('core', 'Move to {target}', { target }) : t('core', 'Move'),
type: type === FilePickerType.Move ? 'primary' : 'secondary',
variant: type === FilePickerType.Move ? 'primary' : 'secondary',
icon: IconMove,
})
}
Expand Down Expand Up @@ -374,7 +374,7 @@ const Dialogs = {
})
buttonList.push({
label: buttons?.confirm ?? t('core', 'Yes'),
type: 'primary',
variant: 'primary',
callback: () => {
callback._clicked = true
callback(true)
Expand All @@ -384,7 +384,7 @@ const Dialogs = {
case Dialogs.OK_BUTTONS:
buttonList.push({
label: buttons?.confirm ?? t('core', 'OK'),
type: 'primary',
variant: 'primary',
callback: () => {
callback._clicked = true
callback(true)
Expand Down