You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by ab...@apache.org on 2024/05/24 03:22:33 UTC

(incubator-devlake) branch main updated: fix: don't show link action when a plugin doesn't have scope config (#7506)

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

abeizn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 43bf20c0d fix: don't show link action when a plugin doesn't have scope config (#7506)
43bf20c0d is described below

commit 43bf20c0dc98833c72300155ffc59de5d3932a44
Author: 青湛 <0x...@gmail.com>
AuthorDate: Fri May 24 15:22:28 2024 +1200

    fix: don't show link action when a plugin doesn't have scope config (#7506)
---
 .../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 />}