mirror of
https://github.com/IT4Change/ohmyform-ui.git
synced 2025-12-13 09:45:50 +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
|
const orderedFields = form.data.form.fields
|
||||||
.sort((a, b) => (a.idx ?? 0) - (b.idx ?? 0))
|
.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')
|
const sheet = workbook.addWorksheet('Submissions')
|
||||||
sheet.getRow(1).values = [
|
sheet.getRow(1).values = [
|
||||||
'Submission ID',
|
'Submission ID',
|
||||||
@ -69,7 +71,7 @@ export const ExportSubmissionAction: React.FC<Props> = (props) => {
|
|||||||
]
|
]
|
||||||
|
|
||||||
orderedFields.forEach((formField) => {
|
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 {
|
try {
|
||||||
fieldTypes[field.type]?.stringifyValue(field.value)
|
fieldTypes[field.type]?.stringifyValue(field.value)
|
||||||
|
|||||||
@ -1,16 +1,17 @@
|
|||||||
import { gql } from '@apollo/client/core'
|
import { gql } from '@apollo/client/core'
|
||||||
|
|
||||||
interface SubmissionFragmentFormField {
|
interface FormFieldSubmissionFragment {
|
||||||
|
id: string
|
||||||
title: string
|
title: string
|
||||||
required: boolean
|
required: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SubmissionFragmentField {
|
export interface SubmissionFieldFragment {
|
||||||
id: string
|
id: string
|
||||||
value: string
|
value: string
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
field?: SubmissionFragmentFormField
|
field?: FormFieldSubmissionFragment
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SubmissionFragment {
|
export interface SubmissionFragment {
|
||||||
@ -28,7 +29,7 @@ export interface SubmissionFragment {
|
|||||||
name: string
|
name: string
|
||||||
}
|
}
|
||||||
|
|
||||||
fields: SubmissionFragmentField[]
|
fields: SubmissionFieldFragment[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SUBMISSION_FRAGMENT = gql`
|
export const SUBMISSION_FRAGMENT = gql`
|
||||||
@ -53,6 +54,7 @@ export const SUBMISSION_FRAGMENT = gql`
|
|||||||
type
|
type
|
||||||
|
|
||||||
field {
|
field {
|
||||||
|
id
|
||||||
title
|
title
|
||||||
required
|
required
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user