mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Make SDK-style project a checkbox option instead of separate template (#18698)
* switch to using a checkbox instead of separate template for new SDK style project * let project provider provide sdk learn more url * Reorder
This commit is contained in:
@@ -49,6 +49,8 @@ export const SelectProjectType = localize('dataworkspace.selectProjectType', "Se
|
|||||||
export const SelectProjectLocation = localize('dataworkspace.selectProjectLocation', "Select Project Location");
|
export const SelectProjectLocation = localize('dataworkspace.selectProjectLocation', "Select Project Location");
|
||||||
export const NameCannotBeEmpty = localize('dataworkspace.nameCannotBeEmpty', "Name cannot be empty");
|
export const NameCannotBeEmpty = localize('dataworkspace.nameCannotBeEmpty', "Name cannot be empty");
|
||||||
export const TargetPlatform = localize('dataworkspace.targetPlatform', "Target Platform");
|
export const TargetPlatform = localize('dataworkspace.targetPlatform', "Target Platform");
|
||||||
|
export const SdkStyleProject = localize('dataworkspace.sdkStyleProject', "SDK-style project (Preview)");
|
||||||
|
export const LearnMore = localize('dataworkspace.learnMore', "Learn More");
|
||||||
|
|
||||||
//Open Existing Dialog
|
//Open Existing Dialog
|
||||||
export const OpenExistingDialogTitle = localize('dataworkspace.openExistingDialogTitle', "Open Existing Project");
|
export const OpenExistingDialogTitle = localize('dataworkspace.openExistingDialogTitle', "Open Existing Project");
|
||||||
|
|||||||
@@ -74,8 +74,9 @@ export interface IWorkspaceService {
|
|||||||
* @param location The location of the project
|
* @param location The location of the project
|
||||||
* @param projectTypeId The project type id
|
* @param projectTypeId The project type id
|
||||||
* @param projectTargetPlatform The target platform of the project
|
* @param projectTargetPlatform The target platform of the project
|
||||||
|
* @param sdkStyleProject Whether or not the project is SDK-style
|
||||||
*/
|
*/
|
||||||
createProject(name: string, location: vscode.Uri, projectTypeId: string, projectTargetPlatform?: string): Promise<vscode.Uri>;
|
createProject(name: string, location: vscode.Uri, projectTypeId: string, projectTargetPlatform?: string, sdkStyleProject?: boolean): Promise<vscode.Uri>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clones git repository and adds projects to workspace
|
* Clones git repository and adds projects to workspace
|
||||||
|
|||||||
11
extensions/data-workspace/src/dataworkspace.d.ts
vendored
11
extensions/data-workspace/src/dataworkspace.d.ts
vendored
@@ -67,8 +67,9 @@ declare module 'dataworkspace' {
|
|||||||
* @param location the parent directory of the project
|
* @param location the parent directory of the project
|
||||||
* @param projectTypeId the identifier of the selected project type
|
* @param projectTypeId the identifier of the selected project type
|
||||||
* @param projectTargetPlatform the target platform of the project
|
* @param projectTargetPlatform the target platform of the project
|
||||||
|
* @param sdkStyleProject whether or not a project is SDK-style
|
||||||
*/
|
*/
|
||||||
createProject(name: string, location: vscode.Uri, projectTypeId: string, projectTargetPlatform?: string): Promise<vscode.Uri>;
|
createProject(name: string, location: vscode.Uri, projectTypeId: string, projectTargetPlatform?: string, sdkStyleProject?: boolean): Promise<vscode.Uri>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the project data corresponding to the project file, to be placed in the dashboard container
|
* Gets the project data corresponding to the project file, to be placed in the dashboard container
|
||||||
@@ -131,14 +132,14 @@ declare module 'dataworkspace' {
|
|||||||
readonly defaultTargetPlatform?: string;
|
readonly defaultTargetPlatform?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Link display value for a link at the end of the project description. linkLocation also needs to be set to use this
|
* Whether or not sdk style project is an option
|
||||||
*/
|
*/
|
||||||
readonly linkDisplayValue?: string;
|
readonly sdkStyleOption?: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Location where clicking on the linkDisplayValue will go to
|
* Location where clicking on the Learn More next to SDK style checkbox will go. sdkStyleOption needs to be set to true to use this
|
||||||
*/
|
*/
|
||||||
readonly linkLocation?: string
|
readonly sdkStyleLearnMoreUrl?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ class NewProjectDialogModel {
|
|||||||
name: string = '';
|
name: string = '';
|
||||||
location: string = '';
|
location: string = '';
|
||||||
targetPlatform?: string;
|
targetPlatform?: string;
|
||||||
|
sdkStyleProject?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function openSpecificProjectNewProjectDialog(projectType: IProjectType, workspaceService: WorkspaceService): Promise<vscode.Uri | undefined> {
|
export async function openSpecificProjectNewProjectDialog(projectType: IProjectType, workspaceService: WorkspaceService): Promise<vscode.Uri | undefined> {
|
||||||
@@ -35,6 +36,7 @@ export class NewProjectDialog extends DialogBase {
|
|||||||
public model: NewProjectDialogModel = new NewProjectDialogModel();
|
public model: NewProjectDialogModel = new NewProjectDialogModel();
|
||||||
public formBuilder: azdataType.FormBuilder | undefined;
|
public formBuilder: azdataType.FormBuilder | undefined;
|
||||||
public targetPlatformDropdownFormComponent: azdataType.FormComponent | undefined;
|
public targetPlatformDropdownFormComponent: azdataType.FormComponent | undefined;
|
||||||
|
public sdkProjectCheckboxFormComponent: azdataType.FormComponent | undefined;
|
||||||
public newProjectDialogComplete: Deferred<void> | undefined;
|
public newProjectDialogComplete: Deferred<void> | undefined;
|
||||||
public newDialogPromise: Promise<void> = new Promise<void>((resolve, reject) => this.newProjectDialogComplete = { resolve, reject });
|
public newDialogPromise: Promise<void> = new Promise<void>((resolve, reject) => this.newProjectDialogComplete = { resolve, reject });
|
||||||
public projectUri: vscode.Uri | undefined;
|
public projectUri: vscode.Uri | undefined;
|
||||||
@@ -87,7 +89,7 @@ export class NewProjectDialog extends DialogBase {
|
|||||||
.withAdditionalProperties({ projectFileExtension: this.model.projectFileExtension, projectTemplateId: this.model.projectTypeId })
|
.withAdditionalProperties({ projectFileExtension: this.model.projectFileExtension, projectTemplateId: this.model.projectTypeId })
|
||||||
.send();
|
.send();
|
||||||
|
|
||||||
this.projectUri = await this.workspaceService.createProject(this.model.name, vscode.Uri.file(this.model.location), this.model.projectTypeId, this.model.targetPlatform);
|
this.projectUri = await this.workspaceService.createProject(this.model.name, vscode.Uri.file(this.model.location), this.model.projectTypeId, this.model.targetPlatform, this.model.sdkStyleProject);
|
||||||
this.newProjectDialogComplete?.resolve();
|
this.newProjectDialogComplete?.resolve();
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@@ -122,8 +124,7 @@ export class NewProjectDialog extends DialogBase {
|
|||||||
'font-weight': 'bold'
|
'font-weight': 'bold'
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
textValue: projectType.description,
|
textValue: projectType.description
|
||||||
linkDisplayValue: projectType.linkDisplayValue
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
@@ -138,15 +139,7 @@ export class NewProjectDialog extends DialogBase {
|
|||||||
selectedCardId: allProjectTypes.length > 0 ? allProjectTypes[0].id : undefined
|
selectedCardId: allProjectTypes.length > 0 ? allProjectTypes[0].id : undefined
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
projectTypeRadioCardGroup.onLinkClick(async (value) => {
|
this.register(projectTypeRadioCardGroup.onSelectionChanged(async (e) => {
|
||||||
for (let projectType of allProjectTypes) {
|
|
||||||
if (value.cardId === projectType.id) {
|
|
||||||
void vscode.env.openExternal(vscode.Uri.parse(projectType.linkLocation!));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.register(projectTypeRadioCardGroup.onSelectionChanged((e) => {
|
|
||||||
this.model.projectTypeId = e.cardId;
|
this.model.projectTypeId = e.cardId;
|
||||||
const selectedProject = allProjectTypes.find(p => p.id === e.cardId);
|
const selectedProject = allProjectTypes.find(p => p.id === e.cardId);
|
||||||
|
|
||||||
@@ -155,12 +148,30 @@ export class NewProjectDialog extends DialogBase {
|
|||||||
targetPlatformDropdown.values = selectedProject?.targetPlatforms;
|
targetPlatformDropdown.values = selectedProject?.targetPlatforms;
|
||||||
targetPlatformDropdown.value = this.getDefaultTargetPlatform(selectedProject);
|
targetPlatformDropdown.value = this.getDefaultTargetPlatform(selectedProject);
|
||||||
|
|
||||||
this.formBuilder?.addFormItem(this.targetPlatformDropdownFormComponent!);
|
this.formBuilder?.insertFormItem(this.targetPlatformDropdownFormComponent!, 3);
|
||||||
} else {
|
} else {
|
||||||
// remove the target version dropdown if the selected project type didn't provide values for this
|
// remove the target version dropdown if the selected project type didn't provide values for this
|
||||||
this.formBuilder?.removeFormItem(this.targetPlatformDropdownFormComponent!);
|
this.formBuilder?.removeFormItem(this.targetPlatformDropdownFormComponent!);
|
||||||
this.model.targetPlatform = undefined;
|
this.model.targetPlatform = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (selectedProject?.sdkStyleOption) {
|
||||||
|
sdkProjectCheckbox.checked = true;
|
||||||
|
this.model.sdkStyleProject = true;
|
||||||
|
|
||||||
|
if (selectedProject.sdkStyleLearnMoreUrl) {
|
||||||
|
await sdkLearnMore.updateProperty('url', selectedProject.sdkStyleLearnMoreUrl);
|
||||||
|
sdkFormComponentGroup.addItem(sdkLearnMore);
|
||||||
|
} else {
|
||||||
|
// remove learn more link if the project type didn't provide it
|
||||||
|
sdkFormComponentGroup.removeItem(sdkLearnMore);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.formBuilder?.addFormItem(this.sdkProjectCheckboxFormComponent!);
|
||||||
|
} else {
|
||||||
|
this.model.sdkStyleProject = false;
|
||||||
|
this.formBuilder?.removeFormItem(this.sdkProjectCheckboxFormComponent!);
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const projectNameTextBox = view.modelBuilder.inputBox().withProps({
|
const projectNameTextBox = view.modelBuilder.inputBox().withProps({
|
||||||
@@ -227,6 +238,34 @@ export class NewProjectDialog extends DialogBase {
|
|||||||
component: targetPlatformDropdown
|
component: targetPlatformDropdown
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const sdkProjectCheckbox = view.modelBuilder.checkBox().withProps({
|
||||||
|
checked: true,
|
||||||
|
label: constants.SdkStyleProject
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
this.register(sdkProjectCheckbox.onChanged(() => {
|
||||||
|
this.model.sdkStyleProject = sdkProjectCheckbox.checked;
|
||||||
|
}));
|
||||||
|
|
||||||
|
const sdkLearnMore = view.modelBuilder.hyperlink().withProps({
|
||||||
|
label: constants.LearnMore,
|
||||||
|
url: ''
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
const sdkFormComponentGroup = view.modelBuilder.flexContainer()
|
||||||
|
.withLayout({ flexFlow: 'row', alignItems: 'baseline' })
|
||||||
|
.withItems([sdkProjectCheckbox], { CSSStyles: { flex: '0 0 auto', 'margin-right': '10px' } })
|
||||||
|
.component();
|
||||||
|
|
||||||
|
if (allProjectTypes[0].sdkStyleLearnMoreUrl) {
|
||||||
|
await sdkLearnMore.updateProperty('url', allProjectTypes[0].sdkStyleLearnMoreUrl);
|
||||||
|
sdkFormComponentGroup.addItem(sdkLearnMore);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.sdkProjectCheckboxFormComponent = {
|
||||||
|
component: sdkFormComponentGroup,
|
||||||
|
};
|
||||||
|
|
||||||
this.formBuilder = view.modelBuilder.formContainer().withFormItems([
|
this.formBuilder = view.modelBuilder.formContainer().withFormItems([
|
||||||
{
|
{
|
||||||
title: constants.TypeTitle,
|
title: constants.TypeTitle,
|
||||||
@@ -250,6 +289,11 @@ export class NewProjectDialog extends DialogBase {
|
|||||||
this.formBuilder.addFormItem(this.targetPlatformDropdownFormComponent);
|
this.formBuilder.addFormItem(this.targetPlatformDropdownFormComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add sdk style checkbox is the first project has the option
|
||||||
|
if (allProjectTypes[0].sdkStyleOption) {
|
||||||
|
this.formBuilder.addFormItem(this.sdkProjectCheckboxFormComponent);
|
||||||
|
}
|
||||||
|
|
||||||
await view.initializeModel(this.formBuilder.component());
|
await view.initializeModel(this.formBuilder.component());
|
||||||
this.initDialogComplete?.resolve();
|
this.initDialogComplete?.resolve();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -197,10 +197,10 @@ export class WorkspaceService implements IWorkspaceService {
|
|||||||
return ProjectProviderRegistry.getProviderByProjectExtension(projectType);
|
return ProjectProviderRegistry.getProviderByProjectExtension(projectType);
|
||||||
}
|
}
|
||||||
|
|
||||||
async createProject(name: string, location: vscode.Uri, projectTypeId: string, projectTargetVersion?: string): Promise<vscode.Uri> {
|
async createProject(name: string, location: vscode.Uri, projectTypeId: string, projectTargetVersion?: string, sdkStyleProject?: boolean): Promise<vscode.Uri> {
|
||||||
const provider = ProjectProviderRegistry.getProviderByProjectType(projectTypeId);
|
const provider = ProjectProviderRegistry.getProviderByProjectType(projectTypeId);
|
||||||
if (provider) {
|
if (provider) {
|
||||||
const projectFile = await provider.createProject(name, location, projectTypeId, projectTargetVersion);
|
const projectFile = await provider.createProject(name, location, projectTypeId, projectTargetVersion, sdkStyleProject);
|
||||||
await this.addProjectsToWorkspace([projectFile]);
|
await this.addProjectsToWorkspace([projectFile]);
|
||||||
this._onDidWorkspaceProjectsChange.fire();
|
this._onDidWorkspaceProjectsChange.fire();
|
||||||
return projectFile;
|
return projectFile;
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ export class ProjectsController {
|
|||||||
*/
|
*/
|
||||||
public async createNewProject(creationParams: NewProjectParams): Promise<string> {
|
public async createNewProject(creationParams: NewProjectParams): Promise<string> {
|
||||||
TelemetryReporter.createActionEvent(TelemetryViews.ProjectController, TelemetryActions.createNewProject)
|
TelemetryReporter.createActionEvent(TelemetryViews.ProjectController, TelemetryActions.createNewProject)
|
||||||
.withAdditionalProperties({ template: creationParams.projectTypeId })
|
.withAdditionalProperties({ template: creationParams.projectTypeId, sdkStyle: creationParams.sdkStyle!.toString() })
|
||||||
.send();
|
.send();
|
||||||
|
|
||||||
if (creationParams.projectGuid && !UUID.isUUID(creationParams.projectGuid)) {
|
if (creationParams.projectGuid && !UUID.isUUID(creationParams.projectGuid)) {
|
||||||
@@ -171,7 +171,7 @@ export class ProjectsController {
|
|||||||
'PROJECT_DSP': creationParams.targetPlatform ? constants.targetPlatformToVersion.get(creationParams.targetPlatform)! : constants.defaultDSP
|
'PROJECT_DSP': creationParams.targetPlatform ? constants.targetPlatformToVersion.get(creationParams.targetPlatform)! : constants.defaultDSP
|
||||||
};
|
};
|
||||||
|
|
||||||
let newProjFileContents = creationParams.projectTypeId === constants.emptySqlDatabaseSdkProjectTypeId ? templates.macroExpansion(templates.newSdkSqlProjectTemplate, macroDict) : templates.macroExpansion(templates.newSqlProjectTemplate, macroDict);
|
let newProjFileContents = creationParams.sdkStyle ? templates.macroExpansion(templates.newSdkSqlProjectTemplate, macroDict) : templates.macroExpansion(templates.newSqlProjectTemplate, macroDict);
|
||||||
|
|
||||||
let newProjFileName = creationParams.newProjName;
|
let newProjFileName = creationParams.newProjName;
|
||||||
|
|
||||||
@@ -1111,7 +1111,8 @@ export class ProjectsController {
|
|||||||
const newProjFilePath = await this.createNewProject({
|
const newProjFilePath = await this.createNewProject({
|
||||||
newProjName: projectInfo.projectName,
|
newProjName: projectInfo.projectName,
|
||||||
folderUri: vscode.Uri.file(projectInfo.outputFolder),
|
folderUri: vscode.Uri.file(projectInfo.outputFolder),
|
||||||
projectTypeId: constants.emptySqlDatabaseProjectTypeId
|
projectTypeId: constants.emptySqlDatabaseProjectTypeId,
|
||||||
|
sdkStyle: false
|
||||||
});
|
});
|
||||||
|
|
||||||
const project = await Project.openProject(newProjFilePath);
|
const project = await Project.openProject(newProjFilePath);
|
||||||
@@ -1286,7 +1287,8 @@ export class ProjectsController {
|
|||||||
const newProjFilePath = await this.createNewProject({
|
const newProjFilePath = await this.createNewProject({
|
||||||
newProjName: model.projName,
|
newProjName: model.projName,
|
||||||
folderUri: vscode.Uri.file(newProjFolderUri),
|
folderUri: vscode.Uri.file(newProjFolderUri),
|
||||||
projectTypeId: model.sdkStyle ? constants.emptySqlDatabaseSdkProjectTypeId : constants.emptySqlDatabaseProjectTypeId
|
projectTypeId: model.sdkStyle ? constants.emptySqlDatabaseSdkProjectTypeId : constants.emptySqlDatabaseProjectTypeId,
|
||||||
|
sdkStyle: model.sdkStyle
|
||||||
});
|
});
|
||||||
|
|
||||||
model.filePath = path.dirname(newProjFilePath);
|
model.filePath = path.dirname(newProjFilePath);
|
||||||
@@ -1498,6 +1500,7 @@ export interface NewProjectParams {
|
|||||||
newProjName: string;
|
newProjName: string;
|
||||||
folderUri: vscode.Uri;
|
folderUri: vscode.Uri;
|
||||||
projectTypeId: string;
|
projectTypeId: string;
|
||||||
|
sdkStyle: boolean;
|
||||||
projectGuid?: string;
|
projectGuid?: string;
|
||||||
targetPlatform?: SqlTargetPlatform;
|
targetPlatform?: SqlTargetPlatform;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -381,7 +381,7 @@ export class CreateProjectFromDatabaseDialog {
|
|||||||
filePath: this.projectLocationTextBox!.value!,
|
filePath: this.projectLocationTextBox!.value!,
|
||||||
version: '1.0.0.0',
|
version: '1.0.0.0',
|
||||||
extractTarget: mapExtractTargetEnum(<string>this.folderStructureDropDown!.value),
|
extractTarget: mapExtractTargetEnum(<string>this.folderStructureDropDown!.value),
|
||||||
sdkStyle: this.sdkStyleCheckbox?.checked
|
sdkStyle: this.sdkStyleCheckbox?.checked!
|
||||||
};
|
};
|
||||||
|
|
||||||
azdataApi!.window.closeDialog(this.dialog);
|
azdataApi!.window.closeDialog(this.dialog);
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ export async function createNewProjectFromDatabaseWithQuickpick(connectionInfo?:
|
|||||||
projName: projectName,
|
projName: projectName,
|
||||||
filePath: projectLocation,
|
filePath: projectLocation,
|
||||||
version: '1.0.0.0',
|
version: '1.0.0.0',
|
||||||
extractTarget: mapExtractTargetEnum(folderStructure)
|
extractTarget: mapExtractTargetEnum(folderStructure),
|
||||||
|
sdkStyle: false // todo: add sdkstyle option to quickpick
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,5 +18,5 @@ export interface ImportDataModel {
|
|||||||
filePath: string;
|
filePath: string;
|
||||||
version: string;
|
version: string;
|
||||||
extractTarget: ExtractTarget;
|
extractTarget: ExtractTarget;
|
||||||
sdkStyle?: boolean;
|
sdkStyle: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,31 +36,24 @@ export class SqlDatabaseProjectProvider implements dataworkspace.IProjectProvide
|
|||||||
*/
|
*/
|
||||||
get supportedProjectTypes(): dataworkspace.IProjectType[] {
|
get supportedProjectTypes(): dataworkspace.IProjectType[] {
|
||||||
return [{
|
return [{
|
||||||
id: constants.emptySqlDatabaseSdkProjectTypeId,
|
|
||||||
projectFileExtension: constants.sqlprojExtension.replace(/\./g, ''),
|
|
||||||
displayName: constants.emptySdkProjectTypeDisplayName,
|
|
||||||
description: constants.emptySdkProjectTypeDescription,
|
|
||||||
icon: IconPathHelper.colorfulSqlProject,
|
|
||||||
targetPlatforms: Array.from(constants.targetPlatformToVersion.keys()),
|
|
||||||
defaultTargetPlatform: constants.defaultTargetPlatform,
|
|
||||||
linkDisplayValue: constants.learnMore,
|
|
||||||
linkLocation: constants.sdkLearnMoreUrl
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: constants.emptySqlDatabaseProjectTypeId,
|
id: constants.emptySqlDatabaseProjectTypeId,
|
||||||
projectFileExtension: constants.sqlprojExtension.replace(/\./g, ''),
|
projectFileExtension: constants.sqlprojExtension.replace(/\./g, ''),
|
||||||
displayName: constants.emptyProjectTypeDisplayName,
|
displayName: constants.emptyProjectTypeDisplayName,
|
||||||
description: constants.emptyProjectTypeDescription,
|
description: constants.emptyProjectTypeDescription,
|
||||||
icon: IconPathHelper.colorfulSqlProject,
|
icon: IconPathHelper.colorfulSqlProject,
|
||||||
targetPlatforms: Array.from(constants.targetPlatformToVersion.keys()),
|
targetPlatforms: Array.from(constants.targetPlatformToVersion.keys()),
|
||||||
defaultTargetPlatform: constants.defaultTargetPlatform
|
defaultTargetPlatform: constants.defaultTargetPlatform,
|
||||||
|
sdkStyleOption: true,
|
||||||
|
sdkStyleLearnMoreUrl: constants.sdkLearnMoreUrl
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: constants.edgeSqlDatabaseProjectTypeId,
|
id: constants.edgeSqlDatabaseProjectTypeId,
|
||||||
projectFileExtension: constants.sqlprojExtension.replace(/\./g, ''),
|
projectFileExtension: constants.sqlprojExtension.replace(/\./g, ''),
|
||||||
displayName: constants.edgeProjectTypeDisplayName,
|
displayName: constants.edgeProjectTypeDisplayName,
|
||||||
description: constants.edgeProjectTypeDescription,
|
description: constants.edgeProjectTypeDescription,
|
||||||
icon: IconPathHelper.sqlEdgeProject
|
icon: IconPathHelper.sqlEdgeProject,
|
||||||
|
sdkStyleOption: true,
|
||||||
|
sdkStyleLearnMoreUrl: constants.sdkLearnMoreUrl
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,12 +64,13 @@ export class SqlDatabaseProjectProvider implements dataworkspace.IProjectProvide
|
|||||||
* @param projectTypeId the ID of the project/template
|
* @param projectTypeId the ID of the project/template
|
||||||
* @returns Uri of the newly created project file
|
* @returns Uri of the newly created project file
|
||||||
*/
|
*/
|
||||||
async createProject(name: string, location: vscode.Uri, projectTypeId: string, targetPlatform?: sqldbproj.SqlTargetPlatform): Promise<vscode.Uri> {
|
async createProject(name: string, location: vscode.Uri, projectTypeId: string, targetPlatform?: sqldbproj.SqlTargetPlatform, sdkStyle: boolean = true): Promise<vscode.Uri> {
|
||||||
const projectFile = await this.projectController.createNewProject({
|
const projectFile = await this.projectController.createNewProject({
|
||||||
newProjName: name,
|
newProjName: name,
|
||||||
folderUri: location,
|
folderUri: location,
|
||||||
projectTypeId: projectTypeId,
|
projectTypeId: projectTypeId,
|
||||||
targetPlatform: targetPlatform
|
targetPlatform: targetPlatform,
|
||||||
|
sdkStyle: sdkStyle
|
||||||
});
|
});
|
||||||
|
|
||||||
return vscode.Uri.file(projectFile);
|
return vscode.Uri.file(projectFile);
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ describe('Publish Database Dialog', () => {
|
|||||||
newProjName: 'TestProjectName',
|
newProjName: 'TestProjectName',
|
||||||
folderUri: vscode.Uri.file(projFileDir),
|
folderUri: vscode.Uri.file(projFileDir),
|
||||||
projectTypeId: emptySqlDatabaseProjectTypeId,
|
projectTypeId: emptySqlDatabaseProjectTypeId,
|
||||||
projectGuid: 'BA5EBA11-C0DE-5EA7-ACED-BABB1E70A575'
|
projectGuid: 'BA5EBA11-C0DE-5EA7-ACED-BABB1E70A575',
|
||||||
|
sdkStyle: false
|
||||||
});
|
});
|
||||||
|
|
||||||
const project = new Project(projFilePath);
|
const project = new Project(projFilePath);
|
||||||
@@ -54,7 +55,8 @@ describe('Publish Database Dialog', () => {
|
|||||||
newProjName: 'TestProjectName',
|
newProjName: 'TestProjectName',
|
||||||
folderUri: vscode.Uri.file(projFileDir),
|
folderUri: vscode.Uri.file(projFileDir),
|
||||||
projectTypeId: emptySqlDatabaseProjectTypeId,
|
projectTypeId: emptySqlDatabaseProjectTypeId,
|
||||||
projectGuid: 'BA5EBA11-C0DE-5EA7-ACED-BABB1E70A575'
|
projectGuid: 'BA5EBA11-C0DE-5EA7-ACED-BABB1E70A575',
|
||||||
|
sdkStyle: false
|
||||||
});
|
});
|
||||||
|
|
||||||
const project = new Project(projFilePath);
|
const project = new Project(projFilePath);
|
||||||
|
|||||||
@@ -59,7 +59,8 @@ describe('ProjectsController', function (): void {
|
|||||||
newProjName: 'TestProjectName',
|
newProjName: 'TestProjectName',
|
||||||
folderUri: vscode.Uri.file(projFileDir),
|
folderUri: vscode.Uri.file(projFileDir),
|
||||||
projectTypeId: constants.emptySqlDatabaseProjectTypeId,
|
projectTypeId: constants.emptySqlDatabaseProjectTypeId,
|
||||||
projectGuid: 'BA5EBA11-C0DE-5EA7-ACED-BABB1E70A575'
|
projectGuid: 'BA5EBA11-C0DE-5EA7-ACED-BABB1E70A575',
|
||||||
|
sdkStyle: false
|
||||||
});
|
});
|
||||||
|
|
||||||
let projFileText = (await fs.readFile(projFilePath)).toString();
|
let projFileText = (await fs.readFile(projFilePath)).toString();
|
||||||
@@ -77,7 +78,8 @@ describe('ProjectsController', function (): void {
|
|||||||
folderUri: vscode.Uri.file(projFileDir),
|
folderUri: vscode.Uri.file(projFileDir),
|
||||||
projectTypeId: constants.emptySqlDatabaseProjectTypeId,
|
projectTypeId: constants.emptySqlDatabaseProjectTypeId,
|
||||||
projectGuid: 'BA5EBA11-C0DE-5EA7-ACED-BABB1E70A575',
|
projectGuid: 'BA5EBA11-C0DE-5EA7-ACED-BABB1E70A575',
|
||||||
targetPlatform: projTargetPlatform
|
targetPlatform: projTargetPlatform,
|
||||||
|
sdkStyle: false
|
||||||
});
|
});
|
||||||
|
|
||||||
const project = await Project.openProject(projFilePath);
|
const project = await Project.openProject(projFilePath);
|
||||||
@@ -496,7 +498,8 @@ describe('ProjectsController', function (): void {
|
|||||||
projName: 'testProject',
|
projName: 'testProject',
|
||||||
filePath: 'testLocation',
|
filePath: 'testLocation',
|
||||||
version: '1.0.0.0',
|
version: '1.0.0.0',
|
||||||
extractTarget: mssql.ExtractTarget['schemaObjectType']
|
extractTarget: mssql.ExtractTarget['schemaObjectType'],
|
||||||
|
sdkStyle: false
|
||||||
});
|
});
|
||||||
|
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
@@ -520,7 +523,7 @@ describe('ProjectsController', function (): void {
|
|||||||
let folderPath = await testUtils.generateTestFolderPath();
|
let folderPath = await testUtils.generateTestFolderPath();
|
||||||
let projectName = 'My Project';
|
let projectName = 'My Project';
|
||||||
let importPath;
|
let importPath;
|
||||||
let model: ImportDataModel = { connectionUri: 'My Id', database: 'My Database', projName: projectName, filePath: folderPath, version: '1.0.0.0', extractTarget: mssql.ExtractTarget['file'] };
|
let model: ImportDataModel = { connectionUri: 'My Id', database: 'My Database', projName: projectName, filePath: folderPath, version: '1.0.0.0', extractTarget: mssql.ExtractTarget['file'], sdkStyle: false };
|
||||||
|
|
||||||
const projController = new ProjectsController(testContext.outputChannel);
|
const projController = new ProjectsController(testContext.outputChannel);
|
||||||
projController.setFilePath(model);
|
projController.setFilePath(model);
|
||||||
@@ -533,7 +536,7 @@ describe('ProjectsController', function (): void {
|
|||||||
let folderPath = await testUtils.generateTestFolderPath();
|
let folderPath = await testUtils.generateTestFolderPath();
|
||||||
let projectName = 'My Project';
|
let projectName = 'My Project';
|
||||||
let importPath;
|
let importPath;
|
||||||
let model: ImportDataModel = { connectionUri: 'My Id', database: 'My Database', projName: projectName, filePath: folderPath, version: '1.0.0.0', extractTarget: mssql.ExtractTarget['schemaObjectType'] };
|
let model: ImportDataModel = { connectionUri: 'My Id', database: 'My Database', projName: projectName, filePath: folderPath, version: '1.0.0.0', extractTarget: mssql.ExtractTarget['schemaObjectType'], sdkStyle: false };
|
||||||
|
|
||||||
const projController = new ProjectsController(testContext.outputChannel);
|
const projController = new ProjectsController(testContext.outputChannel);
|
||||||
projController.setFilePath(model);
|
projController.setFilePath(model);
|
||||||
|
|||||||
Reference in New Issue
Block a user