You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by kl...@apache.org on 2023/12/05 08:31:08 UTC

(incubator-devlake) branch main updated: refactor(config-ui): use new ui alert to replace old alert component (#6544)

This is an automated email from the ASF dual-hosted git repository.

klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 0dc2929ef refactor(config-ui): use new ui alert to replace old alert component (#6544)
0dc2929ef is described below

commit 0dc2929efeb47b7a88268bc3dbce96300cf208ea
Author: 青湛 <0x...@gmail.com>
AuthorDate: Tue Dec 5 16:31:04 2023 +0800

    refactor(config-ui): use new ui alert to replace old alert component (#6544)
---
 config-ui/src/components/alert/index.tsx           | 35 ----------------------
 config-ui/src/components/index.ts                  |  1 -
 .../src/pages/project/detail/webhooks-panel.tsx    |  7 +++--
 .../plugins/components/scope-config-form/index.tsx |  6 ++--
 4 files changed, 7 insertions(+), 42 deletions(-)

diff --git a/config-ui/src/components/alert/index.tsx b/config-ui/src/components/alert/index.tsx
deleted file mode 100644
index 20bab99d0..000000000
--- a/config-ui/src/components/alert/index.tsx
+++ /dev/null
@@ -1,35 +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';
-
-const Wrapper = styled.div`
-  padding: 24px;
-  background: #f0f4fe;
-  border: 1px solid #bdcefb;
-  border-radius: 4px;
-`;
-
-interface Props {
-  style?: React.CSSProperties;
-  content: React.ReactNode;
-}
-
-export const Alert = ({ style, content }: Props) => {
-  return <Wrapper style={style}>{content}</Wrapper>;
-};
diff --git a/config-ui/src/components/index.ts b/config-ui/src/components/index.ts
index 03ede2141..5981646c4 100644
--- a/config-ui/src/components/index.ts
+++ b/config-ui/src/components/index.ts
@@ -17,7 +17,6 @@
  */
 
 export * from './action';
-export * from './alert';
 export * from './buttons';
 export * from './dialog';
 export * from './divider';
diff --git a/config-ui/src/pages/project/detail/webhooks-panel.tsx b/config-ui/src/pages/project/detail/webhooks-panel.tsx
index a9a87b98e..18ca39a83 100644
--- a/config-ui/src/pages/project/detail/webhooks-panel.tsx
+++ b/config-ui/src/pages/project/detail/webhooks-panel.tsx
@@ -18,10 +18,11 @@
 
 import { useState, useMemo } from 'react';
 import { Link } from 'react-router-dom';
+import { Alert } from 'antd';
 import { Button, Intent } from '@blueprintjs/core';
 
 import API from '@/api';
-import { Alert, NoData } from '@/components';
+import { NoData } from '@/components';
 import type { WebhookItemType } from '@/plugins/register/webhook';
 import { WebhookCreateDialog, WebhookSelectorDialog, WebHookConnection } from '@/plugins/register/webhook';
 import { IProject } from '@/types';
@@ -110,8 +111,8 @@ export const WebhooksPanel = ({ project, onRefresh }: Props) => {
   return (
     <>
       <Alert
-        style={{ marginBottom: 24, color: '#3C5088' }}
-        content={
+        style={{ marginBottom: 24 }}
+        message={
           <>
             <div>
               The data pushed by Webhooks will only be calculated for DORA in the next run of the Blueprint of this
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 e9e4cb648..af8c19df3 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, Card } from 'antd';
+import { Form, Card, Alert } from 'antd';
 import { InputGroup, Button, Intent } from '@blueprintjs/core';
 
 import API from '@/api';
-import { Alert, ExternalLink, FormItem, MultiSelector, Message, Buttons, Divider } from '@/components';
+import { ExternalLink, FormItem, MultiSelector, Message, Buttons, Divider } from '@/components';
 import { transformEntities, EntitiesLabel } from '@/config';
 import { getPluginConfig } from '@/plugins';
 import { GitHubTransformation } from '@/plugins/register/github';
@@ -117,7 +117,7 @@ export const ScopeConfigForm = ({
       {TIPS_MAP[plugin] && (
         <Alert
           style={{ marginBottom: 24 }}
-          content={
+          message={
             <>
               To learn about how {TIPS_MAP[plugin].name} transformation is used in DevLake,{' '}
               <ExternalLink link={TIPS_MAP[plugin].link}>check out this doc</ExternalLink>.