Sql DB project dashboard (#14899)

* First set of changes for workspace dashboard implementing the toolbar

* Workspace dashboard container implementation (#14813)

* First set of changes for workspace dashboard implementing the toolbar (#14160)

* First set of changes for workspace dashboard implementing the toolbar

* Addressed comments

* Addressed one remaining comment

* Removed an extra comma in interfaces file

* Addressed comments

* Addressed comments

* Refactored a bit of code

* Remove unnecessary await

* Addressed comments

* First set of changes for workspace dashboard container

* Update targetPlatform icon+add Time column to deploy table

* Addressed comments

* Removed redundant class definition

* Addressed comments

* Addressed comments

* Change enum to union type in dataworkspace typings

* Fix tests

* Addressed comments
This commit is contained in:
Sakshi Sharma
2021-03-30 17:37:53 -07:00
committed by GitHub
parent 4df77c73bf
commit b774f09b6c
25 changed files with 855 additions and 25 deletions

View File

@@ -77,7 +77,45 @@ export class SqlDatabaseProjectProvider implements dataworkspace.IProjectProvide
}
/**
* Adds the list of files and directories to the project, and saves the project file
* Gets the supported project types
*/
get projectActions(): (dataworkspace.IProjectAction | dataworkspace.IProjectActionGroup)[] {
const addItemAction: dataworkspace.IProjectAction = {
id: constants.addItemAction,
icon: IconPathHelper.add,
run: (treeItem: dataworkspace.WorkspaceTreeItem) => this.projectController.addItemPromptFromNode(treeItem)
};
const schemaCompareAction: dataworkspace.IProjectAction = {
id: constants.schemaCompareAction,
icon: IconPathHelper.schemaCompare,
run: (treeItem: dataworkspace.WorkspaceTreeItem) => this.projectController.schemaCompare(treeItem)
};
const buildAction: dataworkspace.IProjectAction = {
id: constants.buildAction,
icon: IconPathHelper.build,
run: (treeItem: dataworkspace.WorkspaceTreeItem) => this.projectController.buildProject(treeItem)
};
const publishAction: dataworkspace.IProjectAction = {
id: constants.publishAction,
icon: IconPathHelper.publish,
run: (treeItem: dataworkspace.WorkspaceTreeItem) => this.projectController.publishProject(treeItem)
};
const changeTargetPlatformAction: dataworkspace.IProjectAction = {
id: constants.changeTargetPlatformAction,
icon: IconPathHelper.targetPlatform,
run: (treeItem: dataworkspace.WorkspaceTreeItem) => this.projectController.changeTargetPlatform(treeItem)
};
let group: dataworkspace.IProjectActionGroup = { actions: [addItemAction, schemaCompareAction, buildAction, publishAction] };
return [group, changeTargetPlatformAction];
}
/** Adds the list of files and directories to the project, and saves the project file
* @param projectFile The Uri of the project file
* @param list list of uris of files and folders to add. Files and folders must already exist. Files and folders must already exist. No files or folders will be added if any do not exist.
*/
@@ -85,4 +123,31 @@ export class SqlDatabaseProjectProvider implements dataworkspace.IProjectProvide
const project = await Project.openProject(projectFile.fsPath);
await project.addToProject(list);
}
/**
* Gets the data to be displayed in the project dashboard
*/
get dashboardComponents(): dataworkspace.IDashboardTable[] {
const deployInfo: dataworkspace.IDashboardTable = {
name: constants.Deployments,
columns: [{ displayName: constants.ID, width: 75 },
{ displayName: constants.Status, width: 180, type: 'icon' },
{ displayName: constants.Target, width: 180 },
{ displayName: constants.Time, width: 180 },
{ displayName: constants.Date, width: 180 }],
data: this.projectController.dashboardDeployData
};
const buildInfo: dataworkspace.IDashboardTable = {
name: constants.Builds,
columns: [{ displayName: constants.ID, width: 75 },
{ displayName: constants.Status, width: 180, type: 'icon' },
{ displayName: constants.Target, width: 180 },
{ displayName: constants.Time, width: 180 },
{ displayName: constants.Date, width: 180 }],
data: this.projectController.dashboardBuildData
};
return [deployInfo, buildInfo];
}
}