Skip to content

Commit

Permalink
feat: remove project name valid function (#7922) (#7926)
Browse files Browse the repository at this point in the history
Co-authored-by: 青湛 <0x1304570@gmail.com>
  • Loading branch information
github-actions[bot] and mintsweet authored Aug 20, 2024
1 parent a2fffb9 commit 66e7df7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 24 deletions.
9 changes: 1 addition & 8 deletions config-ui/src/routes/onboard/step-1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;
}

Expand Down
9 changes: 1 addition & 8 deletions config-ui/src/routes/project/detail/settings-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@

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';
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+[ ]*)+)';
Expand Down Expand Up @@ -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, {
Expand Down
9 changes: 1 addition & 8 deletions config-ui/src/routes/project/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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);
Expand Down Expand Up @@ -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({
Expand Down

0 comments on commit 66e7df7

Please sign in to comment.