Merge pull request #35648 from sagarvora/check-allow-conf

fix: check for configuration when allowing private toggle
This commit is contained in:
Sagar Vora 2026-01-08 14:18:43 +05:30 committed by GitHub
commit f7047e97a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 9 deletions

View file

@ -465,7 +465,13 @@ def run_ui_tests(
os.chdir(app_base_path)
node_bin = subprocess.getoutput("(cd ../frappe && yarn bin)")
node_bin = subprocess.run(
"(cd ../frappe && yarn bin)",
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL,
text=True,
).stdout.strip()
cypress_path = f"{node_bin}/cypress"
drag_drop_plugin_path = f"{node_bin}/../@4tw/cypress-drag-drop"
real_events_plugin_path = f"{node_bin}/../cypress-real-events"

View file

@ -138,13 +138,6 @@ let allow_toggle_optimize = computed(() => {
);
});
let allow_toggle_private = computed(() => {
if (!frappe.utils.can_upload_public_files()) {
return false;
}
return props.allow_toggle_private;
});
let show_private_checkbox = computed(() => {
return !uploaded.value && !props.file.failed;
});

View file

@ -30,7 +30,14 @@ class FileUploader {
} = {}) {
frm && frm.attachments.max_reached(true);
this.can_toggle_private = frappe.utils.can_upload_public_files();
if (allow_toggle_private === undefined) {
allow_toggle_private = true;
}
allow_toggle_private = Boolean(
allow_toggle_private && frappe.utils.can_upload_public_files()
);
this.can_toggle_private = allow_toggle_private;
if (!wrapper) {
this.make_dialog(dialog_title);