Skip to content

Commit

Permalink
🔥 Remove unneeded FormIO options
Browse files Browse the repository at this point in the history
  • Loading branch information
shea-maykinmedia committed Jun 4, 2021
1 parent fca3f09 commit 17c1850
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/Summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { get, post } from './api';
import FormIOWrapper from "./FormIOWrapper";
import {Templates} from "react-formio";

// use our own template library
// use our own template for this component
Templates.addTemplate('overview', {
component: {
form: `
Expand All @@ -34,13 +34,17 @@ Templates.addTemplate('overview', {

const loadStepsData = async (submission) => {
return await Promise.all(submission.steps.map(async (submissionStep) => {
const stepDetail = await get(submissionStep.url);
const submissionStepDetail = await get(submissionStep.url);
const formStepDetail = await get(submissionStep.formStep);
const formDefinitionDetail = await get(formStepDetail.formDefinition);
return {submissionStep,
title: formDefinitionDetail.name,
data: {data: stepDetail.data},
configuration: stepDetail.formStep.configuration};
return {
submissionStep,
title: formDefinitionDetail.name,
data: {
data: submissionStepDetail.data
},
configuration: submissionStepDetail.formStep.configuration
};
}));
};

Expand Down Expand Up @@ -71,18 +75,17 @@ const Summary = ({ submission, onConfirm, onShowStep }) => {
<h2>Controleer en bevestig</h2>

{value && value.map((step, index) => (
<Fragment>
<Fragment key={index}>
<div style={{display: 'flex', alignItems: 'baseline', justifyContent: 'space-between'}}>
<h3>{step.title}</h3>
<Button variant="anchor" component="a" onClick={_ => onShowStep(step.submissionStep)}>
Wijzig {step.title.toLocaleLowerCase()}
</Button>
</div>
<FormIOWrapper
key={index}
form={step.configuration}
submission={step.data}
options={{noAlerts: true, readOnly: true, renderMode: 'html', template: 'overview'}}
options={{renderMode: 'html', template: 'overview'}}
/>
</Fragment>
))}
Expand Down

0 comments on commit 17c1850

Please sign in to comment.