Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
})
},
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)

Check warning on line 149 in src/components/Editor/Attachments/AttachmentsList.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Editor/Attachments/AttachmentsList.vue#L148-L149

Added lines #L148 - L149 were not covered by tests
.addButton({
label: t('calendar', 'Pick'),
type: 'primary',
callback: (nodes) => logger.debug('Picked attachment', { nodes }),

Check warning on line 153 in src/components/Editor/Attachments/AttachmentsList.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Editor/Attachments/AttachmentsList.vue#L151-L153

Added lines #L151 - L153 were not covered by tests
})
.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 @@
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 Expand Up @@ -240,7 +250,7 @@
type: 'primary',
callback: () => {
window.open(url.href, '_blank', 'noopener noreferrer')
}

Check warning on line 253 in src/components/Editor/Attachments/AttachmentsList.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Missing trailing comma
},
]
this.showOpenConfirmation = true
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
Loading