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/01 00:27:14 UTC
(incubator-devlake) 01/01: refactor(config-ui): use new ui card to replace old card component
This is an automated email from the ASF dual-hosted git repository.
mintsweet pushed a commit to branch refactor-6307-2
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit ffafce5c13920881984d9423852fa9ca7d37e601
Author: mintsweet <0x...@gmail.com>
AuthorDate: Fri Dec 1 13:27:01 2023 +1300
refactor(config-ui): use new ui card to replace old card component
---
config-ui/src/components/card/index.tsx | 30 ----------------------
config-ui/src/components/index.ts | 1 -
config-ui/src/components/no-data/index.tsx | 3 ++-
.../src/pages/blueprint/detail/status-panel.tsx | 3 ++-
.../src/pages/project/detail/settings-panel.tsx | 3 ++-
.../plugins/components/scope-config-form/index.tsx | 4 +--
.../routes/error/components/exception/index.tsx | 3 ++-
.../error/components/needs-db-migrate/index.tsx | 3 ++-
.../src/routes/error/components/offline/index.tsx | 3 ++-
config-ui/src/routes/pipeline/pipeline.tsx | 3 ++-
10 files changed, 16 insertions(+), 40 deletions(-)
diff --git a/config-ui/src/components/card/index.tsx b/config-ui/src/components/card/index.tsx
deleted file mode 100644
index 418b1f065..000000000
--- a/config-ui/src/components/card/index.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import styled from 'styled-components';
-
-export const Card = styled.div`
- padding: 24px;
- background-color: #fff;
- box-shadow: 0px 2.4px 4.8px -0.8px rgba(0, 0, 0, 0.1), 0px 1.6px 8px rgba(0, 0, 0, 0.07);
- border-radius: 8px;
-
- & + & {
- margin-top: 24px;
- }
-`;
diff --git a/config-ui/src/components/index.ts b/config-ui/src/components/index.ts
index e67e2ac14..03ede2141 100644
--- a/config-ui/src/components/index.ts
+++ b/config-ui/src/components/index.ts
@@ -19,7 +19,6 @@
export * from './action';
export * from './alert';
export * from './buttons';
-export * from './card';
export * from './dialog';
export * from './divider';
export * from './form';
diff --git a/config-ui/src/components/no-data/index.tsx b/config-ui/src/components/no-data/index.tsx
index ba7d45f64..bf09b2f39 100644
--- a/config-ui/src/components/no-data/index.tsx
+++ b/config-ui/src/components/no-data/index.tsx
@@ -16,8 +16,9 @@
*
*/
+import { Card } from 'antd';
+
import Img from '@/images/no-data.svg';
-import { Card } from '@/components';
import styled from 'styled-components';
diff --git a/config-ui/src/pages/blueprint/detail/status-panel.tsx b/config-ui/src/pages/blueprint/detail/status-panel.tsx
index 07a99d159..73d9932b0 100644
--- a/config-ui/src/pages/blueprint/detail/status-panel.tsx
+++ b/config-ui/src/pages/blueprint/detail/status-panel.tsx
@@ -18,11 +18,12 @@
import { useState, useMemo } from 'react';
import { useNavigate } from 'react-router-dom';
+import { Card } from 'antd';
import { Button, Switch, Intent, Position, Popover, Menu, MenuItem } from '@blueprintjs/core';
import { Tooltip2 } from '@blueprintjs/popover2';
import API from '@/api';
-import { Card, IconButton, Dialog, Message } from '@/components';
+import { IconButton, Dialog, Message } from '@/components';
import { getCron } from '@/config';
import { useAutoRefresh } from '@/hooks';
import { PipelineInfo, PipelineTasks, PipelineTable } from '@/routes/pipeline';
diff --git a/config-ui/src/pages/project/detail/settings-panel.tsx b/config-ui/src/pages/project/detail/settings-panel.tsx
index 9f071b042..363ad43dd 100644
--- a/config-ui/src/pages/project/detail/settings-panel.tsx
+++ b/config-ui/src/pages/project/detail/settings-panel.tsx
@@ -18,10 +18,11 @@
import { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
+import { Card } from 'antd';
import { InputGroup, Checkbox, Button, Icon, Intent } from '@blueprintjs/core';
import API from '@/api';
-import { Card, FormItem, Buttons, toast, Dialog } from '@/components';
+import { FormItem, Buttons, toast, Dialog } from '@/components';
import { IProject } from '@/types';
import { operator } from '@/utils';
diff --git a/config-ui/src/plugins/components/scope-config-form/index.tsx b/config-ui/src/plugins/components/scope-config-form/index.tsx
index 613222f54..e9e4cb648 100644
--- a/config-ui/src/plugins/components/scope-config-form/index.tsx
+++ b/config-ui/src/plugins/components/scope-config-form/index.tsx
@@ -18,11 +18,11 @@
import { useState, useEffect, useMemo } from 'react';
import { omit } from 'lodash';
-import { Form } from 'antd';
+import { Form, Card } from 'antd';
import { InputGroup, Button, Intent } from '@blueprintjs/core';
import API from '@/api';
-import { Alert, ExternalLink, Card, FormItem, MultiSelector, Message, Buttons, Divider } from '@/components';
+import { Alert, ExternalLink, FormItem, MultiSelector, Message, Buttons, Divider } from '@/components';
import { transformEntities, EntitiesLabel } from '@/config';
import { getPluginConfig } from '@/plugins';
import { GitHubTransformation } from '@/plugins/register/github';
diff --git a/config-ui/src/routes/error/components/exception/index.tsx b/config-ui/src/routes/error/components/exception/index.tsx
index d2aca5c55..20487e971 100644
--- a/config-ui/src/routes/error/components/exception/index.tsx
+++ b/config-ui/src/routes/error/components/exception/index.tsx
@@ -17,9 +17,10 @@
*/
import { useNavigate } from 'react-router-dom';
+import { Card } from 'antd';
import { Icon, Colors, Button, Intent } from '@blueprintjs/core';
-import { Card, Buttons } from '@/components';
+import { Buttons } from '@/components';
interface Props {
error: string | Error;
diff --git a/config-ui/src/routes/error/components/needs-db-migrate/index.tsx b/config-ui/src/routes/error/components/needs-db-migrate/index.tsx
index 09338f073..3161a742f 100644
--- a/config-ui/src/routes/error/components/needs-db-migrate/index.tsx
+++ b/config-ui/src/routes/error/components/needs-db-migrate/index.tsx
@@ -17,11 +17,12 @@
*/
import { useState } from 'react';
+import { Card } from 'antd';
import { Icon, Button, Colors, Intent } from '@blueprintjs/core';
import { useNavigate } from 'react-router-dom';
import API from '@/api';
-import { Card, Buttons } from '@/components';
+import { Buttons } from '@/components';
import { operator } from '@/utils';
export const NeedsDBMigrate = () => {
diff --git a/config-ui/src/routes/error/components/offline/index.tsx b/config-ui/src/routes/error/components/offline/index.tsx
index b2fc0df1a..573a457e4 100644
--- a/config-ui/src/routes/error/components/offline/index.tsx
+++ b/config-ui/src/routes/error/components/offline/index.tsx
@@ -18,11 +18,12 @@
import { useMemo, useState } from 'react';
import { useNavigate } from 'react-router-dom';
+import { Card } from 'antd';
import { Icon, Tag, Button, Intent, Colors, IconName } from '@blueprintjs/core';
import API from '@/api';
import { DEVLAKE_ENDPOINT } from '@/config';
-import { Card, Buttons } from '@/components';
+import { Buttons } from '@/components';
import { useAutoRefresh } from '@/hooks';
export const Offline = () => {
diff --git a/config-ui/src/routes/pipeline/pipeline.tsx b/config-ui/src/routes/pipeline/pipeline.tsx
index bfbec6cfa..b02551f2f 100644
--- a/config-ui/src/routes/pipeline/pipeline.tsx
+++ b/config-ui/src/routes/pipeline/pipeline.tsx
@@ -16,8 +16,9 @@
*
*/
import { useParams } from 'react-router-dom';
+import { Card } from 'antd';
-import { PageHeader, Card } from '@/components';
+import { PageHeader } from '@/components';
import { PipelineInfo, PipelineTasks } from './components';