11import { StandardForm } from 'tg.component/common/form/StandardForm' ;
22import { components } from 'tg.service/apiSchema.generated' ;
33import React , { FC } from 'react' ;
4- import { Box } from '@mui/material' ;
4+ import { Box , styled } from '@mui/material' ;
55import { TextField } from 'tg.component/common/form/fields/TextField' ;
66import { FieldLabel } from 'tg.component/FormField' ;
77import { T , useTranslate } from '@tolgee/react' ;
88import { Validation } from 'tg.constants/GlobalValidationSchema' ;
99import { BranchSelectField } from 'tg.component/branching/BranchSelectField' ;
10+ import { LabelHint } from 'tg.component/common/LabelHint' ;
1011
1112type BranchModel = components [ 'schemas' ] [ 'BranchModel' ] ;
1213
@@ -15,6 +16,13 @@ export type BranchFormValues = {
1516 originBranchId : number ;
1617} ;
1718
19+ const StyledHint = styled ( Box ) `
20+ ul {
21+ margin: 0;
22+ padding-left: 16px;
23+ }
24+ ` ;
25+
1826export const BranchForm : FC < {
1927 branch ?: BranchModel ;
2028 defaultBranch ?: BranchModel ;
@@ -44,7 +52,20 @@ export const BranchForm: FC<{
4452 < Box display = "flex" mb = { 2 } >
4553 < Box display = "grid" flexGrow = { 1 } >
4654 < FieldLabel >
47- < T keyName = "project_branch_name" />
55+ < Box display = "flex" alignItems = "center" gap = { 1 } >
56+ < LabelHint
57+ title = {
58+ < StyledHint >
59+ < T
60+ keyName = "branch_name_rules"
61+ params = { { ul : < ul /> , li : < li /> } }
62+ />
63+ </ StyledHint >
64+ }
65+ >
66+ < T keyName = "project_branch_name" />
67+ </ LabelHint >
68+ </ Box >
4869 </ FieldLabel >
4970 < TextField size = "small" name = "name" required = { true } />
5071 </ Box >
0 commit comments