File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,35 @@ export const ProjectForm: React.FunctionComponent = () => {
130130 } ) ;
131131 } }
132132 />
133+ < TextValidator
134+ name = "protectedBranch"
135+ validators = { project . protectedBranch ? [ "minStringLength:2" ] : [ ] }
136+ errorMessages = { [ "Enter at least two characters." ] }
137+ margin = "dense"
138+ id = "protectedBranch"
139+ label = "Protected branch"
140+ type = "text"
141+ fullWidth
142+ helperText = {
143+ < >
144+ PostgreSQL{ " " }
145+ < a
146+ target = "_blank"
147+ rel = "noreferrer"
148+ href = "https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-SIMILARTO-REGEXP"
149+ >
150+ SIMILAR TO Regular Expression
151+ </ a >
152+ </ >
153+ }
154+ value = { project . protectedBranch || "" }
155+ onChange = { ( event : React . ChangeEvent < HTMLInputElement > ) =>
156+ setProjectEditState ( projectDispatch , {
157+ ...project ,
158+ protectedBranch : event . target . value ,
159+ } )
160+ }
161+ />
133162 < FormControlLabel
134163 label = "Auto approve feature"
135164 control = {
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export interface Project {
1313 imageComparisonConfig : string ;
1414 maxBuildAllowed : number ;
1515 maxBranchLifetime : number ;
16+ protectedBranch ?: string ;
1617}
1718
1819export type ProjectDto = Omit < Project , "updatedAt" | "createdAt" | "builds" > ;
You can’t perform that action at this time.
0 commit comments