11import React from "react" ;
2- import { Grid , Select , MenuItem , Button } from "@material-ui/core" ;
2+ import { Grid , Select , MenuItem , Button , TextField } from "@material-ui/core" ;
33import { testVariationService } from "../services" ;
44import { useHistory } from "react-router-dom" ;
55import {
@@ -21,12 +21,13 @@ export const TestVariationMergeForm: React.FunctionComponent<IProps> = ({
2121 const history = useHistory ( ) ;
2222 const buildDispatch = useBuildDispatch ( ) ;
2323 const { enqueueSnackbar } = useSnackbar ( ) ;
24- const [ branch , setBranch ] = React . useState ( "" ) ;
24+ const [ fromBranch , setFromBranch ] = React . useState ( "" ) ;
25+ const [ toBranch , setToBranch ] = React . useState ( "" ) ;
2526
2627 const handleSubmit = ( event : React . FormEvent ) => {
2728 event . preventDefault ( ) ;
2829 testVariationService
29- . merge ( projectId , branch )
30+ . merge ( projectId , fromBranch , toBranch )
3031 . then ( ( build ) => {
3132 enqueueSnackbar ( `Merge started in build: ${ build . id } ` , {
3233 variant : "success" ,
@@ -50,11 +51,11 @@ export const TestVariationMergeForm: React.FunctionComponent<IProps> = ({
5051 < Grid item >
5152 < Select
5253 displayEmpty
53- value = { branch }
54- onChange = { ( event ) => setBranch ( event . target . value as string ) }
54+ value = { fromBranch }
55+ onChange = { ( event ) => setFromBranch ( event . target . value as string ) }
5556 >
5657 < MenuItem value = "" >
57- < em > Select branch</ em >
58+ < em > From branch</ em >
5859 </ MenuItem >
5960 { items . map ( ( i ) => (
6061 < MenuItem key = { i } value = { i } >
@@ -63,6 +64,23 @@ export const TestVariationMergeForm: React.FunctionComponent<IProps> = ({
6364 ) ) }
6465 </ Select >
6566 </ Grid >
67+ < Grid item >
68+ < TextField
69+ id = "toBranch"
70+ name = "toBranch"
71+ value = { toBranch }
72+ label = { "To Branch" }
73+ type = "text"
74+ variant = "outlined"
75+ required
76+ fullWidth
77+ inputProps = { {
78+ onChange : ( event : any ) =>
79+ setToBranch ( ( event . target as HTMLInputElement ) . value ) ,
80+ "data-testid" : "toBranch" ,
81+ } }
82+ />
83+ </ Grid >
6684 < Grid item >
6785 < Button type = "submit" color = "primary" variant = "contained" >
6886 Merge
0 commit comments