mirror of
https://github.com/nextcloud/server.git
synced 2026-02-18 18:28:50 -05:00
fix: migrate to non-deprecated dialog props
In Nextcloud Vue v8 some props for dialog buttons were deprecated (type for e.g. primary or nativeType) those are replaced with `variant` and `type`. In v9 the deprecated props are removed - thus this breaks with nextcloud-dialogs v7 which is based on Vue 3. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
093c95f260
commit
470ff8d3d3
9 changed files with 19 additions and 19 deletions
|
|
@ -98,8 +98,8 @@ export default {
|
|||
},
|
||||
{
|
||||
label: this.$t('dav', 'Import'),
|
||||
type: 'primary',
|
||||
icon: IconCheck,
|
||||
variant: 'primary',
|
||||
callback: () => { this.clickImportInput() },
|
||||
},
|
||||
],
|
||||
|
|
|
|||
|
|
@ -239,8 +239,8 @@ async function openFilePickerForAction(
|
|||
|
||||
if (action === MoveCopyAction.COPY || action === MoveCopyAction.MOVE_OR_COPY) {
|
||||
buttons.push({
|
||||
label: target ? t('files', 'Copy to {target}', { target }, undefined, { escape: false, sanitize: false }) : t('files', 'Copy'),
|
||||
type: 'primary',
|
||||
label: target ? t('files', 'Copy to {target}', { target }, { escape: false, sanitize: false }) : t('files', 'Copy'),
|
||||
variant: 'primary',
|
||||
icon: CopyIconSvg,
|
||||
disabled: selection.some((node) => (node.permissions & Permission.CREATE) === 0),
|
||||
async callback(destination: Node[]) {
|
||||
|
|
@ -271,7 +271,7 @@ async function openFilePickerForAction(
|
|||
if (action === MoveCopyAction.MOVE || action === MoveCopyAction.MOVE_OR_COPY) {
|
||||
buttons.push({
|
||||
label: target ? t('files', 'Move to {target}', { target }, undefined, { escape: false, sanitize: false }) : t('files', 'Move'),
|
||||
type: action === MoveCopyAction.MOVE ? 'primary' : 'secondary',
|
||||
variant: action === MoveCopyAction.MOVE ? 'primary' : 'secondary',
|
||||
icon: FolderMoveSvg,
|
||||
async callback(destination: Node[]) {
|
||||
resolve({
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ async function confirmLocalEditDialog(): Promise<'online' | 'local' | false> {
|
|||
.setButtons([
|
||||
{
|
||||
label: t('files', 'Retry and close'),
|
||||
type: 'secondary',
|
||||
variant: 'secondary',
|
||||
callback: () => {
|
||||
result = 'local'
|
||||
},
|
||||
|
|
@ -106,7 +106,7 @@ async function confirmLocalEditDialog(): Promise<'online' | 'local' | false> {
|
|||
{
|
||||
label: t('files', 'Open online'),
|
||||
icon: IconWeb,
|
||||
type: 'primary',
|
||||
variant: 'primary',
|
||||
callback: () => {
|
||||
result = 'online'
|
||||
},
|
||||
|
|
|
|||
|
|
@ -29,13 +29,13 @@ const dontShowAgain = computed({
|
|||
set: (value: boolean) => userConfigStore.update('show_dialog_file_extension', !value),
|
||||
})
|
||||
|
||||
const buttons = computed<IDialogButton[]>(() => [
|
||||
const buttons = computed(() => [
|
||||
{
|
||||
label: props.oldExtension
|
||||
? t('files', 'Keep {old}', { old: props.oldExtension })
|
||||
: t('files', 'Keep without extension'),
|
||||
icon: svgIconCancel,
|
||||
type: 'secondary',
|
||||
variant: 'secondary',
|
||||
callback: () => closeDialog(false),
|
||||
},
|
||||
{
|
||||
|
|
@ -43,10 +43,10 @@ const buttons = computed<IDialogButton[]>(() => [
|
|||
? t('files', 'Use {new}', { new: props.newExtension })
|
||||
: t('files', 'Remove extension'),
|
||||
icon: svgIconCheck,
|
||||
type: 'primary',
|
||||
variant: 'primary',
|
||||
callback: () => closeDialog(true),
|
||||
},
|
||||
])
|
||||
] satisfies IDialogButton[])
|
||||
|
||||
/** Open state of the dialog */
|
||||
const open = ref(true)
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ export default defineComponent({
|
|||
window.open(generateFileUrl(node.fileid!))
|
||||
}
|
||||
},
|
||||
type: 'primary',
|
||||
variant: 'primary',
|
||||
})
|
||||
.disableNavigation()
|
||||
.startAt(this.richObject.path)
|
||||
|
|
|
|||
|
|
@ -80,8 +80,8 @@ export default defineComponent({
|
|||
dialogButtons() {
|
||||
return [{
|
||||
label: t('files_external', 'Confirm'),
|
||||
type: 'primary',
|
||||
nativeType: 'submit',
|
||||
type: 'submit',
|
||||
variant: 'primary',
|
||||
}]
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ export default defineComponent({
|
|||
// If there is already a label set, offer to remove the version label
|
||||
buttons.push({
|
||||
label: t('files_versions', 'Remove version name'),
|
||||
type: 'error',
|
||||
nativeType: 'reset',
|
||||
type: 'reset',
|
||||
variant: 'error',
|
||||
callback: () => { this.setVersionLabel('') },
|
||||
})
|
||||
}
|
||||
|
|
@ -80,9 +80,9 @@ export default defineComponent({
|
|||
...buttons,
|
||||
{
|
||||
label: t('files_versions', 'Save version name'),
|
||||
type: 'primary',
|
||||
nativeType: 'submit',
|
||||
icon: svgCheck,
|
||||
type: 'submit',
|
||||
variant: 'primary',
|
||||
},
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ export default {
|
|||
callback: (nodes) => {
|
||||
this.applyFile(nodes[0]?.path)
|
||||
},
|
||||
type: 'primary',
|
||||
variant: 'primary',
|
||||
})
|
||||
.build()
|
||||
picker.pick()
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ const dialogButtons = [
|
|||
},
|
||||
{
|
||||
label: t('updatenotification', 'Get started'),
|
||||
type: 'primary',
|
||||
variant: 'primary',
|
||||
callback: () => {
|
||||
emit('dismiss')
|
||||
emit('update:open', false)
|
||||
|
|
|
|||
Loading…
Reference in a new issue