This is an automated email from the ASF dual-hosted git repository.

mintsweet pushed a commit to branch feat-dora-config
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit 82b5abac3a0c6a5a03af93e5c4461056a3332b30
Author: mintsweet <0x1304...@gmail.com>
AuthorDate: Fri Sep 13 20:50:44 2024 +1200

    feat: adjust the github transformation cicd style
---
 .../src/plugins/register/github/transformation.tsx | 76 ++++++++++++----------
 1 file changed, 40 insertions(+), 36 deletions(-)

diff --git a/config-ui/src/plugins/register/github/transformation.tsx 
b/config-ui/src/plugins/register/github/transformation.tsx
index fa6e05290..d8ec7cae1 100644
--- a/config-ui/src/plugins/register/github/transformation.tsx
+++ b/config-ui/src/plugins/register/github/transformation.tsx
@@ -273,42 +273,46 @@ const renderCollapseItems = ({
           <Checkbox checked={useCustom} onChange={onChangeUseCustom}>
             Convert a GitHub workflow run as a DevLake Deployment when:
           </Checkbox>
-          <div style={{ margin: '8px 0', paddingLeft: 28 }}>
-            <span>
-              The name of the <strong>GitHub workflow run</strong> or <strong> 
one of its jobs</strong> matches
-            </span>
-            <Input
-              style={{ width: 180, margin: '0 8px' }}
-              placeholder="(deploy|push-image)"
-              value={transformation.deploymentPattern ?? ''}
-              onChange={(e) =>
-                onChangeTransformation({
-                  ...transformation,
-                  deploymentPattern: e.target.value,
-                  productionPattern: !e.target.value ? '' : 
transformation.productionPattern,
-                })
-              }
-            />
-            <i style={{ marginRight: 4, color: '#E34040' }}>*</i>
-            <HelpTooltip content="GitHub Workflow Runs: 
https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow";
 />
-          </div>
-          <div style={{ margin: '8px 0', paddingLeft: 28 }}>
-            <span>If the name or its branch’s name also matches</span>
-            <Input
-              style={{ width: 180, margin: '0 8px' }}
-              placeholder="prod(.*)"
-              value={transformation.productionPattern ?? ''}
-              onChange={(e) =>
-                onChangeTransformation({
-                  ...transformation,
-                  productionPattern: e.target.value,
-                })
-              }
-            />
-            <span>, this deployment is a ‘Production Deployment’</span>
-            <HelpTooltip content="If you leave this field empty, all 
Deployments will be tagged as in the Production environment. " />
-          </div>
-          <CheckMatchedItems plugin={plugin} connectionId={connectionId} 
transformation={transformation} />
+          {useCustom && (
+            <>
+              <div style={{ margin: '8px 0', paddingLeft: 28 }}>
+                <span>
+                  The name of the <strong>GitHub workflow run</strong> or 
<strong> one of its jobs</strong> matches
+                </span>
+                <Input
+                  style={{ width: 180, margin: '0 8px' }}
+                  placeholder="(deploy|push-image)"
+                  value={transformation.deploymentPattern ?? ''}
+                  onChange={(e) =>
+                    onChangeTransformation({
+                      ...transformation,
+                      deploymentPattern: e.target.value,
+                      productionPattern: !e.target.value ? '' : 
transformation.productionPattern,
+                    })
+                  }
+                />
+                <i style={{ marginRight: 4, color: '#E34040' }}>*</i>
+                <HelpTooltip content="GitHub Workflow Runs: 
https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow";
 />
+              </div>
+              <div style={{ margin: '8px 0', paddingLeft: 28 }}>
+                <span>If the name or its branch’s name also matches</span>
+                <Input
+                  style={{ width: 180, margin: '0 8px' }}
+                  placeholder="prod(.*)"
+                  value={transformation.productionPattern ?? ''}
+                  onChange={(e) =>
+                    onChangeTransformation({
+                      ...transformation,
+                      productionPattern: e.target.value,
+                    })
+                  }
+                />
+                <span>, this deployment is a ‘Production Deployment’</span>
+                <HelpTooltip content="If you leave this field empty, all 
Deployments will be tagged as in the Production environment. " />
+              </div>
+              <CheckMatchedItems plugin={plugin} connectionId={connectionId} 
transformation={transformation} />
+            </>
+          )}
         </>
       ),
     },

Reply via email to