Jobs - New step (WIP) (#1711)

* added jobs view toolbar

* create job command and dialog stub

* add tab content and wire up the provider

* fix the steps tab error

* create job dialog 6/15 changes

* general tab done

* success action and retries completed

* added failure action dropdown

* add notification tab checkbox events

* added AgentJobStepInfo objects in sqlops

* create job dialog - 0618 update 1

* added model save function

* width for controls and initial state for notification tab controls

* refresh master and changes to work with latest code

* fixed next and prev button positions

* new step dialog ui finished

* implemented parse button

* fix package file

* add validation and sub-items collections

* hook up the step creation dialog - step 1

* merged master
This commit is contained in:
Aditya Bist
2018-06-26 11:09:41 -07:00
committed by GitHub
parent ca755365ce
commit 3e3ff163db
27 changed files with 6878 additions and 718 deletions

View File

@@ -6,9 +6,9 @@
import 'vs/css!./jobHistory';
import 'vs/css!sql/media/icons/common-icons';
import { OnInit, OnChanges, Component, Inject, Input, forwardRef, ElementRef, ChangeDetectorRef, ViewChild, ChangeDetectionStrategy, Injectable } from '@angular/core';
import { AgentJobHistoryInfo, AgentJobInfo } from 'sqlops';
import { Taskbar } from 'sql/base/browser/ui/taskbar/taskbar';
import { RunJobAction, StopJobAction } from 'sql/parts/jobManagement/views/jobHistoryActions';
import * as sqlops from 'sqlops';
import { Taskbar, ITaskbarContent } from 'sql/base/browser/ui/taskbar/taskbar';
import { RunJobAction, StopJobAction, NewStepAction } from 'sql/parts/jobManagement/views/jobActions';
import { JobCacheObject } from 'sql/parts/jobManagement/common/jobManagementService';
import { AgentJobUtilities } from '../common/agentJobUtilities';
import { IJobManagementService } from '../common/interfaces';
@@ -46,9 +46,9 @@ export class JobHistoryComponent extends Disposable implements OnInit {
@ViewChild('table') private _tableContainer: ElementRef;
@ViewChild('actionbarContainer') private _actionbarContainer: ElementRef;
@Input() public agentJobInfo: AgentJobInfo = undefined;
@Input() public agentJobHistories: AgentJobHistoryInfo[] = undefined;
public agentJobHistoryInfo: AgentJobHistoryInfo = undefined;
@Input() public agentJobInfo: sqlops.AgentJobInfo = undefined;
@Input() public agentJobHistories: sqlops.AgentJobHistoryInfo[] = undefined;
public agentJobHistoryInfo: sqlops.AgentJobHistoryInfo = undefined;
private _isVisible: boolean = false;
private _stepRows: JobStepsViewRow[] = [];
@@ -56,8 +56,9 @@ export class JobHistoryComponent extends Disposable implements OnInit {
private _showPreviousRuns: boolean = undefined;
private _runStatus: string = undefined;
private _jobCacheObject: JobCacheObject;
private _agentJobInfo: AgentJobInfo;
private _agentJobInfo: sqlops.AgentJobInfo;
private _noJobsAvailable: boolean = false;
private _serverName: string;
constructor(
@Inject(forwardRef(() => ElementRef)) el: ElementRef,
@@ -76,14 +77,14 @@ export class JobHistoryComponent extends Disposable implements OnInit {
this._treeRenderer = new JobHistoryRenderer();
this._treeFilter = new JobHistoryFilter();
let jobCacheObjectMap = this._jobManagementService.jobCacheObjectMap;
let serverName = _dashboardService.connectionManagementService.connectionInfo.connectionProfile.serverName;
let jobCache = jobCacheObjectMap[serverName];
this._serverName = _dashboardService.connectionManagementService.connectionInfo.connectionProfile.serverName;
let jobCache = jobCacheObjectMap[this._serverName];
if (jobCache) {
this._jobCacheObject = jobCache;
} else {
this._jobCacheObject = new JobCacheObject();
this._jobCacheObject.serverName = serverName;
this._jobManagementService.addToCache(serverName, this._jobCacheObject);
this._jobCacheObject.serverName = this._serverName;
this._jobManagementService.addToCache(this._serverName, this._jobCacheObject);
}
}
@@ -210,7 +211,7 @@ export class JobHistoryComponent extends Disposable implements OnInit {
}
}
private buildHistoryTree(self: any, jobHistories: AgentJobHistoryInfo[]) {
private buildHistoryTree(self: any, jobHistories: sqlops.AgentJobHistoryInfo[]) {
self._treeController.jobHistories = jobHistories;
self._jobCacheObject.setJobHistory(self._agentViewComponent.jobId, jobHistories);
let jobHistoryRows = this._treeController.jobHistories.map(job => self.convertToJobHistoryRow(job));
@@ -237,7 +238,7 @@ export class JobHistoryComponent extends Disposable implements OnInit {
this._agentViewComponent.showHistory = false;
}
private convertToJobHistoryRow(historyInfo: AgentJobHistoryInfo): JobHistoryRow {
private convertToJobHistoryRow(historyInfo: sqlops.AgentJobHistoryInfo): JobHistoryRow {
let jobHistoryRow = new JobHistoryRow();
jobHistoryRow.runDate = this.formatTime(historyInfo.runDate);
jobHistoryRow.runStatus = AgentJobUtilities.convertToStatusString(historyInfo.runStatus);
@@ -263,12 +264,14 @@ export class JobHistoryComponent extends Disposable implements OnInit {
private _initActionBar() {
let runJobAction = this.instantiationService.createInstance(RunJobAction);
let stopJobAction = this.instantiationService.createInstance(StopJobAction);
let newStepAction = this.instantiationService.createInstance(NewStepAction);
let taskbar = <HTMLElement>this._actionbarContainer.nativeElement;
this._actionBar = new Taskbar(taskbar, this.contextMenuService);
this._actionBar.context = this;
this._actionBar.setContent([
{ action: runJobAction },
{ action: stopJobAction }
{ action: stopJobAction },
{ action: newStepAction }
]);
}
@@ -286,6 +289,10 @@ export class JobHistoryComponent extends Disposable implements OnInit {
return this._dashboardService.connectionManagementService.connectionInfo.ownerUri;
}
public get serverName(): string {
return this._serverName;
}
/** SETTERS */
public set showSteps(value: boolean) {