Skip to content

Commit

Permalink
Merge pull request #6545 from nextcloud/backport/6534/stable4.7
Browse files Browse the repository at this point in the history
[stable4.7] Event attachments: Enable directory selection
  • Loading branch information
kesselb authored Dec 4, 2024
2 parents 5e18110 + b9f1a99 commit 87a3efb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 12 additions & 2 deletions src/components/Editor/Attachments/AttachmentsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,15 @@ export default {
})
},
async openFilesModal() {
const picker = getFilePickerBuilder(t('calendar', 'Choose a file to add as attachment')).setMultiSelect(false).build()
const picker = getFilePickerBuilder(t('calendar', 'Choose a file to add as attachment'))
.setMultiSelect(false)
.allowDirectories(true)
.addButton({
label: t('calendar', 'Pick'),
type: 'primary',
callback: (nodes) => logger.debug('Picked attachment', { nodes }),
})
.build()
try {
const filename = await picker.pick(t('calendar', 'Choose a file to share as a link'))
if (!this.isDuplicateAttachment(filename)) {
Expand Down Expand Up @@ -202,7 +210,9 @@ export default {
if (attachment.xNcHasPreview) {
return generateUrl(`/core/preview?fileId=${attachment.xNcFileId}&x=100&y=100&a=0`)
}
return attachment.formatType ? OC.MimeType.getIconUrl(attachment.formatType) : null
return attachment.formatType
? OC.MimeType.getIconUrl(attachment.formatType)
: OC.MimeType.getIconUrl('folder')
},
getBaseName(name) {
return name.split('/').pop()
Expand Down
4 changes: 3 additions & 1 deletion src/views/EditSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,9 @@ export default {
if (attachment.xNcHasPreview) {
return generateUrl(`/core/preview?fileId=${attachment.xNcFileId}&x=100&y=100&a=0`)
}
return attachment.formatType ? OC.MimeType.getIconUrl(attachment.formatType) : null
return attachment.formatType
? OC.MimeType.getIconUrl(attachment.formatType)
: OC.MimeType.getIconUrl('folder')
},
acceptAttachmentsModal() {
if (!this.doNotShare) {
Expand Down

0 comments on commit 87a3efb

Please sign in to comment.