Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable4] Backport of the breadcrumbs new button PR #894

Merged
merged 1 commit into from Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions l10n/messages.pot
Expand Up @@ -2,15 +2,15 @@ msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"

#: lib/components/FilePicker/FilePickerBreadcrumbs.vue:89
#: lib/components/FilePicker/FilePickerBreadcrumbs.vue:91
msgid "\"{name}\" is an invalid file name."
msgstr ""

#: lib/components/FilePicker/FilePickerBreadcrumbs.vue:91
#: lib/components/FilePicker/FilePickerBreadcrumbs.vue:93
msgid "\"{name}\" is not an allowed filetype"
msgstr ""

#: lib/components/FilePicker/FilePickerBreadcrumbs.vue:87
#: lib/components/FilePicker/FilePickerBreadcrumbs.vue:89
msgid "\"/\" is not allowed inside a file name."
msgstr ""

Expand Down Expand Up @@ -39,7 +39,7 @@ msgstr ""
msgid "Favorites"
msgstr ""

#: lib/components/FilePicker/FilePickerBreadcrumbs.vue:85
#: lib/components/FilePicker/FilePickerBreadcrumbs.vue:87
msgid "File name cannot be empty."
msgstr ""

Expand Down
9 changes: 7 additions & 2 deletions lib/components/DialogBase.vue
Expand Up @@ -10,7 +10,7 @@
<nav v-if="hasNavigation" :class="['dialog__navigation', ...navigationClasses]">
<slot name="navigation" :is-collapsed="isNavigationCollapsed" />
</nav>
<!-- Man dialog content -->
<!-- Main dialog content -->
<div class="dialog__content">
<!-- If the navigation is shown on the side the header should be directly aligned with the content -->
<h2 v-if="!isNavigationCollapsed" class="dialog__name">
Expand Down Expand Up @@ -38,7 +38,7 @@
import { NcModal } from '@nextcloud/vue'
import { computed, ref, useSlots } from 'vue'
import DialogButton, { type IDialogButton } from './DialogButton.vue'
import { Fragment } from 'vue-frag'
import { Fragment } from 'vue-frag' // can be dropped with vue3
import { useElementSize } from '@vueuse/core'

const props = withDefaults(defineProps<{
Expand Down Expand Up @@ -124,10 +124,15 @@ const handleClose = () => {
emit('close')
}

/**
* Properties to pass to the underlying NcModal
*/
const modalProps = computed(() => ({
container: props.container,
name: props.name,
size: props.size,
enableSlideshow: false,
enableSwipe: false,
}))
</script>

Expand Down
6 changes: 4 additions & 2 deletions lib/components/FilePicker/FilePickerBreadcrumbs.vue
Expand Up @@ -17,7 +17,9 @@
<template v-if="showMenu" #actions>
<NcActions :aria-label="t('Create directory')"
:force-menu="true"
type="tertiary"
:force-name="true"
:menu-name="t('New')"
type="secondary"
@close="newNodeName = ''">
<template #icon>
<IconPlus :size="20" />
Expand Down Expand Up @@ -87,7 +89,7 @@ function validateInput() {
validity = t('"/" is not allowed inside a file name.')
} else if (['..', '.'].includes(name)) {
validity = t('"{name}" is an invalid file name.', { name })
} else if (name.match(window.OC.config.blacklist_files_regex)) {
} else if (window.OC.config?.blacklist_files_regex && name.match(window.OC.config?.blacklist_files_regex)) {
validity = t('"{name}" is not an allowed filetype', { name })
}
if (input) {
Expand Down
8 changes: 8 additions & 0 deletions lib/window.d.ts
@@ -0,0 +1,8 @@
/// <reference types="@nextcloud/typings" />
export {}

declare global {
interface Window {
OC: Nextcloud.v27.OC
}
}