From df2b79e54500076ceab2ced66d4a7b8d6e751e3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=92=E6=B9=9B?= <0x1304570@gmail.com> Date: Tue, 20 Aug 2024 21:27:56 +1200 Subject: [PATCH] feat: remove project name valid function (#7922) --- 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 219db1a3fd5..a6c16632aa8 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 bc09e450a00..5f3ce4048b4 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 bf5d2f4e6d5..0c52c186023 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({