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 2023/12/28 06:33:19 UTC
(incubator-devlake) 01/04: fix(config-ui): adjust the style and disable logic for bp
This is an automated email from the ASF dual-hosted git repository.
mintsweet pushed a commit to branch fix-bugs
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit 92e1bcc9d98f8d908ac6cdd2e056f6c450df990e
Author: mintsweet <0x...@gmail.com>
AuthorDate: Thu Dec 28 19:01:21 2023 +1300
fix(config-ui): adjust the style and disable logic for bp
---
.../pages/blueprint/detail/configuration-panel.tsx | 14 +++-----
.../src/pages/blueprint/detail/status-panel.tsx | 41 ++++++++++++----------
config-ui/src/pages/blueprint/detail/styled.ts | 6 ----
3 files changed, 28 insertions(+), 33 deletions(-)
diff --git a/config-ui/src/pages/blueprint/detail/configuration-panel.tsx b/config-ui/src/pages/blueprint/detail/configuration-panel.tsx
index a8360de1f..363b8ae35 100644
--- a/config-ui/src/pages/blueprint/detail/configuration-panel.tsx
+++ b/config-ui/src/pages/blueprint/detail/configuration-panel.tsx
@@ -124,17 +124,13 @@ export const ConfigurationPanel = ({ from, blueprint, onRefresh, onChangeTab }:
<S.ConfigurationPanel>
<div className="block">
<h3>Blueprint Name</h3>
- <Space>
- <span>{blueprint.name}</span>
- <Button type="primary" icon={<FormOutlined />} onClick={handleShowNameDialog} />
- </Space>
+ <span>{blueprint.name}</span>
+ <Button type="link" icon={<FormOutlined />} onClick={handleShowNameDialog} />
</div>
<div className="block">
<h3>
- <Space>
- <span>Sync Policy</span>
- <Button type="primary" icon={<FormOutlined />} onClick={handleShowPolicyDialog} />
- </Space>
+ <span>Sync Policy</span>
+ <Button type="link" icon={<FormOutlined />} onClick={handleShowPolicyDialog} />
</h3>
<Table
rowKey="id"
@@ -225,7 +221,7 @@ export const ConfigurationPanel = ({ from, blueprint, onRefresh, onChangeTab }:
))}
</S.ConnectionList>
<Flex justify="center">
- <Button type="primary" onClick={handleRun}>
+ <Button type="primary" disabled={!blueprint.enable} onClick={handleRun}>
Collect Data
</Button>
</Flex>
diff --git a/config-ui/src/pages/blueprint/detail/status-panel.tsx b/config-ui/src/pages/blueprint/detail/status-panel.tsx
index d59ca1dd7..fb25c5356 100644
--- a/config-ui/src/pages/blueprint/detail/status-panel.tsx
+++ b/config-ui/src/pages/blueprint/detail/status-panel.tsx
@@ -19,7 +19,7 @@
import { useState, useMemo } from 'react';
import { useNavigate } from 'react-router-dom';
import { MoreOutlined, DeleteOutlined } from '@ant-design/icons';
-import { Card, Modal, Switch, Button, Tooltip, Dropdown } from 'antd';
+import { Card, Modal, Switch, Button, Tooltip, Dropdown, Flex, Space } from 'antd';
import API from '@/api';
import { Message } from '@/components';
@@ -149,6 +149,7 @@ export const StatusPanel = ({ from, blueprint, pipelineId, onRefresh }: Props) =
{
key: '1',
label: 'Collect Data in Full Refresh Mode',
+ disabled: !blueprint.enable,
},
],
onClick: ({ key }) => {
@@ -164,25 +165,29 @@ export const StatusPanel = ({ from, blueprint, pipelineId, onRefresh }: Props) =
)}
{from === FromEnum.blueprint && (
- <S.BlueprintAction>
- <Button onClick={() => handleRun({})}>Run Now</Button>
- <Switch
- style={{ marginBottom: 0 }}
- disabled={!!blueprint.projectName}
- checked={blueprint.enable}
- onChange={(enable) => handleUpdate({ enable })}
- />
- Blueprint Enabled
- <Tooltip title="Delete Blueprint">
- <Button
- type="primary"
- loading={operating}
+ <Flex justify="center" align="center">
+ <Space>
+ <Button type="primary" disabled={!blueprint.enable} onClick={() => handleRun({})}>
+ Run Now
+ </Button>
+ <Switch
+ style={{ marginBottom: 0 }}
disabled={!!blueprint.projectName}
- icon={<DeleteOutlined />}
- onClick={() => setType('delete')}
+ checked={blueprint.enable}
+ onChange={(enable) => handleUpdate({ enable })}
/>
- </Tooltip>
- </S.BlueprintAction>
+ Blueprint Enabled
+ <Tooltip title="Delete Blueprint">
+ <Button
+ type="primary"
+ loading={operating}
+ disabled={!!blueprint.projectName}
+ icon={<DeleteOutlined />}
+ onClick={() => setType('delete')}
+ />
+ </Tooltip>
+ </Space>
+ </Flex>
)}
{/* <PipelineContextProvider> */}
diff --git a/config-ui/src/pages/blueprint/detail/styled.ts b/config-ui/src/pages/blueprint/detail/styled.ts
index fc103bddd..ccc078913 100644
--- a/config-ui/src/pages/blueprint/detail/styled.ts
+++ b/config-ui/src/pages/blueprint/detail/styled.ts
@@ -97,9 +97,3 @@ export const ProjectACtion = styled.div`
margin-left: 16px;
}
`;
-
-export const BlueprintAction = styled.div`
- display: flex;
- justify-content: center;
- align-items: center;
-`;