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

@@ -30,6 +30,31 @@ export const edgeSqlDatabaseProjectTypeId = 'SqlDbEdgeProj';
export const edgeProjectTypeDisplayName = localize('edgeProjectTypeDisplayName', "SQL Edge");
export const edgeProjectTypeDescription = localize('edgeProjectTypeDescription', "Start with the core pieces to develop and publish schemas for SQL Edge");
// Dashboard
export const addItemAction = localize('addItemAction', "Add Item");
export const schemaCompareAction = localize('schemaCompareAction', "Schema Compare");
export const buildAction = localize('buildAction', "Build");
export const publishAction = localize('publishAction', "Publish");
export const changeTargetPlatformAction = localize('changeTargetPlatformAction', "Change Target Platform");
export const ID = localize('ID', "ID");
export const Status = localize('Status', "Status");
export const Time = localize('Time', "Time");
export const Date = localize('Date', "Date");
export const Builds = localize('Builds', "Builds");
export const Deployments = localize('Deployments', "Deployments");
export const Success = localize('Success', "Success");
export const Failed = localize('Failed', "Failed");
export const InProgress = localize('InProgress', "In progress");
export const hr = localize('hr', "hr");
export const min = localize('min', "min");
export const sec = localize('sec', "sec");
export const msec = localize('msec', "msec");
export const at = localize('at', "at");
// commands
export const revealFileInOsCommand = 'revealFileInOS';
export const schemaCompareStartCommand = 'schemaCompare.start';

View File

@@ -29,6 +29,16 @@ export class IconPathHelper {
public static folder: IconPath;
public static add: IconPath;
public static build: IconPath;
public static publish: IconPath;
public static schemaCompare: IconPath;
public static targetPlatform: IconPath;
public static success: IconPath;
public static error: IconPath;
public static inProgress: IconPath;
public static setExtensionContext(extensionContext: vscode.ExtensionContext) {
IconPathHelper.extensionContext = extensionContext;
@@ -48,6 +58,16 @@ export class IconPathHelper {
IconPathHelper.connect = IconPathHelper.makeIcon('connect', true);
IconPathHelper.folder = IconPathHelper.makeIcon('folder');
IconPathHelper.add = IconPathHelper.makeIcon('add', true);
IconPathHelper.build = IconPathHelper.makeIcon('build', true);
IconPathHelper.publish = IconPathHelper.makeIcon('publish', true);
IconPathHelper.schemaCompare = IconPathHelper.makeIcon('schemaCompare', true);
IconPathHelper.targetPlatform = IconPathHelper.makeIcon('targetPlatform', true);
IconPathHelper.success = IconPathHelper.makeIcon('success', true);
IconPathHelper.error = IconPathHelper.makeIcon('error', true);
IconPathHelper.inProgress = IconPathHelper.makeIcon('inProgress', true);
}
private static makeIcon(name: string, sameIcon: boolean = false) {

View File

@@ -284,3 +284,37 @@ export function getPackageInfo(packageJson?: any): IPackageInfo | undefined {
return undefined;
}
/**
* Converts time in milliseconds to hr, min, sec
* @param duration time in milliseconds
* @returns string in "hr, min, sec" or "msec" format
*/
export function timeConversion(duration: number): string {
const portions: string[] = [];
const msInHour = 1000 * 60 * 60;
const hours = Math.trunc(duration / msInHour);
if (hours > 0) {
portions.push(`${hours} ${constants.hr}`);
duration = duration - (hours * msInHour);
}
const msInMinute = 1000 * 60;
const minutes = Math.trunc(duration / msInMinute);
if (minutes > 0) {
portions.push(`${minutes} ${constants.min}`);
duration = duration - (minutes * msInMinute);
}
const seconds = Math.trunc(duration / 1000);
if (seconds > 0) {
portions.push(`${seconds} ${constants.sec}`);
}
if (hours === 0 && minutes === 0 && seconds === 0) {
portions.push(`${duration} ${constants.msec}`);
}
return portions.join(', ');
}