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

mintsweet pushed a commit to branch release-v1.0
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/release-v1.0 by this push:
     new e6e1e11c0 fix: don't show link action when a plugin doesn't have scope 
config (#7506) (#7507)
e6e1e11c0 is described below

commit e6e1e11c0f21379646d476b16bcfd833c09a88e8
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri May 24 15:24:14 2024 +1200

    fix: don't show link action when a plugin doesn't have scope config (#7506) 
(#7507)
    
    Co-authored-by: 青湛 <[email protected]>
---
 .../src/plugins/components/scope-config/index.tsx  | 23 +++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/config-ui/src/plugins/components/scope-config/index.tsx 
b/config-ui/src/plugins/components/scope-config/index.tsx
index 8c3c6fe71..18055db7b 100644
--- a/config-ui/src/plugins/components/scope-config/index.tsx
+++ b/config-ui/src/plugins/components/scope-config/index.tsx
@@ -24,6 +24,7 @@ import styled from 'styled-components';
 import API from '@/api';
 import { IconButton, Message } from '@/components';
 import { PATHS } from '@/config';
+import { getPluginConfig } from '@/plugins';
 import { operator } from '@/utils';
 
 import { PluginName } from '../plugin-name';
@@ -59,6 +60,8 @@ export const ScopeConfig = ({
 
   const [operating, setOperating] = useState(false);
 
+  const pluginConfig = getPluginConfig(plugin);
+
   const {
     token: { colorPrimary },
   } = theme.useToken();
@@ -197,15 +200,17 @@ export const ScopeConfig = ({
     <Wrapper>
       {contextHolder}
       <span>{scopeConfigId ? scopeConfigName : 'N/A'}</span>
-      <IconButton
-        icon={<LinkOutlined />}
-        helptip="Associate Scope Config"
-        size="small"
-        type="link"
-        onClick={() => {
-          setType('associate');
-        }}
-      />
+      {pluginConfig.scopeConfig && (
+        <IconButton
+          icon={<LinkOutlined />}
+          helptip="Associate Scope Config"
+          size="small"
+          type="link"
+          onClick={() => {
+            setType('associate');
+          }}
+        />
+      )}
       {scopeConfigId && (
         <IconButton
           icon={<EditOutlined />}

Reply via email to