mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
fix: validate project names on blur (#7668)
This fix validates the project name when you blur the field in the new project form. The only instances where it'll be wrong is if you have just whitespace or an empty string, but you'll be notified immediately. Also removes some unused variables and parameters that I found.
This commit is contained in:
parent
dc37503b7d
commit
2c41cbbd3c
@ -128,7 +128,6 @@ export const CreateProjectDialog = ({
|
||||
const navigate = useNavigate();
|
||||
const { trackEvent } = usePlausibleTracker();
|
||||
const {
|
||||
projectId,
|
||||
projectName,
|
||||
projectDesc,
|
||||
projectMode,
|
||||
@ -276,6 +275,7 @@ export const CreateProjectDialog = ({
|
||||
errors={errors}
|
||||
icon={StyledProjectIcon}
|
||||
onClose={onClose}
|
||||
validateName={validateName}
|
||||
configButtons={
|
||||
<>
|
||||
<MultiSelectConfigButton
|
||||
|
@ -86,14 +86,12 @@ function resolveCreateButtonData(
|
||||
}
|
||||
}
|
||||
|
||||
const ProjectCreationButton: FC<{ projectCount: number }> = ({
|
||||
projectCount,
|
||||
}) => {
|
||||
const ProjectCreationButton: FC = () => {
|
||||
const [searchParams] = useSearchParams();
|
||||
const showCreateDialog = Boolean(searchParams.get('create'));
|
||||
const [openCreateDialog, setOpenCreateDialog] = useState(showCreateDialog);
|
||||
const { hasAccess } = useContext(AccessContext);
|
||||
const { isOss, uiConfig, loading } = useUiConfig();
|
||||
const { isOss, loading } = useUiConfig();
|
||||
|
||||
const createButtonData = resolveCreateButtonData(
|
||||
isOss(),
|
||||
@ -203,9 +201,7 @@ export const ProjectListNew = () => {
|
||||
</>
|
||||
}
|
||||
/>
|
||||
<ProjectCreationButton
|
||||
projectCount={projects.length}
|
||||
/>
|
||||
<ProjectCreationButton />
|
||||
</>
|
||||
}
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user