Skip to content

Commit 43bf20c

Browse files
authored
fix: don't show link action when a plugin doesn't have scope config (#7506)
1 parent c113653 commit 43bf20c

File tree

1 file changed

+14
-9
lines changed
  • config-ui/src/plugins/components/scope-config

1 file changed

+14
-9
lines changed

config-ui/src/plugins/components/scope-config/index.tsx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import styled from 'styled-components';
2424
import API from '@/api';
2525
import { IconButton, Message } from '@/components';
2626
import { PATHS } from '@/config';
27+
import { getPluginConfig } from '@/plugins';
2728
import { operator } from '@/utils';
2829

2930
import { PluginName } from '../plugin-name';
@@ -59,6 +60,8 @@ export const ScopeConfig = ({
5960

6061
const [operating, setOperating] = useState(false);
6162

63+
const pluginConfig = getPluginConfig(plugin);
64+
6265
const {
6366
token: { colorPrimary },
6467
} = theme.useToken();
@@ -197,15 +200,17 @@ export const ScopeConfig = ({
197200
<Wrapper>
198201
{contextHolder}
199202
<span>{scopeConfigId ? scopeConfigName : 'N/A'}</span>
200-
<IconButton
201-
icon={<LinkOutlined />}
202-
helptip="Associate Scope Config"
203-
size="small"
204-
type="link"
205-
onClick={() => {
206-
setType('associate');
207-
}}
208-
/>
203+
{pluginConfig.scopeConfig && (
204+
<IconButton
205+
icon={<LinkOutlined />}
206+
helptip="Associate Scope Config"
207+
size="small"
208+
type="link"
209+
onClick={() => {
210+
setType('associate');
211+
}}
212+
/>
213+
)}
209214
{scopeConfigId && (
210215
<IconButton
211216
icon={<EditOutlined />}

0 commit comments

Comments
 (0)