diff --git a/frontend/src/component/project/Project/ProjectForm/ProjectForm.tsx b/frontend/src/component/project/Project/ProjectForm/ProjectForm.tsx index e6df250fea..e481572d4c 100644 --- a/frontend/src/component/project/Project/ProjectForm/ProjectForm.tsx +++ b/frontend/src/component/project/Project/ProjectForm/ProjectForm.tsx @@ -44,16 +44,10 @@ const PROJECT_NAME_INPUT = 'PROJECT_NAME_INPUT'; const PROJECT_DESCRIPTION_INPUT = 'PROJECT_DESCRIPTION_INPUT'; const StyledForm = styled('form')(({ theme }) => ({ - display: 'flex', - flexDirection: 'column', height: '100%', paddingBottom: theme.spacing(4), })); -const StyledContainer = styled('div')(() => ({ - maxWidth: '400px', -})); - const StyledDescription = styled('p')(({ theme }) => ({ marginBottom: theme.spacing(1), marginRight: theme.spacing(1), @@ -215,243 +209,234 @@ const ProjectForm: React.FC = ({ return ( - - What is your project Id? - setProjectId(trim(e.target.value))} - error={Boolean(errors.id)} - errorText={errors.id} - onFocus={() => clearErrors()} - onBlur={validateProjectId} - disabled={mode === 'Edit'} - data-testid={PROJECT_ID_INPUT} - autoFocus - required - /> + What is your project Id? + setProjectId(trim(e.target.value))} + error={Boolean(errors.id)} + errorText={errors.id} + onFocus={() => clearErrors()} + onBlur={validateProjectId} + disabled={mode === 'Edit'} + data-testid={PROJECT_ID_INPUT} + autoFocus + required + /> - - What is your project name? - - setProjectName(e.target.value)} - error={Boolean(errors.name)} - errorText={errors.name} - onFocus={() => { - delete errors.name; + What is your project name? + setProjectName(e.target.value)} + error={Boolean(errors.name)} + errorText={errors.name} + onFocus={() => { + delete errors.name; + }} + data-testid={PROJECT_NAME_INPUT} + required + /> + + + What is your project description? + + setProjectDesc(e.target.value)} + data-testid={PROJECT_DESCRIPTION_INPUT} + /> + + + + What is the default stickiness for the project? + + + setProjectStickiness && + setProjectStickiness(e.target.value) + } + editable + /> + + } + /> + <> + - - - What is your project description? - - setProjectDesc(e.target.value)} - data-testid={PROJECT_DESCRIPTION_INPUT} - /> - - - - What is the default stickiness for the project? - - - setProjectStickiness && - setProjectStickiness(e.target.value) - } - editable - /> - - } - /> - <> - -

What is your project collaboration mode?

- -
- { - setProjectMode?.(e.target.value as ProjectMode); - }} - options={[ - { key: 'open', label: 'open' }, - { key: 'protected', label: 'protected' }, - ]} - > - - <> - -

Feature flag limit?

- -
- - Leave it empty if you don’t want to add a limit - - - setFeatureLimit(e.target.value)} - /> - - ({featureCount} of {featureLimit} used) -
- } - /> - - - - - Feature flag naming pattern? - + > +

What is your project collaboration mode?

+ +
+ { + setProjectMode?.(e.target.value as ProjectMode); + }} + options={[ + { key: 'open', label: 'open' }, + { key: 'protected', label: 'protected' }, + ]} + > + + <> + +

Feature flag limit?

+ +
+ + Leave it empty if you don’t want to add a limit + + + setFeatureLimit(e.target.value)} + /> + + ({featureCount} of {featureLimit} used) + } + /> + + + + + Feature flag naming pattern? + + + + +

+ Define a{' '} + + JavaScript RegEx + {' '} + used to enforce feature flag names within + this project. The regex will be surrounded + by a leading ^ and a trailing{' '} + $. +

+

+ Leave it empty if you don’t want to add a + naming pattern. +

+
+
+ + + ^ + + ), + endAdornment: ( + + $ + + ), + }} + type={'text'} + value={featureNamingPattern || ''} + error={Boolean(errors.featureNamingPattern)} + errorText={errors.featureNamingPattern} + onChange={e => + onSetFeatureNamingPattern(e.target.value) + } + /> - -

- Define a{' '} - - JavaScript RegEx - {' '} - used to enforce feature flag names - within this project. The regex will be - surrounded by a leading ^{' '} - and a trailing $. -

-

- Leave it empty if you don’t want to add - a naming pattern. -

-
+

+ The example and description will be shown to + users when they create a new feature flag in + this project. +

- - - ^ - - ), - endAdornment: ( - - $ - - ), - }} - type={'text'} - value={featureNamingPattern || ''} - error={Boolean(errors.featureNamingPattern)} - errorText={errors.featureNamingPattern} - onChange={e => - onSetFeatureNamingPattern( - e.target.value - ) - } - /> - -

- The example and description will be - shown to users when they create a new - feature flag in this project. -

-
- - onSetFeatureNamingExample( - e.target.value - ) - } - /> - .. + + onSetFeatureNamingExample(e.target.value) + } + /> + .. The flag name should contain the project name, the feature name, and the ticket number, each separated by a dot.`} - multiline - minRows={5} - value={featureNamingDescription || ''} - onChange={e => - onSetFeatureNamingDescription( - e.target.value - ) - } - /> -
- - } - /> -
+ multiline + minRows={5} + value={featureNamingDescription || ''} + onChange={e => + onSetFeatureNamingDescription( + e.target.value + ) + } + /> + + + } + /> {children}
);