Skip to content

Commit

Permalink
Merge pull request #19 from open-formulieren/fix/missing-file-properties
Browse files Browse the repository at this point in the history
🐛 Add missing properties for file component
  • Loading branch information
sergei-maertens authored Oct 27, 2023
2 parents 619d979 + 6853fe2 commit 528656b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/formio/components/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ export interface BaseFileComponentSchema
HasValidation<Validator> {
type: 'file';
multiple?: boolean;

// (possibly) more-constrained existing formio properties
webcam: false;
options: {withCredentials: true};
storage: 'url';
url: string;
file: FileUploadConfiguration;
Expand Down
16 changes: 16 additions & 0 deletions test-d/formio/components/file.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ expectAssignable<FileComponentSchema>({
type: 'file',
key: 'someFile',
label: 'Attachment',
webcam: false,
options: {withCredentials: true},
storage: 'url',
url: '',
file: {
Expand All @@ -43,6 +45,8 @@ const explicitSingleUpload: FileComponentSchema = {
type: 'file',
key: 'someFile',
label: 'Attachment',
webcam: false,
options: {withCredentials: true},
storage: 'url',
url: '',
file: {
Expand All @@ -63,6 +67,8 @@ const explicitMultipleUpload: FileComponentSchema = {
type: 'file',
key: 'someFile',
label: 'Attachment',
webcam: false,
options: {withCredentials: true},
storage: 'url',
url: '',
file: {
Expand All @@ -83,6 +89,8 @@ const implicitSingleUpload: FileComponentSchema = {
type: 'file',
key: 'someFile',
label: 'Attachment',
webcam: false,
options: {withCredentials: true},
storage: 'url',
url: '',
file: {
Expand All @@ -106,6 +114,8 @@ expectAssignable<FileComponentSchema>({
key: 'someInput',
label: 'Some input',
// builder sets empty URL, backend dynamically makes this non-empty
webcam: false,
options: {withCredentials: true},
storage: 'url',
url: '',
file: {
Expand Down Expand Up @@ -143,6 +153,8 @@ expectAssignable<FileComponentSchema>({
expectAssignable<FileComponentSchema>({
id: 'yejak',
type: 'file',
webcam: false,
options: {withCredentials: true},
storage: 'url',
url: '',
// basic tab in builder form
Expand Down Expand Up @@ -219,6 +231,8 @@ expectNotAssignable<FileComponentSchema>({
type: 'content',
key: 'someFile',
label: 'Attachment',
webcam: false,
options: {withCredentials: true},
storage: 'url',
url: '',
file: {
Expand All @@ -235,6 +249,8 @@ expectNotAssignable<FileComponentSchema>({
type: 'file',
key: 'someFile',
label: 'Attachment',
webcam: false,
options: {withCredentials: true},
storage: 's3', // we only support url
url: '',
file: {
Expand Down

0 comments on commit 528656b

Please sign in to comment.