Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2019-06-18 16:56:53 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2019-06-19 13:05:01 +0300
commit8636a07fc6b613f99be52c77aa161d367e26d6a0 (patch)
treec2fe7a33613650bb72c9f0e3dfe019f069c42c15 /src
parent39e846f7fea0baafda649f45aac10c03ee4aa858 (diff)
Use nextcloud-dialogs for the file pickers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'src')
-rw-r--r--src/components/ComposerAttachments.vue7
-rw-r--r--src/components/MessageAttachment.vue16
2 files changed, 14 insertions, 9 deletions
diff --git a/src/components/ComposerAttachments.vue b/src/components/ComposerAttachments.vue
index 1df43248b..59a4b50ed 100644
--- a/src/components/ComposerAttachments.vue
+++ b/src/components/ComposerAttachments.vue
@@ -48,7 +48,7 @@
<script>
import _ from 'lodash'
import {translate as t} from 'nextcloud-l10n'
-import {pickFileOrDirectory} from 'nextcloud-server/dist/files'
+import {getFilePickerBuilder} from 'nextcloud-dialogs'
import Vue from 'vue'
import {uploadLocalAttachment} from '../service/AttachmentService'
@@ -123,7 +123,10 @@ export default {
return done
},
onAddCloudAttachment() {
- return pickFileOrDirectory(t('mail', 'Choose a file to add as attachment'))
+ const picker = getFilePickerBuilder(t('mail', 'Choose a file to add as attachment')).build()
+
+ return picker
+ .pick(t('mail', 'Choose a file to add as attachment'))
.then(path => this.emitNewAttachment(this.fileNameToAttachment(path)))
.catch(console.error.bind(this))
},
diff --git a/src/components/MessageAttachment.vue b/src/components/MessageAttachment.vue
index 227a771b4..b1847899d 100644
--- a/src/components/MessageAttachment.vue
+++ b/src/components/MessageAttachment.vue
@@ -56,7 +56,7 @@
<script>
import {formatFileSize} from 'nextcloud-server/dist/format'
import {mixin as onClickOutside} from 'vue-on-click-outside'
-import {pickFileOrDirectory} from 'nextcloud-server/dist/files'
+import {getFilePickerBuilder} from 'nextcloud-dialogs'
import {PopoverMenu} from 'nextcloud-vue'
import {parseUid} from '../util/EnvelopeUidParser'
@@ -131,13 +131,15 @@ export default {
return saveAttachmentToFiles(accountId, folderId, messageId, attachmentId, directory)
}
const {accountId, folderId, id} = parseUid(this.$route.params.messageUid)
+ const picker = getFilePickerBuilder(t('mail', 'Choose a folder to store the attachment in'))
+ .setMultiSelect(false)
+ .addMimeTypeFilter('httpd/unix-directory')
+ .setModal(true)
+ .setType(1)
+ .build()
- return pickFileOrDirectory(
- t('mail', 'Choose a folder to store the attachment in'),
- false,
- ['httpd/unix-directory'],
- true
- )
+ return picker
+ .pick()
.then(dest => {
this.savingToCloud = true
return dest