From b9d3ad6d00f90de43582d0f824386a3d4243cf94 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 18 Oct 2025 20:12:27 +0200 Subject: [PATCH] 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 --- core/src/OC/dialogs.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/src/OC/dialogs.js b/core/src/OC/dialogs.js index fc1a028bbe8..d33cbb3841c 100644 --- a/core/src/OC/dialogs.js +++ b/core/src/OC/dialogs.js @@ -111,7 +111,7 @@ const Dialogs = { ? [ { label: t('core', 'Yes'), - type: 'error', + variant: 'error', callback: () => { callback.clicked = true callback(true) @@ -148,7 +148,7 @@ const Dialogs = { }, { label: t('core', 'Yes'), - type: 'primary', + variant: 'primary', callback: () => { callback.clicked = true callback(true) @@ -274,7 +274,7 @@ const Dialogs = { builder.addButton({ callback: legacyCallback(callback, button.type), label: button.text, - type: button.defaultButton ? 'primary' : 'secondary', + variant: button.defaultButton ? 'primary' : 'secondary', }) }) } else { @@ -287,14 +287,14 @@ 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, }) } @@ -302,7 +302,7 @@ const Dialogs = { 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, }) } @@ -387,7 +387,7 @@ const Dialogs = { }) buttonList.push({ label: buttons?.confirm ?? t('core', 'Yes'), - type: 'primary', + variant: 'primary', callback: () => { callback._clicked = true callback(true) @@ -397,7 +397,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)