Add support for target location in tasks (#10179)

* Add support for target location in tasks

* bump sqltoolsservice to get addition of targetLocation to TaskNode
This commit is contained in:
Kim Santiago
2020-04-28 15:35:40 -07:00
committed by GitHub
parent 4ec281313f
commit 11f6790630
5 changed files with 23 additions and 6 deletions

View File

@@ -103,11 +103,18 @@ export class TaskHistoryRenderer implements IRenderer {
templateData.label.textContent = element.taskName + ' ' + taskStatus;
templateData.label.title = templateData.label.textContent;
let description: string;
// Determine the target name and set hover text equal to that
let description = element.serverName;
if (element.databaseName) {
description += ' | ' + element.databaseName;
// show target location if there is one, otherwise show server and database name
if (element.targetLocation) {
description = element.targetLocation;
} else {
description = element.serverName;
if (element.databaseName) {
description += ' | ' + element.databaseName;
}
}
templateData.description.textContent = description;
templateData.description.title = templateData.description.textContent;

View File

@@ -43,6 +43,11 @@ export class TaskNode {
*/
public databaseName?: string;
/**
* Target Location
*/
public targetLocation?: string;
/**
* Provider Name
*/
@@ -99,7 +104,7 @@ export class TaskNode {
*/
public script?: string;
constructor(taskName: string, serverName?: string, databaseName?: string, taskId: string | undefined = undefined, taskExecutionMode: TaskExecutionMode = TaskExecutionMode.execute, isCancelable: boolean = true) {
constructor(taskName: string, serverName?: string, databaseName?: string, taskId: string | undefined = undefined, taskExecutionMode: TaskExecutionMode = TaskExecutionMode.execute, isCancelable: boolean = true, targetLocation?: string) {
this.id = taskId || generateUuid();
this.taskName = taskName;
@@ -111,5 +116,6 @@ export class TaskNode {
this.hasChildren = false;
this.taskExecutionMode = taskExecutionMode;
this.isCancelable = isCancelable;
this.targetLocation = targetLocation;
}
}

View File

@@ -88,7 +88,7 @@ export class TaskService implements ITaskService {
serverName = connectionProfile.serverName;
}
}
let node: TaskNode = new TaskNode(taskInfo.name, serverName, databaseName, taskInfo.taskId, taskInfo.taskExecutionMode, taskInfo.isCancelable);
let node: TaskNode = new TaskNode(taskInfo.name, serverName, databaseName, taskInfo.taskId, taskInfo.taskExecutionMode, taskInfo.isCancelable, taskInfo.targetLocation);
node.providerName = taskInfo.providerName;
this.handleNewTask(node);
}