diff --git a/.storybook/main.js b/.storybook/main.js index 92f3924d6b..f4f05dbe48 100644 --- a/.storybook/main.js +++ b/.storybook/main.js @@ -84,6 +84,18 @@ const config = { }, }, ].filter(Boolean), + }, + // .ejs + { + test: /\.ejs$/, + exclude: /node_modules/, + loader: 'ejs-loader', + options: { + variable: 'ctx', + evaluate: /\{%([\s\S]+?)%\}/g, + interpolate: /\{\{([\s\S]+?)\}\}/g, + escape: /\{\{\{([\s\S]+?)\}\}\}/g, + }, } ); return config; diff --git a/.storybook/preview-body.html b/.storybook/preview-body.html new file mode 100644 index 0000000000..9e93366a39 --- /dev/null +++ b/.storybook/preview-body.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/openforms/js/components/admin/form_design/FormDetailFields.stories.js b/src/openforms/js/components/admin/form_design/FormDetailFields.stories.js index ffc0e38142..ce22e2f82c 100644 --- a/src/openforms/js/components/admin/form_design/FormDetailFields.stories.js +++ b/src/openforms/js/components/admin/form_design/FormDetailFields.stories.js @@ -1,6 +1,6 @@ import {fn} from '@storybook/test'; -import {FormDecorator, TinyMceDecorator} from 'components/admin/form_design/story-decorators'; +import {FormDecorator} from 'components/admin/form_design/story-decorators'; import FormDetailFields from './FormDetailFields'; diff --git a/src/openforms/js/components/admin/form_design/StepsFieldSet.stories.js b/src/openforms/js/components/admin/form_design/StepsFieldSet.stories.js new file mode 100644 index 0000000000..d59c2d488a --- /dev/null +++ b/src/openforms/js/components/admin/form_design/StepsFieldSet.stories.js @@ -0,0 +1,65 @@ +import {fn} from '@storybook/test'; + +import { + AdminChangeFormDecorator, + FormDecorator, +} from 'components/admin/form_design/story-decorators'; + +import {StepsFieldSet} from './form-creation-form'; + +export default { + title: 'Form design / Tabs / Steps', + decorators: [FormDecorator, AdminChangeFormDecorator], + component: StepsFieldSet, + args: { + submitting: false, + loadingErrors: '', + steps: [ + { + configuration: { + display: 'form', + components: [], + }, + formDefinition: '', + index: 0, + name: 'Step 1', + internalName: '', + slug: 'step-1', + isApplicable: true, + loginRequired: false, + isReusable: false, + url: '', + isNew: false, + validationErrors: [], + translations: { + nl: { + name: 'Stap 1', + saveText: '', + previousText: '', + nextText: '', + }, + en: { + name: 'Step 1', + saveText: '', + previousText: '', + nextText: '', + }, + }, + }, + ], + onEdit: fn(), + onComponentMutated: fn(), + onFieldChange: fn(), + onDelete: fn(), + onReorder: fn(), + onReplace: fn(), + onAdd: fn(), + }, + parameters: { + adminChangeForm: { + wrapFieldset: true, + }, + }, +}; + +export const Default = {}; diff --git a/src/openforms/js/components/admin/form_design/form-creation-form.js b/src/openforms/js/components/admin/form_design/form-creation-form.js index 3adb06d2f8..3ba4f3ba7c 100644 --- a/src/openforms/js/components/admin/form_design/form-creation-form.js +++ b/src/openforms/js/components/admin/form_design/form-creation-form.js @@ -873,7 +873,7 @@ function reducer(draft, action) { } } -const StepsFieldSet = ({submitting = false, loadingErrors, steps = [], ...props}) => { +export const StepsFieldSet = ({submitting = false, loadingErrors, steps = [], ...props}) => { if (loadingErrors) { return
{loadingErrors}
; }