From f6045b861b06deb56ef8e01f4977f13c13ff6b2c Mon Sep 17 00:00:00 2001
From: mintsweet <0x1304570@gmail.com>
Date: Tue, 14 Nov 2023 19:26:38 +1300
Subject: [PATCH] fix(config-ui): adjust the table component
---
.../blueprint/connection-detail/index.tsx | 5 +++--
.../blueprint/detail/configuration-panel.tsx | 4 ++++
config-ui/src/pages/blueprint/home/index.tsx | 22 +++++++------------
.../src/pages/connection/detail/index.tsx | 6 ++---
config-ui/src/pages/project/home/index.tsx | 13 +++++------
.../components/connection-list/index.tsx | 6 +++--
.../components/scope-config-select/index.tsx | 3 +++
.../plugins/register/webhook/connection.tsx | 9 +++++---
config-ui/src/routes/api-keys/api-keys.tsx | 2 ++
config-ui/src/routes/layout/styled.ts | 2 --
.../src/routes/pipeline/components/table.tsx | 5 +++--
11 files changed, 41 insertions(+), 36 deletions(-)
diff --git a/config-ui/src/pages/blueprint/connection-detail/index.tsx b/config-ui/src/pages/blueprint/connection-detail/index.tsx
index 9aa183ca214..6b821702fa9 100644
--- a/config-ui/src/pages/blueprint/connection-detail/index.tsx
+++ b/config-ui/src/pages/blueprint/connection-detail/index.tsx
@@ -216,6 +216,8 @@ export const BlueprintConnectionDetailPage = () => {
)}
{
},
{
title: 'Scope Config',
- dataIndex: ['scopeConfigId', 'scopeConfigName'],
key: 'scopeConfig',
- render: ({ scopeConfigId, scopeConfigName }) => (scopeConfigId ? scopeConfigName : 'N/A'),
+ render: (_, { scopeConfigId, scopeConfigName }) => (scopeConfigId ? scopeConfigName : 'N/A'),
},
]}
dataSource={scopes}
diff --git a/config-ui/src/pages/blueprint/detail/configuration-panel.tsx b/config-ui/src/pages/blueprint/detail/configuration-panel.tsx
index 9c81f02c546..1dddb6069b8 100644
--- a/config-ui/src/pages/blueprint/detail/configuration-panel.tsx
+++ b/config-ui/src/pages/blueprint/detail/configuration-panel.tsx
@@ -135,6 +135,8 @@ export const ConfigurationPanel = ({ from, blueprint, onRefresh, onChangeTab }:
{blueprint.mode === IBPMode.NORMAL && (
diff --git a/config-ui/src/pages/blueprint/home/index.tsx b/config-ui/src/pages/blueprint/home/index.tsx
index fb7a4d74007..5d8fb0b3775 100644
--- a/config-ui/src/pages/blueprint/home/index.tsx
+++ b/config-ui/src/pages/blueprint/home/index.tsx
@@ -112,13 +112,14 @@ export const BlueprintHomePage = () => {
(
+ render: (_, { id, name }) => (
{name}
@@ -126,21 +127,16 @@ export const BlueprintHomePage = () => {
},
{
title: 'Data Connections',
- dataIndex: ['mode', 'connections'],
key: 'connections',
- render: ({ mode, connections }: Pick) => {
+ render: (_, { mode, connections }: Pick) => {
if (mode === IBPMode.ADVANCED) {
return 'Advanced Mode';
}
return (
{connections.map((it) => (
-
-
+
+
))}
@@ -149,20 +145,18 @@ export const BlueprintHomePage = () => {
},
{
title: 'Frequency',
- dataIndex: ['isManual', 'cronConfig'],
key: 'frequency',
width: 100,
- render: ({ isManual, cronConfig }) => {
+ render: (_, { isManual, cronConfig }) => {
const cron = getCron(isManual, cronConfig);
return cron.label;
},
},
{
title: 'Next Run Time',
- dataIndex: ['isManual', 'cronConfig'],
key: 'nextRunTime',
width: 200,
- render: ({ isManual, cronConfig }) => {
+ render: (_, { isManual, cronConfig }) => {
const cron = getCron(isManual, cronConfig);
return formatTime(cron.nextTime);
},
diff --git a/config-ui/src/pages/connection/detail/index.tsx b/config-ui/src/pages/connection/detail/index.tsx
index 551eff76cfd..3a25e18ec53 100644
--- a/config-ui/src/pages/connection/detail/index.tsx
+++ b/config-ui/src/pages/connection/detail/index.tsx
@@ -266,7 +266,8 @@ export const ConnectionDetailPage = () => {
)}
row.id}
+ rowKey="id"
+ size="middle"
loading={!ready}
columns={[
{
@@ -296,10 +297,9 @@ export const ConnectionDetailPage = () => {
},
{
title: 'Scope Config',
- dataIndex: ['id', 'configId', 'configName'],
key: 'scopeConfig',
width: 400,
- render: ({ id, configId, configName }) => (
+ render: (_, { id, configId, configName }) => (
<>
{configId ? configName : 'N/A'}
{pluginConfig.scopeConfig && (
diff --git a/config-ui/src/pages/project/home/index.tsx b/config-ui/src/pages/project/home/index.tsx
index f18f6df1bdb..81ffa6b65c2 100644
--- a/config-ui/src/pages/project/home/index.tsx
+++ b/config-ui/src/pages/project/home/index.tsx
@@ -123,6 +123,8 @@ export const ProjectHomePage = () => {
extra={}
>
{
) : (
{val.map((it) => (
-
-
+
+
))}
@@ -158,9 +156,8 @@ export const ProjectHomePage = () => {
},
{
title: 'Sync Frequency',
- dataIndex: ['isManual', 'cronConfig'],
key: 'frequency',
- render: ({ isManual, cronConfig }) => {
+ render: (_, { isManual, cronConfig }) => {
const cron = getCron(isManual, cronConfig);
return cron.label;
},
diff --git a/config-ui/src/plugins/components/connection-list/index.tsx b/config-ui/src/plugins/components/connection-list/index.tsx
index 20b6b8975bb..65cb33c76ae 100644
--- a/config-ui/src/plugins/components/connection-list/index.tsx
+++ b/config-ui/src/plugins/components/connection-list/index.tsx
@@ -41,6 +41,8 @@ export const ConnectionList = ({ plugin, onCreate }: Props) => {
return (
<>
{
},
{
title: '',
- dataIndex: ['plugin', 'id'],
key: 'link',
width: 100,
- render: ({ plugin, id }) => Details,
+ render: (_, { plugin, id }) => Details,
},
]}
dataSource={connections}
+ pagination={false}
/>
setTrId(selectedRowKeys[0]),
}}
+ pagination={false}
/>
diff --git a/config-ui/src/plugins/register/webhook/connection.tsx b/config-ui/src/plugins/register/webhook/connection.tsx
index 55ea71e94f9..0a7d8335292 100644
--- a/config-ui/src/plugins/register/webhook/connection.tsx
+++ b/config-ui/src/plugins/register/webhook/connection.tsx
@@ -55,10 +55,9 @@ export const WebHookConnection = ({ filterIds, onCreateAfter, onDeleteAfter }: P
return (
-
-
(filterIds ? filterIds.includes(cs.id) : true))}
+ pagination={false}
/>
+
+
{type === 'add' && (
onCreateAfter?.(id)} />
)}
diff --git a/config-ui/src/routes/api-keys/api-keys.tsx b/config-ui/src/routes/api-keys/api-keys.tsx
index 5c033deddb1..ef3acdcef4c 100644
--- a/config-ui/src/routes/api-keys/api-keys.tsx
+++ b/config-ui/src/routes/api-keys/api-keys.tsx
@@ -97,6 +97,8 @@ export const ApiKeys = () => {
>
You can generate and manage your API keys to access the DevLake API.
{
return (
<>
{
},
{
title: 'Duration',
- dataIndex: ['status', 'beganAt', 'finishedAt'],
key: 'duration',
- render: ({ status, beganAt, finishedAt }) => (
+ render: (_, { status, beganAt, finishedAt }) => (
),
},