Skip to content

Commit 9c0f50d

Browse files
authored
Merge pull request #118 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 504f463 + e2548ce commit 9c0f50d

File tree

3 files changed

+173
-147
lines changed

3 files changed

+173
-147
lines changed

src/components/CippComponents/CippFormComponent.jsx

+4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export const CippFormComponent = (props) => {
4343
name, // The name that may have bracket notation
4444
label,
4545
labelLocation = "behind", // Default location for switches
46+
defaultValue,
4647
...other
4748
} = props;
4849
const { errors } = useFormState({ control: formControl.control });
@@ -121,6 +122,7 @@ export const CippFormComponent = (props) => {
121122
{...other}
122123
{...formControl.register(convertedName, { ...validators })}
123124
label={label}
125+
defaultValue={defaultValue}
124126
/>
125127
</div>
126128
<Typography variant="subtitle3" color="error">
@@ -156,6 +158,7 @@ export const CippFormComponent = (props) => {
156158
{...other}
157159
{...formControl.register(convertedName, { ...validators })}
158160
label={label}
161+
defaultValue={defaultValue}
159162
/>
160163
</div>
161164
<Typography variant="subtitle3" color="error">
@@ -171,6 +174,7 @@ export const CippFormComponent = (props) => {
171174
<Controller
172175
name={convertedName}
173176
control={formControl.control}
177+
defaultValue={defaultValue}
174178
render={({ field }) =>
175179
renderSwitchWithLabel(
176180
<Switch

src/components/CippWizard/CippWizardOffboarding.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -292,18 +292,18 @@ export const CippWizardOffboarding = (props) => {
292292
<Grid item xs={12} sm={6}>
293293
<Typography variant="subtitle2">Send results to:</Typography>
294294
<CippFormComponent
295-
name="webhook"
295+
name="postExecution.webhook"
296296
label="Webhook"
297297
type="switch"
298298
formControl={formControl}
299299
/>
300300
<CippFormComponent
301-
name="email"
301+
name="postExecution.email"
302302
label="E-mail"
303303
type="switch"
304304
formControl={formControl}
305305
/>
306-
<CippFormComponent name="psa" label="PSA" type="switch" formControl={formControl} />
306+
<CippFormComponent name="postExecution.psa" label="PSA" type="switch" formControl={formControl} />
307307
</Grid>
308308
</CippFormCondition>
309309
</Grid>

0 commit comments

Comments
 (0)