Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove project name valid function #7922

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading