mirror of
https://github.com/IT4Change/ohmyform-ui.git
synced 2025-12-12 17:25:51 +00:00
add todo and improve class names
This commit is contained in:
parent
abf57a6976
commit
dd45330a0f
@ -39,6 +39,8 @@ export const ExportSubmissionAction: React.FC<Props> = (props) => {
|
||||
const orderedFields = form.data.form.fields
|
||||
.sort((a, b) => (a.idx ?? 0) - (b.idx ?? 0))
|
||||
|
||||
// TODO should go through deleted fields as well to have a complete overview!
|
||||
|
||||
const sheet = workbook.addWorksheet('Submissions')
|
||||
sheet.getRow(1).values = [
|
||||
'Submission ID',
|
||||
@ -69,7 +71,7 @@ export const ExportSubmissionAction: React.FC<Props> = (props) => {
|
||||
]
|
||||
|
||||
orderedFields.forEach((formField) => {
|
||||
const field = data.fields.find(field => field.id === formField.id)
|
||||
const field = data.fields.find(submission => submission.field?.id === formField.id)
|
||||
|
||||
try {
|
||||
fieldTypes[field.type]?.stringifyValue(field.value)
|
||||
|
||||
@ -1,16 +1,17 @@
|
||||
import { gql } from '@apollo/client/core'
|
||||
|
||||
interface SubmissionFragmentFormField {
|
||||
interface FormFieldSubmissionFragment {
|
||||
id: string
|
||||
title: string
|
||||
required: boolean
|
||||
}
|
||||
|
||||
export interface SubmissionFragmentField {
|
||||
export interface SubmissionFieldFragment {
|
||||
id: string
|
||||
value: string
|
||||
type: string
|
||||
|
||||
field?: SubmissionFragmentFormField
|
||||
field?: FormFieldSubmissionFragment
|
||||
}
|
||||
|
||||
export interface SubmissionFragment {
|
||||
@ -28,7 +29,7 @@ export interface SubmissionFragment {
|
||||
name: string
|
||||
}
|
||||
|
||||
fields: SubmissionFragmentField[]
|
||||
fields: SubmissionFieldFragment[]
|
||||
}
|
||||
|
||||
export const SUBMISSION_FRAGMENT = gql`
|
||||
@ -53,6 +54,7 @@ export const SUBMISSION_FRAGMENT = gql`
|
||||
type
|
||||
|
||||
field {
|
||||
id
|
||||
title
|
||||
required
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user