make image and file fields required

pull/105/head
Alex Turchyn 2 years ago
parent 0b4a2819dd
commit b7eb6cacc2

@ -45,7 +45,7 @@
> >
</template> </template>
<FileDropzone <FileDropzone
:message="`Upload ${field.name || 'Attachments'}`" :message="`Upload ${field.name || 'Attachments'}${field.required ? '' : ' (optional)'}`"
:submitter-slug="submitterSlug" :submitter-slug="submitterSlug"
@upload="onUpload" @upload="onUpload"
/> />

@ -232,7 +232,7 @@
<button <button
type="submit" type="submit"
class="base-button w-full flex justify-center" class="base-button w-full flex justify-center"
:disabled="isSubmitting" :disabled="isSubmitting || (currentField.required && ['image', 'file'].includes(currentField.type) && !values[currentField.uuid]?.length)"
> >
<span class="flex"> <span class="flex">
<IconInnerShadowTop <IconInnerShadowTop

@ -27,7 +27,7 @@
<div> <div>
<FileDropzone <FileDropzone
v-if="!modelValue" v-if="!modelValue"
:message="`Upload ${field.name || 'Image'}`" :message="`Upload ${field.name || 'Image'}${field.required ? '' : ' (optional)'}`"
:submitter-slug="submitterSlug" :submitter-slug="submitterSlug"
:accept="'image/*'" :accept="'image/*'"
@upload="onImageUpload" @upload="onImageUpload"

Loading…
Cancel
Save