-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #180 from Amsterdam/feature/add-upload-bpmn
Feature/add upload bpmn
- Loading branch information
Showing
11 changed files
with
219 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Ignore artifacts: | ||
build | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"semi": false, | ||
"trailingComma" : "none" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/app/pages/CaseDetailsPage/tasks/FormDialog/forms/FileTaskForm.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React from "react" | ||
import { | ||
Form, | ||
FormActionButtons, | ||
FileInputField, | ||
TextInputField | ||
} from "app/components" | ||
import type { FormItem } from "./types" | ||
|
||
type Props = { | ||
loading?: boolean | ||
closeModal: () => void | ||
submitForm: (variables: { name: string, upload: FileList }) => void | ||
form: FormItem[] | ||
} | ||
|
||
export const FileTaskForm: React.FC<Props> = ({ | ||
closeModal, | ||
submitForm, | ||
loading = false, | ||
form | ||
}) => { | ||
const formItem = form[0] | ||
|
||
return ( | ||
<Form onSubmit={submitForm} formGrid={{ narrow: 4, medium: 6, wide: 10 }}> | ||
<TextInputField | ||
key="key-name" | ||
name="name" | ||
label="Titel van het document" | ||
validation={{ required: formItem.required }} | ||
/> | ||
<FileInputField | ||
key="key-upload" | ||
name="upload" | ||
label={formItem.label} | ||
validation={{ required: formItem.required }} | ||
/> | ||
<FormActionButtons | ||
okText="Taak afronden" | ||
onCancel={closeModal} | ||
loading={loading} | ||
/> | ||
</Form> | ||
) | ||
} |
70 changes: 34 additions & 36 deletions
70
src/app/pages/CaseDetailsPage/tasks/FormDialog/forms/GenericTaskForm.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/app/pages/CaseDetailsPage/tasks/FormDialog/forms/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export type FormItem = { | ||
type: string | ||
name: string | ||
label: string | ||
required?: boolean | ||
options?: { value: string, label: string }[] | ||
tooltip?: string | ||
} | ||
|
||
type Value = boolean | string | object | Blob | File[] | FileList | ||
|
||
export type GenericTaskFormData = Record<string, Value> |
Oops, something went wrong.