You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by mi...@apache.org on 2024/05/24 03:19:41 UTC
(incubator-devlake) branch fix-scope-config created (now e66f50420)
This is an automated email from the ASF dual-hosted git repository.
mintsweet pushed a change to branch fix-scope-config
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
at e66f50420 fix: don't show link scope config when a plugin doesn't have scope config
This branch includes the following new commits:
new e66f50420 fix: don't show link scope config when a plugin doesn't have scope config
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(incubator-devlake) 01/01: fix: don't show link scope config when a plugin doesn't have scope config
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mintsweet pushed a commit to branch fix-scope-config
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit e66f504206ca6ed73b5680f0ef9f992ddf790743
Author: mintsweet <0x...@gmail.com>
AuthorDate: Fri May 24 15:19:26 2024 +1200
fix: don't show link scope config when a plugin doesn't have scope config
---
.../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 />}