Skip to content

Commit

Permalink
[EPICSYSTEM-73] limit multi-page toggle width (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
tolkamps1 authored May 23, 2024
1 parent 346194d commit 91031ef
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 54 deletions.
84 changes: 43 additions & 41 deletions met-web/src/components/survey/building/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,49 +283,51 @@ const SurveyFormBuilder = () => {
<Divider />
</Grid>
<Grid item xs={12}>
<FormGroup>
<FormControlLabel
control={
<Switch
checked={isMultiPage}
onChange={(e) => {
dispatch(
openNotificationModal({
open: true,
data: {
header: 'Change Survey Type',
subText: [
{
text: `You will be changing the survey type from ${
isMultiPage
? 'multi page to single page'
: 'single page to multi page'
}.`,
},
{
text: 'You will lose all current progress if you do.',
bold: true,
},
{
text: 'Do you want to change this survey type?',
<Stack direction="row">
<FormGroup>
<FormControlLabel
control={
<Switch
checked={isMultiPage}
onChange={(e) => {
dispatch(
openNotificationModal({
open: true,
data: {
header: 'Change Survey Type',
subText: [
{
text: `You will be changing the survey type from ${
isMultiPage
? 'multi page to single page'
: 'single page to multi page'
}.`,
},
{
text: 'You will lose all current progress if you do.',
bold: true,
},
{
text: 'Do you want to change this survey type?',
},
],
handleConfirm: () => {
setFormDefinition({
display: isMultiPage ? 'form' : 'wizard',
components: [],
});
},
],
handleConfirm: () => {
setFormDefinition({
display: isMultiPage ? 'form' : 'wizard',
components: [],
});
},
},
type: 'confirm',
}),
);
}}
/>
}
label="Multi-page"
/>
</FormGroup>
type: 'confirm',
}),
);
}}
/>
}
label="Multi-page"
/>
</FormGroup>
</Stack>
</Grid>
<Grid item xs={12}>
<FormBuilder handleFormChange={handleFormChange} savedForm={formDefinition} />
Expand Down
28 changes: 15 additions & 13 deletions met-web/src/components/survey/create/CreateOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,21 @@ export const CreateOptions = () => {
</Grid>
<Grid item xs={6}></Grid>
<Grid item xs={6}>
<FormGroup>
<FormControlLabel
control={
<Switch
checked={multiPageSurvey}
onChange={(e) => {
setMultiPageSurvey(!multiPageSurvey);
}}
/>
}
label="Multi-page"
/>
</FormGroup>
<Stack direction="row">
<FormGroup>
<FormControlLabel
control={
<Switch
checked={multiPageSurvey}
onChange={(e) => {
setMultiPageSurvey(!multiPageSurvey);
}}
/>
}
label="Multi-page"
/>
</FormGroup>
</Stack>
<MetDescription>
The multi-page option will enable you to add one, or many pages to a survey. It will also create a
progress bar. If you want to create a 1-page survey, turn off the multi-page toggle.
Expand Down

0 comments on commit 91031ef

Please sign in to comment.