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:23:01 UTC
(incubator-devlake) branch refactor-6307-1 created (now 43e915f60)
This is an automated email from the ASF dual-hosted git repository.
mintsweet pushed a change to branch refactor-6307-1
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
at 43e915f60 refactor(config-ui): use new ui alert to replace old alert component
This branch includes the following new commits:
new 43e915f60 refactor(config-ui): use new ui alert to replace old alert component
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: refactor(config-ui): use new ui alert to replace old alert component
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mintsweet pushed a commit to branch refactor-6307-1
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit 43e915f6060dd612a38e228cc0b084b7b150eb1c
Author: mintsweet <0x...@gmail.com>
AuthorDate: Fri Dec 1 13:22:49 2023 +1300
refactor(config-ui): use new ui alert to replace old alert component
---
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 e67e2ac14..149d3ae1f 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 './card';
export * from './dialog';
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 613222f54..cb179f07f 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, Alert } 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 { ExternalLink, Card, 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>.