Show file location for dacfx extract and export (#936)

* show file location for dacfx extract and export

* Add TargetDestination field to TaskInfo

* remove setting database and server name to null if there's packageFilePath

* remove unnecessary parameter
This commit is contained in:
Kim Santiago
2020-04-27 17:37:08 -07:00
committed by GitHub
parent bcc1f2a486
commit 314627f83c
4 changed files with 16 additions and 2 deletions

View File

@@ -227,7 +227,9 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx
{
try
{
TaskMetadata metadata = TaskMetadata.Create(parameters, taskName, operation, ConnectionServiceInstance);
// show file location for export and extract operations
string targetLocation = (operation is ExportOperation || operation is ExtractOperation) ? parameters.PackageFilePath : null;
TaskMetadata metadata = TaskMetadata.Create(parameters, taskName, operation, ConnectionServiceInstance, targetLocation);
// put appropriate database name since connection passed was to master
metadata.DatabaseName = parameters.DatabaseName;

View File

@@ -35,6 +35,11 @@ namespace Microsoft.SqlTools.ServiceLayer.TaskServices.Contracts
/// </summary>
public string DatabaseName { get; set; }
/// <summary>
/// Target location for this task
/// </summary>
public string TargetLocation { get; set; }
/// <summary>
/// Task name which defines the type of the task (e.g. CreateDatabase, Backup)
/// </summary>

View File

@@ -474,6 +474,7 @@ namespace Microsoft.SqlTools.ServiceLayer.TaskServices
Description = TaskMetadata.Description,
TaskExecutionMode = TaskMetadata.TaskExecutionMode,
IsCancelable = this.TaskToCancel != null,
TargetLocation = TaskMetadata.TargetLocation,
};
}

View File

@@ -41,6 +41,11 @@ namespace Microsoft.SqlTools.ServiceLayer.TaskServices
/// </summary>
public string DatabaseName { get; set; }
/// <summary>
/// Target location of this task
/// </summary>
public string TargetLocation { get; set; }
/// <summary>
/// Data required to perform the task
/// </summary>
@@ -59,7 +64,7 @@ namespace Microsoft.SqlTools.ServiceLayer.TaskServices
/// <param name="taskOperation">Task operation</param>
/// <param name="connectionService">Connection Service</param>
/// <returns>Task metadata</returns>
public static TaskMetadata Create(IRequestParams requestParam, string taskName, ITaskOperation taskOperation, ConnectionService connectionService)
public static TaskMetadata Create(IRequestParams requestParam, string taskName, ITaskOperation taskOperation, ConnectionService connectionService, string targetLocation = null)
{
TaskMetadata taskMetadata = new TaskMetadata();
ConnectionInfo connInfo;
@@ -90,6 +95,7 @@ namespace Microsoft.SqlTools.ServiceLayer.TaskServices
taskMetadata.TaskOperation = taskOperation;
taskMetadata.OwnerUri = requestParam.OwnerUri;
taskMetadata.TargetLocation = targetLocation;
return taskMetadata;
}