mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Import spot-fix (#11102)
This commit is contained in:
@@ -136,7 +136,7 @@ export default class MainController implements Disposable {
|
|||||||
// TODO: what if the selected folder is outside the workspace?
|
// TODO: what if the selected folder is outside the workspace?
|
||||||
|
|
||||||
const newProjFolderUri = (selectionResult as Uri[])[0];
|
const newProjFolderUri = (selectionResult as Uri[])[0];
|
||||||
const newProjFilePath = await this.projectsController.createNewProject(<string>newProjName, newProjFolderUri);
|
const newProjFilePath = await this.projectsController.createNewProject(<string>newProjName, newProjFolderUri, true);
|
||||||
const proj = await this.projectsController.openProject(Uri.file(newProjFilePath));
|
const proj = await this.projectsController.openProject(Uri.file(newProjFilePath));
|
||||||
|
|
||||||
return proj;
|
return proj;
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ export class ProjectsController {
|
|||||||
* @param folderUri
|
* @param folderUri
|
||||||
* @param projectGuid
|
* @param projectGuid
|
||||||
*/
|
*/
|
||||||
public async createNewProject(newProjName: string, folderUri: Uri, projectGuid?: string): Promise<string> {
|
public async createNewProject(newProjName: string, folderUri: Uri, makeOwnFolder: boolean, projectGuid?: string): Promise<string> {
|
||||||
if (projectGuid && !UUID.isUUID(projectGuid)) {
|
if (projectGuid && !UUID.isUUID(projectGuid)) {
|
||||||
throw new Error(`Specified GUID is invalid: '${projectGuid}'`);
|
throw new Error(`Specified GUID is invalid: '${projectGuid}'`);
|
||||||
}
|
}
|
||||||
@@ -135,7 +135,7 @@ export class ProjectsController {
|
|||||||
newProjFileName += constants.sqlprojExtension;
|
newProjFileName += constants.sqlprojExtension;
|
||||||
}
|
}
|
||||||
|
|
||||||
const newProjFilePath = path.join(folderUri.fsPath, path.parse(newProjFileName).name, newProjFileName);
|
const newProjFilePath = makeOwnFolder ? path.join(folderUri.fsPath, path.parse(newProjFileName).name, newProjFileName) : path.join(folderUri.fsPath, newProjFileName);
|
||||||
|
|
||||||
let fileExists = false;
|
let fileExists = false;
|
||||||
try {
|
try {
|
||||||
@@ -677,7 +677,7 @@ export class ProjectsController {
|
|||||||
// TODO: Check for success
|
// TODO: Check for success
|
||||||
|
|
||||||
// Create and open new project
|
// Create and open new project
|
||||||
const newProjFilePath = await this.createNewProject(newProjName as string, newProjFolderUri as Uri);
|
const newProjFilePath = await this.createNewProject(newProjName as string, newProjFolderUri as Uri, false);
|
||||||
const project = await this.openProject(Uri.file(newProjFilePath));
|
const project = await this.openProject(Uri.file(newProjFilePath));
|
||||||
|
|
||||||
//Create a list of all the files and directories to be added to project
|
//Create a list of all the files and directories to be added to project
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ describe.skip('Deploy Database Dialog', () => {
|
|||||||
const projController = new ProjectsController(testContext.apiWrapper.object, new SqlDatabaseProjectTreeViewProvider());
|
const projController = new ProjectsController(testContext.apiWrapper.object, new SqlDatabaseProjectTreeViewProvider());
|
||||||
const projFileDir = path.join(os.tmpdir(), `TestProject_${new Date().getTime()}`);
|
const projFileDir = path.join(os.tmpdir(), `TestProject_${new Date().getTime()}`);
|
||||||
|
|
||||||
const projFilePath = await projController.createNewProject('TestProjectName', vscode.Uri.file(projFileDir), 'BA5EBA11-C0DE-5EA7-ACED-BABB1E70A575');
|
const projFilePath = await projController.createNewProject('TestProjectName', vscode.Uri.file(projFileDir), true, 'BA5EBA11-C0DE-5EA7-ACED-BABB1E70A575');
|
||||||
const project = new Project(projFilePath);
|
const project = new Project(projFilePath);
|
||||||
const deployDatabaseDialog = new DeployDatabaseDialog(testContext.apiWrapper.object, project);
|
const deployDatabaseDialog = new DeployDatabaseDialog(testContext.apiWrapper.object, project);
|
||||||
deployDatabaseDialog.openDialog();
|
deployDatabaseDialog.openDialog();
|
||||||
@@ -48,7 +48,7 @@ describe.skip('Deploy Database Dialog', () => {
|
|||||||
const projFolder = `TestProject_${new Date().getTime()}`;
|
const projFolder = `TestProject_${new Date().getTime()}`;
|
||||||
const projFileDir = path.join(os.tmpdir(), projFolder);
|
const projFileDir = path.join(os.tmpdir(), projFolder);
|
||||||
|
|
||||||
const projFilePath = await projController.createNewProject('TestProjectName', vscode.Uri.file(projFileDir), 'BA5EBA11-C0DE-5EA7-ACED-BABB1E70A575');
|
const projFilePath = await projController.createNewProject('TestProjectName', vscode.Uri.file(projFileDir), true, 'BA5EBA11-C0DE-5EA7-ACED-BABB1E70A575');
|
||||||
const project = new Project(projFilePath);
|
const project = new Project(projFilePath);
|
||||||
|
|
||||||
const deployDatabaseDialog = new DeployDatabaseDialog(testContext.apiWrapper.object, project);
|
const deployDatabaseDialog = new DeployDatabaseDialog(testContext.apiWrapper.object, project);
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ describe('ProjectsController: project controller operations', function (): void
|
|||||||
const projController = new ProjectsController(testContext.apiWrapper.object, new SqlDatabaseProjectTreeViewProvider());
|
const projController = new ProjectsController(testContext.apiWrapper.object, new SqlDatabaseProjectTreeViewProvider());
|
||||||
const projFileDir = path.join(os.tmpdir(), `TestProject_${new Date().getTime()}`);
|
const projFileDir = path.join(os.tmpdir(), `TestProject_${new Date().getTime()}`);
|
||||||
|
|
||||||
const projFilePath = await projController.createNewProject('TestProjectName', vscode.Uri.file(projFileDir), 'BA5EBA11-C0DE-5EA7-ACED-BABB1E70A575');
|
const projFilePath = await projController.createNewProject('TestProjectName', vscode.Uri.file(projFileDir), false, 'BA5EBA11-C0DE-5EA7-ACED-BABB1E70A575');
|
||||||
|
|
||||||
let projFileText = (await fs.readFile(projFilePath)).toString();
|
let projFileText = (await fs.readFile(projFilePath)).toString();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user