File tree Expand file tree Collapse file tree 4 files changed +20
-20
lines changed
src/components/app/details/triggerView Expand file tree Collapse file tree 4 files changed +20
-20
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ import { getGitProviderIcon } from '@Components/common'
38
38
import { REQUIRED_FIELD_MSG } from '../../../../config/constantMessaging'
39
39
import { BRANCH_REGEX_MODAL_MESSAGING } from './Constants'
40
40
import { BranchRegexModalProps , RegexValueType } from './types'
41
+ import { getInitialRegexValue } from './utils'
41
42
42
43
const renderRegexInfo = ( ) => (
43
44
< InfoBlock
@@ -65,19 +66,8 @@ const BranchRegexModal = ({
65
66
workflowId,
66
67
handleReload,
67
68
} : BranchRegexModalProps ) => {
68
- const getInitialRegexValue = ( ) => {
69
- const initialValue : Record < number , RegexValueType > = { }
70
- material . forEach ( ( mat ) => {
71
- initialValue [ mat . gitMaterialId ] = {
72
- value : mat . value ,
73
- isInvalid : mat . regex && ! new RegExp ( mat . regex ) . test ( mat . value ) ,
74
- }
75
- } )
76
- return initialValue
77
- }
78
-
79
69
const [ isSavingRegexValue , setIsSavingRegexValue ] = useState ( false )
80
- const [ regexValue , setRegexValue ] = useState < Record < number , RegexValueType > > ( getInitialRegexValue )
70
+ const [ regexValue , setRegexValue ] = useState < Record < number , RegexValueType > > ( getInitialRegexValue ( material ) )
81
71
82
72
const isRegexValueInvalid = ( _cm ) : void => {
83
73
const regExp = new RegExp ( _cm . source . regex )
Original file line number Diff line number Diff line change @@ -37,8 +37,7 @@ const BuildImageHeader = ({
37
37
</ div >
38
38
) : (
39
39
< h2 className = "m-0 fs-16 fw-6 lh-24 cn-9 dc__truncate" >
40
- { isJobView ? 'Job Pipeline' : 'Build Pipeline' } { ' ' }
41
- { pipelineName && ! isBulkTrigger ? `'${ pipelineName } '` : '' }
40
+ { `${ isJobView ? 'Job' : 'Build' } Pipeline ${ pipelineName && ! isBulkTrigger ? `'${ pipelineName } '` : '' } ` }
42
41
</ h2 >
43
42
) }
44
43
Original file line number Diff line number Diff line change @@ -107,12 +107,12 @@ const BulkBuildImageModal = ({
107
107
initialDataAbortControllerRef ,
108
108
)
109
109
110
- setNumberOfAppsLoading ( validWorkflows . length )
111
-
112
110
if ( ciMaterialPromiseList . length === 0 ) {
113
111
return [ ]
114
112
}
115
113
114
+ setNumberOfAppsLoading ( validWorkflows . length )
115
+
116
116
const ciMaterialList =
117
117
await ApiQueuingWithBatch < Awaited < ReturnType < typeof getCIMaterials > > > ( ciMaterialPromiseList )
118
118
const runtimeParamsList = await ApiQueuingWithBatch < RuntimePluginVariables [ ] > ( runtimeParamsPromiseList )
@@ -456,10 +456,7 @@ const BulkBuildImageModal = ({
456
456
className = "flexbox-col dc__content-space h-100 bg__modal--primary shadow__modal dc__overflow-auto bulk-ci-trigger-container"
457
457
onClick = { stopPropagation }
458
458
>
459
- < div
460
- className = "flexbox-col dc__content-space h-100 bg__modal--primary shadow__modal dc__overflow-auto bulk-ci-trigger"
461
- onClick = { stopPropagation }
462
- >
459
+ < div className = "flexbox-col dc__content-space h-100 dc__overflow-auto bulk-ci-trigger" >
463
460
< div className = "flexbox-col dc__overflow-auto flex-grow-1" >
464
461
< BuildImageHeader
465
462
showWebhookModal = { showWebhookModal }
Original file line number Diff line number Diff line change
1
+ import { CIMaterialType } from '@devtron-labs/devtron-fe-common-lib'
2
+
3
+ import { RegexValueType } from './types'
4
+
5
+ export const getInitialRegexValue = ( materials : CIMaterialType [ ] ) => {
6
+ const initialValue : Record < number , RegexValueType > = { }
7
+ materials . forEach ( ( mat ) => {
8
+ initialValue [ mat . gitMaterialId ] = {
9
+ value : mat . value ,
10
+ isInvalid : mat . regex && ! new RegExp ( mat . regex ) . test ( mat . value ) ,
11
+ }
12
+ } )
13
+ return initialValue
14
+ }
You can’t perform that action at this time.
0 commit comments