Skip to content

Commit 0bc693e

Browse files
Merge branch 'main' into FORMS-1640-accessibility-contrast
2 parents ad095bc + 5d7894a commit 0bc693e

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

app/frontend/src/assets/scss/style.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,4 +602,15 @@ a,
602602
opacity: 1 !important;
603603
}
604604

605+
// Disable file downloads for public forms in readonly mode
606+
.form-wrapper.disable-file-downloads .formio-form {
607+
.formio-component-simplefile a[href],
608+
.formio-component-file a[href] {
609+
pointer-events: none !important;
610+
color: #6c757d !important;
611+
text-decoration: none !important;
612+
cursor: not-allowed !important;
613+
}
614+
}
615+
605616
@import 'global-status-overlay.scss';

app/frontend/src/components/designer/FormViewer.vue

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,15 @@ const formUnauthorizedMessage = computed(() =>
130130
131131
const NOTIFICATIONS_TYPES = computed(() => NotificationTypes);
132132
133+
const shouldDisableFileDownloads = computed(() => {
134+
// To disable file downloads for Public forms
135+
if (!form.value || !properties.readOnly) {
136+
return false;
137+
}
138+
139+
return properties.readOnly && isFormPublic(form.value);
140+
});
141+
133142
const viewerOptions = computed(() => {
134143
// Force recomputation of viewerOptions after rerendered formio to prevent duplicate submission update calls
135144
reRenderFormIo.value;
@@ -891,7 +900,10 @@ async function uploadFile(file, config = {}) {
891900
/>
892901
<h1 class="my-6 text-center">{{ form.name }}</h1>
893902
</div>
894-
<div class="form-wrapper">
903+
<div
904+
class="form-wrapper"
905+
:class="{ 'disable-file-downloads': shouldDisableFileDownloads }"
906+
>
895907
<v-alert
896908
v-if="saved || saving"
897909
:class="

0 commit comments

Comments
 (0)