@@ -51,6 +51,7 @@ interface AddHubFormData {
51
51
sshPublicKey ?: string ;
52
52
sshPrivateKey ?: string ;
53
53
token ?: string ;
54
+ remoteHub : string ;
54
55
}
55
56
interface StepData {
56
57
value ?: AddHubFormData ;
@@ -78,7 +79,8 @@ export const initialValues: AddHubFormData = {
78
79
repoBranch : '' ,
79
80
repoURL : '' ,
80
81
isPrivate : false ,
81
- authType : AuthType . NONE
82
+ authType : AuthType . NONE ,
83
+ remoteHub : ''
82
84
} ;
83
85
84
86
const OverviewStep : React . FC < StepProps < StepData > > = props => {
@@ -160,6 +162,7 @@ const GitConnectionStep: React.FC<
160
162
// name: values.name,
161
163
isPrivate : values . isPrivate ,
162
164
repoURL : values . repoURL ,
165
+ remoteHub : values . remoteHub ,
163
166
authType : values . authType ,
164
167
token : values . token ,
165
168
sshPublicKey : values . sshPublicKey ,
@@ -174,6 +177,7 @@ const GitConnectionStep: React.FC<
174
177
description : formData . description ,
175
178
tags : formData . tags ,
176
179
repoURL : values . repoURL ,
180
+ remoteHub : values . remoteHub ,
177
181
authType : values . authType ,
178
182
isPrivate : values . isPrivate ,
179
183
token : values . token ,
@@ -188,7 +192,8 @@ const GitConnectionStep: React.FC<
188
192
} }
189
193
validationSchema = { Yup . object ( ) . shape ( {
190
194
repoBranch : Yup . string ( ) . trim ( ) . required ( 'Hub Branch name is a required field' ) ,
191
- repoURL : Yup . string ( ) . trim ( ) . required ( 'Hub Repo name is a required field' )
195
+ repoURL : Yup . string ( ) . trim ( ) . required ( 'Hub Repo name is a required field' ) ,
196
+ remoteHub : Yup . string ( ) . trim ( ) . required ( 'Remote Hub name is a required field' )
192
197
} ) }
193
198
>
194
199
{ formikProps => {
@@ -231,6 +236,22 @@ const GitConnectionStep: React.FC<
231
236
placeholder = { getString ( 'enterHubRepositoryBranch' ) }
232
237
/>
233
238
239
+ < FormInput . DropDown
240
+ name = "remoteHub"
241
+ label = { < Text font = { { variation : FontVariation . FORM_LABEL } } > Remote Hub</ Text > }
242
+ placeholder = { getString ( 'remoteHub' ) }
243
+ items = { [
244
+ { label : 'GitHub' , value : 'GitHub' } ,
245
+ { label : 'Bitbucket' , value : 'Bitbucket' } ,
246
+ { label : 'Azure Repo' , value : 'Azure Repo' } ,
247
+ { label : 'GitLab' , value : 'GitLab' } ,
248
+ { label : 'Others' , value : 'Others' }
249
+ ] }
250
+ onChange = { item => {
251
+ formikProps . setFieldValue ( 'remoteHub' , item . value ) ;
252
+ } }
253
+ />
254
+
234
255
{ formikProps . values . isPrivate && (
235
256
< RadioButtonGroup
236
257
name = "type"
@@ -350,7 +371,8 @@ export default function AddHubModalWizardView({
350
371
repoBranch : '' ,
351
372
repoURL : '' ,
352
373
isPrivate : false ,
353
- authType : AuthType . NONE
374
+ authType : AuthType . NONE ,
375
+ remoteHub : ''
354
376
} ) ;
355
377
356
378
return (
0 commit comments