mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
fix restart ADS warning showing twice for create project from db (#17214)
This commit is contained in:
@@ -1128,10 +1128,6 @@ export class ProjectsController {
|
|||||||
|
|
||||||
public async createProjectFromDatabaseCallback(model: ImportDataModel) {
|
public async createProjectFromDatabaseCallback(model: ImportDataModel) {
|
||||||
try {
|
try {
|
||||||
const workspaceApi = utils.getDataWorkspaceExtensionApi();
|
|
||||||
|
|
||||||
const validateWorkspace = await workspaceApi.validateWorkspace();
|
|
||||||
if (validateWorkspace) {
|
|
||||||
const newProjFolderUri = model.filePath;
|
const newProjFolderUri = model.filePath;
|
||||||
|
|
||||||
const newProjFilePath = await this.createNewProject({
|
const newProjFilePath = await this.createNewProject({
|
||||||
@@ -1150,9 +1146,9 @@ export class ProjectsController {
|
|||||||
await project.addToProject(fileFolderList); // Add generated file structure to the project
|
await project.addToProject(fileFolderList); // Add generated file structure to the project
|
||||||
|
|
||||||
// add project to workspace
|
// add project to workspace
|
||||||
|
const workspaceApi = utils.getDataWorkspaceExtensionApi();
|
||||||
workspaceApi.showProjectsView();
|
workspaceApi.showProjectsView();
|
||||||
await workspaceApi.addProjectsToWorkspace([vscode.Uri.file(newProjFilePath)]);
|
await workspaceApi.addProjectsToWorkspace([vscode.Uri.file(newProjFilePath)]);
|
||||||
}
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
void vscode.window.showErrorMessage(utils.getErrorMessage(err));
|
void vscode.window.showErrorMessage(utils.getErrorMessage(err));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -372,9 +372,6 @@ export class CreateProjectFromDatabaseDialog {
|
|||||||
|
|
||||||
async validate(): Promise<boolean> {
|
async validate(): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
if (await getDataWorkspaceExtensionApi().validateWorkspace() === false) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// the selected location should be an existing directory
|
// the selected location should be an existing directory
|
||||||
const parentDirectoryExists = await exists(this.projectLocationTextBox!.value!);
|
const parentDirectoryExists = await exists(this.projectLocationTextBox!.value!);
|
||||||
if (!parentDirectoryExists) {
|
if (!parentDirectoryExists) {
|
||||||
@@ -388,6 +385,11 @@ export class CreateProjectFromDatabaseDialog {
|
|||||||
this.showErrorMessage(constants.ProjectDirectoryAlreadyExistError(this.projectNameTextBox!.value!, this.projectLocationTextBox!.value!));
|
this.showErrorMessage(constants.ProjectDirectoryAlreadyExistError(this.projectNameTextBox!.value!, this.projectLocationTextBox!.value!));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (await getDataWorkspaceExtensionApi().validateWorkspace() === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.showErrorMessage(err?.message ? err.message : err);
|
this.showErrorMessage(err?.message ? err.message : err);
|
||||||
|
|||||||
Reference in New Issue
Block a user