fix: file size limit for guest pages (#359)
This commit is contained in:
parent
f56cee5acd
commit
b41d6c0e60
|
|
@ -272,7 +272,11 @@ export default {
|
||||||
}
|
}
|
||||||
} else if (field.type === 'files' || (field.type === 'url' && field.file_upload)) {
|
} else if (field.type === 'files' || (field.type === 'url' && field.file_upload)) {
|
||||||
inputProperties.multiple = (field.multiple !== undefined && field.multiple)
|
inputProperties.multiple = (field.multiple !== undefined && field.multiple)
|
||||||
inputProperties.mbLimit = Math.min(Math.max(field.max_file_size, 1), this.form?.max_file_size ?? this.currentWorkspace?.max_file_size)
|
let maxFileSize = (this.form?.workspace && this.form?.workspace.max_file_size) ? this.form?.workspace?.max_file_size : 10
|
||||||
|
if (field?.max_file_size > 0) {
|
||||||
|
maxFileSize = Math.min(field.max_file_size, maxFileSize)
|
||||||
|
}
|
||||||
|
inputProperties.mbLimit = maxFileSize
|
||||||
inputProperties.accept = (this.form.is_pro && field.allowed_file_types) ? field.allowed_file_types : ''
|
inputProperties.accept = (this.form.is_pro && field.allowed_file_types) ? field.allowed_file_types : ''
|
||||||
} else if (field.type === 'rating') {
|
} else if (field.type === 'rating') {
|
||||||
inputProperties.numberOfStars = parseInt(field.rating_max_value) ?? 5
|
inputProperties.numberOfStars = parseInt(field.rating_max_value) ?? 5
|
||||||
|
|
|
||||||
|
|
@ -343,7 +343,7 @@ export default {
|
||||||
return !this.typesWithoutPlaceholder.includes(this.field.type)
|
return !this.typesWithoutPlaceholder.includes(this.field.type)
|
||||||
},
|
},
|
||||||
mbLimit() {
|
mbLimit() {
|
||||||
return this.form?.max_file_size ?? this.currentWorkspace?.max_file_size
|
return (this.form?.workspace && this.form?.workspace.max_file_size) ? this.form?.workspace?.max_file_size : 10
|
||||||
},
|
},
|
||||||
prefillSelectsOptions() {
|
prefillSelectsOptions() {
|
||||||
if (!['select', 'multi_select'].includes(this.field.type)) return {}
|
if (!['select', 'multi_select'].includes(this.field.type)) return {}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue