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 2024/08/20 05:01:46 UTC
(incubator-devlake) 01/01: feat: remove project name valid function
This is an automated email from the ASF dual-hosted git repository.
mintsweet pushed a commit to branch feat-7217
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit 555f71599a72cd892114a36746a4c5428969444e
Author: mintsweet <0x...@gmail.com>
AuthorDate: Tue Aug 20 17:01:29 2024 +1200
feat: remove project name valid function
---
config-ui/src/routes/onboard/step-1.tsx | 9 +--------
config-ui/src/routes/project/detail/settings-panel.tsx | 9 +--------
config-ui/src/routes/project/home/index.tsx | 9 +--------
3 files changed, 3 insertions(+), 24 deletions(-)
diff --git a/config-ui/src/routes/onboard/step-1.tsx b/config-ui/src/routes/onboard/step-1.tsx
index 219db1a3f..a6c16632a 100644
--- a/config-ui/src/routes/onboard/step-1.tsx
+++ b/config-ui/src/routes/onboard/step-1.tsx
@@ -24,7 +24,6 @@ import API from '@/api';
import { Block, Markdown } from '@/components';
import { PATHS } from '@/config';
import { ConnectionSelect } from '@/plugins';
-import { validName } from '@/routes/project';
import { operator } from '@/utils';
import { Context } from './context';
@@ -43,13 +42,7 @@ export const Step1 = () => {
}, [plugin]);
const handleSubmit = async () => {
- if (!projectName || !validName(projectName)) {
- message.error('Please enter alphanumeric or underscore');
- return;
- }
-
- if (!plugin) {
- message.error('Please select a plugin');
+ if (!projectName || !plugin) {
return;
}
diff --git a/config-ui/src/routes/project/detail/settings-panel.tsx b/config-ui/src/routes/project/detail/settings-panel.tsx
index bc09e450a..5f3ce4048 100644
--- a/config-ui/src/routes/project/detail/settings-panel.tsx
+++ b/config-ui/src/routes/project/detail/settings-panel.tsx
@@ -18,7 +18,7 @@
import { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
-import { Flex, Space, Card, Modal, Input, Checkbox, Button, message } from 'antd';
+import { Flex, Space, Card, Modal, Input, Checkbox, Button } from 'antd';
import API from '@/api';
import { Block, HelpTooltip, Message } from '@/components';
@@ -26,8 +26,6 @@ import { PATHS } from '@/config';
import { IProject } from '@/types';
import { operator } from '@/utils';
-import { validName } from '../utils';
-
import * as S from './styled';
const RegexPrIssueDefaultValue = '(?mi)(Closes)[\\s]*.*(((and )?#\\d+[ ]*)+)';
@@ -73,11 +71,6 @@ export const SettingsPanel = ({ project, onRefresh }: Props) => {
}, [project]);
const handleUpdate = async () => {
- if (!validName(name)) {
- message.error('Please enter alphanumeric or underscore');
- return;
- }
-
const [success] = await operator(
() =>
API.project.update(project.name, {
diff --git a/config-ui/src/routes/project/home/index.tsx b/config-ui/src/routes/project/home/index.tsx
index bf5d2f4e6..0c52c1860 100644
--- a/config-ui/src/routes/project/home/index.tsx
+++ b/config-ui/src/routes/project/home/index.tsx
@@ -19,7 +19,7 @@
import { useState, useMemo, useRef } from 'react';
import { Link, useNavigate } from 'react-router-dom';
import { PlusOutlined, SettingOutlined } from '@ant-design/icons';
-import { Flex, Table, Button, Modal, Input, message } from 'antd';
+import { Flex, Table, Button, Modal, Input } from 'antd';
import API from '@/api';
import { PageHeader, Block, IconButton } from '@/components';
@@ -31,8 +31,6 @@ import { formatTime, operator } from '@/utils';
import { PipelineStatus } from '@/routes/pipeline';
import { IBlueprint } from '@/types';
-import { validName } from '../utils';
-
export const ProjectHomePage = () => {
const [version, setVersion] = useState(1);
const [page, setPage] = useState(1);
@@ -74,11 +72,6 @@ export const ProjectHomePage = () => {
};
const handleCreate = async () => {
- if (!validName(name)) {
- message.error('Please enter alphanumeric or underscore');
- return;
- }
-
const [success] = await operator(
async () =>
API.project.create({