Skip to content

Commit

Permalink
Merge pull request #894 from nextcloud-libraries/backport/32cf5868939…
Browse files Browse the repository at this point in the history
…c857390320caa95664d3ef89d1093

[stable4] Backport of the breadcrumbs new button PR
  • Loading branch information
susnux committed Aug 15, 2023
2 parents 0fd82df + cd1329b commit 0e3f11d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
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
}
}

0 comments on commit 0e3f11d

Please sign in to comment.