File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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' ;
Original file line number Diff line number Diff line change @@ -130,6 +130,15 @@ const formUnauthorizedMessage = computed(() =>
130130
131131const 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+
133142const 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 = "
You can’t perform that action at this time.
0 commit comments