Commit 5796a7c authored Oct 1, 2024 · 12 / 21 · Verified
1 parent afcc71b commit 5796a7c Copy full SHA for 5796a7c
File tree 2 files changed +13
-9
lines changed
ui/src/app/settings/components
2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ export const RepoDetails = (props: {repo: models.Repository; save?: (params: New
17
17
title : 'Repository URL' ,
18
18
view : repository . repo
19
19
} ,
20
+ {
21
+ title : 'Name' ,
22
+ view : repository . name || '' ,
23
+ edit : ( formApi : FormApi ) => < FormField formApi = { formApi } field = 'name' component = { Text } />
24
+ } ,
20
25
{
21
26
title : 'Username (optional)' ,
22
27
view : repository . username || '' ,
@@ -29,13 +34,6 @@ export const RepoDetails = (props: {repo: models.Repository; save?: (params: New
29
34
}
30
35
] ;
31
36
32
- if ( repository . name ) {
33
- items . splice ( 1 , 0 , {
34
- title : 'NAME' ,
35
- view : repository . name
36
- } ) ;
37
- }
38
-
39
37
if ( repository . project ) {
40
38
items . splice ( repository . name ? 2 : 1 , 0 , {
41
39
title : 'Project' ,
@@ -86,6 +84,7 @@ export const RepoDetails = (props: {repo: models.Repository; save?: (params: New
86
84
} ) }
87
85
save = { async input => {
88
86
const params : NewHTTPSRepoParams = { ...newRepo } ;
87
+ params . name = input . name || '' ;
89
88
params . username = input . username || '' ;
90
89
params . password = input . password || '' ;
91
90
save ( params ) ;
Original file line number Diff line number Diff line change @@ -470,9 +470,14 @@ export class ReposList extends React.Component<
470
470
< div className = 'argo-form-row' >
471
471
< FormField formApi = { formApi } label = 'Type' field = 'type' component = { FormSelect } componentProps = { { options : [ 'git' , 'helm' ] } } />
472
472
</ div >
473
- { formApi . getFormState ( ) . values . type === 'helm' && (
473
+ { ( formApi . getFormState ( ) . values . type === 'helm' || formApi . getFormState ( ) . values . type === 'git' ) && (
474
474
< div className = 'argo-form-row' >
475
- < FormField formApi = { formApi } label = 'Name' field = 'name' component = { Text } />
475
+ < FormField
476
+ formApi = { formApi }
477
+ label = { `Name ${ formApi . getFormState ( ) . values . type === 'git' ? '(optional)' : '' } ` }
478
+ field = 'name'
479
+ component = { Text }
480
+ />
476
481
</ div >
477
482
) }
478
483
< div className = 'argo-form-row' >
You can’t perform that action at this time.
0 commit comments