File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,26 @@ export const ProjectForm: React.FunctionComponent = () => {
9494 } ) ;
9595 } }
9696 />
97+ < TextValidator
98+ name = "maxBranchLifetime"
99+ validators = { [ "minNumber:1" ] }
100+ errorMessages = { [ "Enter greater than 1" ] }
101+ InputProps = { { inputProps : { min : 1 , step : 1 } } }
102+ margin = "dense"
103+ id = "maxBranchLifetime"
104+ label = "Max branch lifetime (days)"
105+ type = "number"
106+ fullWidth
107+ required
108+ value = { project . maxBranchLifetime }
109+ onChange = { ( event ) => {
110+ const value = ( event . target as HTMLInputElement ) . value ;
111+ setProjectEditState ( projectDispatch , {
112+ ...project ,
113+ maxBranchLifetime : parseInt ( value ) ,
114+ } ) ;
115+ } }
116+ />
97117 < FormControlLabel
98118 label = "Auto approve feature"
99119 control = {
Original file line number Diff line number Diff line change @@ -16,4 +16,5 @@ export const DEFAULT_PROJECT_EDIT_STATE: ProjectDto = {
1616 imageComparison : ImageComparison . pixelmatch ,
1717 imageComparisonConfig : PIXELMATCH_DEFAULT_CONFIG ,
1818 maxBuildAllowed : 100 ,
19+ maxBranchLifetime : 30 ,
1920} ;
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export interface Project {
1212 imageComparison : ImageComparison ;
1313 imageComparisonConfig : string ;
1414 maxBuildAllowed : number ;
15+ maxBranchLifetime : number ;
1516}
1617
1718export type ProjectDto = Omit < Project , "updatedAt" | "createdAt" | "builds" > ;
You can’t perform that action at this time.
0 commit comments