From d5edcc33e6d782fc9785fb27bb1b2ff440405fba Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Tue, 5 Sep 2023 11:22:52 +0200 Subject: [PATCH] add descriptions in form (#4608) This PR adds descriptions of the various feature flag naming input fields in the project settings form. It also wraps the feature naming fields in a fieldset to group them semantically. ![image](https://github.com/Unleash/unleash/assets/17786332/a8d5c2c6-3381-4b76-89a1-18316c2e5193) --- .../Project/ProjectForm/ProjectForm.tsx | 53 ++++++++++++++++--- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/frontend/src/component/project/Project/ProjectForm/ProjectForm.tsx b/frontend/src/component/project/Project/ProjectForm/ProjectForm.tsx index 77f83897b91b..15ce22ed4d6a 100644 --- a/frontend/src/component/project/Project/ProjectForm/ProjectForm.tsx +++ b/frontend/src/component/project/Project/ProjectForm/ProjectForm.tsx @@ -75,6 +75,11 @@ const StyledTextField = styled(TextField)(({ theme }) => ({ marginBottom: theme.spacing(2), })); +const StyledFieldset = styled('fieldset')(() => ({ + padding: 0, + border: 'none', +})); + const StyledSelect = styled(Select)(({ theme }) => ({ marginBottom: theme.spacing(2), minWidth: '200px', @@ -91,6 +96,14 @@ const StyledInputContainer = styled('div')(() => ({ alignItems: 'center', })); +const StyledFlagNamingContainer = styled('div')(({ theme }) => ({ + display: 'flex', + flexDirection: 'column', + alignItems: 'flex-start', + mt: theme.spacing(1), + '& > *': { width: '100%' }, +})); + const ProjectForm: React.FC = ({ children, handleSubmit, @@ -276,7 +289,7 @@ const ProjectForm: React.FC = ({ setFeatureNamingExample != null } show={ - <> + = ({ gap: 1, }} > -

Feature flag naming pattern?

+ Feature flag naming pattern?
- Leave it empty if you don’t want to add a naming - pattern +

+ A feature flag naming pattern is a{' '} + + JavaScript RegEx + {' '} + used to enforce feature flag names within + this project. +

+

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

- + = ({ ) } /> + +

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

+
+ @@ -320,8 +359,8 @@ const ProjectForm: React.FC = ({ ) } /> -
- + +
} />