From 35b65bc7924ef718fd8fc996c085e03d71eb573e Mon Sep 17 00:00:00 2001 From: Safwan Samsudeen Date: Tue, 12 Aug 2025 13:58:25 +0530 Subject: [PATCH] feat: allow adding other methods of file upload --- frappe/public/js/frappe/file_uploader/FileUploader.vue | 9 +++++++++ .../js/frappe/file_uploader/file_uploader.bundle.js | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/frappe/public/js/frappe/file_uploader/FileUploader.vue b/frappe/public/js/frappe/file_uploader/FileUploader.vue index b94b964876..cb04670bcd 100644 --- a/frappe/public/js/frappe/file_uploader/FileUploader.vue +++ b/frappe/public/js/frappe/file_uploader/FileUploader.vue @@ -163,6 +163,12 @@
{{ __("Google Drive") }}
+
{{ upload_notes }} @@ -291,6 +297,9 @@ const props = defineProps({ allow_google_drive: { default: true, }, + other_options: { + default: () => [], + }, }); // variables diff --git a/frappe/public/js/frappe/file_uploader/file_uploader.bundle.js b/frappe/public/js/frappe/file_uploader/file_uploader.bundle.js index c9734f7d6c..56b866d8a4 100644 --- a/frappe/public/js/frappe/file_uploader/file_uploader.bundle.js +++ b/frappe/public/js/frappe/file_uploader/file_uploader.bundle.js @@ -65,6 +65,7 @@ class FileUploader { allow_toggle_private, allow_toggle_optimize, allow_google_drive, + other_options: this.get_extra_options(), }); SetVueGlobals(app); this.uploader = app.mount(this.wrapper); @@ -126,6 +127,11 @@ class FileUploader { return this.uploader.upload_files(this.dialog); } + get_extra_options() { + // Defaults to empty list, can be overriden externally + return []; + } + make_dialog(title) { this.dialog = new frappe.ui.Dialog({ title: title || __("Upload"),