CreateImageWizard: move name image step to end

The Details step is renamed to Name Image and moved to the last step
before Review. Also, the validation is removed since all utf-8
characters are supported for image names.
This commit is contained in:
Jacob Kozol 2022-04-13 15:24:59 +02:00 committed by Sanne Raymaekers
parent 3a74c564de
commit 2f5f6dcc46
6 changed files with 74 additions and 86 deletions

View file

@ -1,35 +0,0 @@
import React from 'react';
import componentTypes from '@data-driven-forms/react-form-renderer/component-types';
import validatorTypes from '@data-driven-forms/react-form-renderer/validator-types';
import StepTemplate from './stepTemplate';
export default {
StepTemplate,
id: 'wizard-details',
name: 'details',
title: 'Details',
nextStep: 'image-output',
fields: [
{
component: componentTypes.PLAIN_TEXT,
name: 'plain-text-component',
label: <p>
Enter a name to easily identify your image later. If left empty, the image&apos;s UUID will be displayed.
</p>
},
{
component: componentTypes.TEXT_FIELD,
name: 'image-name',
type: 'text',
label: 'Image name',
autoFocus: true,
validate: [
{
type: validatorTypes.PATTERN,
pattern: /^[\w-]+$/i,
message: 'Can only contain letters, numbers, hyphens (-), and underscores (_)',
}
]
}
]
};

View file

@ -0,0 +1,25 @@
import React from 'react';
import componentTypes from '@data-driven-forms/react-form-renderer/component-types';
import StepTemplate from './stepTemplate';
export default {
StepTemplate,
id: 'wizard-details',
name: 'image-name',
title: 'Name image',
nextStep: 'review',
fields: [
{
component: componentTypes.PLAIN_TEXT,
name: 'plain-text-component',
label: <p>Optionally enter a name for your image. All images will have a UUID.</p>
},
{
component: componentTypes.TEXT_FIELD,
name: 'image-name',
type: 'text',
label: 'Image name',
autoFocus: true,
}
]
};

View file

@ -7,4 +7,4 @@ export { default as review } from './review';
export { default as imageOutput } from './imageOutput';
export { default as nextStepMapper } from './imageOutputStepMapper';
export { default as fileSystemConfiguration } from './fileSystemConfiguration';
export { default as details } from './details';
export { default as imageName } from './imageName';

View file

@ -9,7 +9,7 @@ export default {
title: 'Packages',
name: 'packages',
substepOf: 'System Configuration',
nextStep: 'review',
nextStep: 'image-name',
fields: [
{
component: componentTypes.PLAIN_TEXT,