Skip to content

Commit

Permalink
fix: don't show link action when a plugin doesn't have scope config (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsweet committed May 24, 2024
1 parent c113653 commit 43bf20c
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions config-ui/src/plugins/components/scope-config/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -59,6 +60,8 @@ export const ScopeConfig = ({

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

const pluginConfig = getPluginConfig(plugin);

const {
token: { colorPrimary },
} = theme.useToken();
Expand Down Expand Up @@ -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 />}
Expand Down

0 comments on commit 43bf20c

Please sign in to comment.