feat: add option to disallow Google Drive in file uploader (#32517)
This commit is contained in:
parent
d7194aceed
commit
dc3ab2ee14
2 changed files with 7 additions and 2 deletions
|
|
@ -150,7 +150,7 @@
|
|||
<div class="mt-1">{{ __("Camera") }}</div>
|
||||
</button>
|
||||
<button
|
||||
v-if="google_drive_settings.enabled"
|
||||
v-if="allow_google_drive && google_drive_settings.enabled"
|
||||
class="btn btn-file-upload"
|
||||
@click="show_google_drive_picker"
|
||||
>
|
||||
|
|
@ -288,6 +288,9 @@ const props = defineProps({
|
|||
allow_toggle_optimize: {
|
||||
default: true,
|
||||
},
|
||||
allow_google_drive: {
|
||||
default: true,
|
||||
},
|
||||
});
|
||||
|
||||
// variables
|
||||
|
|
@ -315,7 +318,7 @@ if (props.allow_take_photo) {
|
|||
allow_take_photo.value = window.navigator.mediaDevices;
|
||||
}
|
||||
|
||||
if (frappe.user_id !== "Guest") {
|
||||
if (frappe.user_id !== "Guest" && props.allow_google_drive) {
|
||||
frappe.call({
|
||||
// method only available after login
|
||||
method: "frappe.integrations.doctype.google_settings.google_settings.get_file_picker_settings",
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ class FileUploader {
|
|||
allow_take_photo,
|
||||
allow_toggle_private,
|
||||
allow_toggle_optimize,
|
||||
allow_google_drive,
|
||||
} = {}) {
|
||||
frm && frm.attachments.max_reached(true);
|
||||
|
||||
|
|
@ -63,6 +64,7 @@ class FileUploader {
|
|||
allow_take_photo,
|
||||
allow_toggle_private,
|
||||
allow_toggle_optimize,
|
||||
allow_google_drive,
|
||||
});
|
||||
SetVueGlobals(app);
|
||||
this.uploader = app.mount(this.wrapper);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue