Skip to content

Commit 463a5bd

Browse files
max-nextcloudsusnux
authored andcommitted
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]>
1 parent 689cbdf commit 463a5bd

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

core/src/OC/dialogs.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const Dialogs = {
110110
? [
111111
{
112112
label: t('core', 'Yes'),
113-
type: 'error',
113+
variant: 'error',
114114
callback: () => {
115115
callback.clicked = true
116116
callback(true)
@@ -148,7 +148,7 @@ const Dialogs = {
148148
},
149149
{
150150
label: t('core', 'Yes'),
151-
type: 'primary',
151+
variant: 'primary',
152152
callback: () => {
153153
callback.clicked = true
154154
callback(true)
@@ -271,7 +271,7 @@ const Dialogs = {
271271
builder.addButton({
272272
callback: legacyCallback(callback, button.type),
273273
label: button.text,
274-
type: button.defaultButton ? 'primary' : 'secondary',
274+
variant: button.defaultButton ? 'primary' : 'secondary',
275275
})
276276
})
277277
} else {
@@ -284,22 +284,22 @@ const Dialogs = {
284284
buttons.push({
285285
callback: legacyCallback(callback, FilePickerType.Choose),
286286
label: node && !this.multiSelect ? t('core', 'Choose {file}', { file: target }) : t('core', 'Choose'),
287-
type: 'primary',
287+
variant: 'primary',
288288
})
289289
}
290290
if (type === FilePickerType.CopyMove || type === FilePickerType.Copy) {
291291
buttons.push({
292292
callback: legacyCallback(callback, FilePickerType.Copy),
293293
label: target ? t('core', 'Copy to {target}', { target }) : t('core', 'Copy'),
294-
type: 'primary',
294+
variant: 'primary',
295295
icon: IconCopy,
296296
})
297297
}
298298
if (type === FilePickerType.Move || type === FilePickerType.CopyMove) {
299299
buttons.push({
300300
callback: legacyCallback(callback, FilePickerType.Move),
301301
label: target ? t('core', 'Move to {target}', { target }) : t('core', 'Move'),
302-
type: type === FilePickerType.Move ? 'primary' : 'secondary',
302+
variant: type === FilePickerType.Move ? 'primary' : 'secondary',
303303
icon: IconMove,
304304
})
305305
}
@@ -374,7 +374,7 @@ const Dialogs = {
374374
})
375375
buttonList.push({
376376
label: buttons?.confirm ?? t('core', 'Yes'),
377-
type: 'primary',
377+
variant: 'primary',
378378
callback: () => {
379379
callback._clicked = true
380380
callback(true)
@@ -384,7 +384,7 @@ const Dialogs = {
384384
case Dialogs.OK_BUTTONS:
385385
buttonList.push({
386386
label: buttons?.confirm ?? t('core', 'OK'),
387-
type: 'primary',
387+
variant: 'primary',
388388
callback: () => {
389389
callback._clicked = true
390390
callback(true)

0 commit comments

Comments
 (0)