mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 17:23:40 -05:00
Add validation for new file names for sql projects (#21601)
* Add validation for new file names for sql projects * Addres comments and add validation for new project dialog * Address comments * Address comments on test * Fix tests * Remove extra error messages and rename file * Address comments * Fix tests * Add test file back
This commit is contained in:
@@ -9,6 +9,7 @@ import * as constants from '../common/constants';
|
||||
import { directoryExist, showInfoMessageWithLearnMoreLink } from '../common/utils';
|
||||
import { defaultProjectSaveLocation } from '../common/projectLocationHelper';
|
||||
import { WorkspaceService } from '../services/workspaceService';
|
||||
import { isValidBasename, isValidBasenameErrorMessage } from '../common/pathUtilsHelper';
|
||||
|
||||
/**
|
||||
* Create flow for a New Project using only VS Code-native APIs such as QuickPick
|
||||
@@ -39,7 +40,7 @@ export async function createNewProjectWithQuickpick(workspaceService: WorkspaceS
|
||||
{
|
||||
title: constants.EnterProjectName,
|
||||
validateInput: (value) => {
|
||||
return value ? undefined : constants.NameCannotBeEmpty;
|
||||
return isValidBasename(value) ? undefined : isValidBasenameErrorMessage(value);
|
||||
},
|
||||
ignoreFocusOut: true
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user