Agent - Step Actions (#2779)

* fixed right click context menu bug in jobs view

* added stepInfo and edit job WIP

* show jobs in job edit

* added schedule description on select schedule

* fetch schedules during history and show in edit job

* added alerts to job histories and show in edit

* made history calls async

* filter menus now close when esc is pressed

* fixed bug where clicking on error row wouldnt populate job details

* added functionality to delete steps in a job

* added real time adding steps in edit job
This commit is contained in:
Aditya Bist
2018-10-09 10:28:55 -07:00
committed by GitHub
parent 7aa2ee08bf
commit c800e70ec1
18 changed files with 190 additions and 77 deletions

View File

@@ -6,37 +6,47 @@
import { AgentUtils } from '../agentUtils';
import { IAgentDialogData, AgentDialogMode } from '../interfaces';
import { JobData } from './jobData';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
export class JobStepData implements IAgentDialogData {
// Error Messages
private readonly CreateStepErrorMessage_JobNameIsEmpty = localize('stepData.jobNameRequired', 'Job name must be provided');
private readonly CreateStepErrorMessage_StepNameIsEmpty = localize('stepData.stepNameRequired', 'Step name must be provided');
public dialogMode: AgentDialogMode = AgentDialogMode.CREATE;
public ownerUri: string;
public jobId: string; //
public jobId: string;
public jobName: string;
public script: string; //
public script: string;
public scriptName: string;
public stepName: string; //
public subSystem: string; //
public stepName: string;
public subSystem: string;
public id: number;
public failureAction: string; //
public successAction: string; //
public failureAction: string;
public successAction: string;
public failStepId: number;
public successStepId: number;
public command: string;
public commandExecutionSuccessCode: number;
public databaseName: string; //
public databaseName: string;
public databaseUserName: string;
public server: string;
public outputFileName: string; //
public outputFileName: string;
public appendToLogFile: boolean;
public appendToStepHist: boolean;
public writeLogToTable: boolean;
public appendLogToTable: boolean;
public retryAttempts: number; //
public retryInterval: number; //
public retryAttempts: number;
public retryInterval: number;
public proxyName: string;
constructor(ownerUri:string) {
constructor(ownerUri:string, jobModel?: JobData) {
this.ownerUri = ownerUri;
this.jobName = jobModel.name;
}
public async initialize() {
@@ -51,7 +61,7 @@ export class JobStepData implements IAgentDialogData {
scriptName: this.scriptName,
stepName: this.stepName,
subSystem: this.subSystem,
id: 1,
id: this.id,
failureAction: this.failureAction,
successAction: this.successAction,
failStepId: this.failStepId,
@@ -70,7 +80,26 @@ export class JobStepData implements IAgentDialogData {
retryInterval: this.retryInterval,
proxyName: this.proxyName
}).then(result => {
console.info(result);
if (result && result.success) {
console.info(result);
}
});
}
public validate(): { valid: boolean, errorMessages: string[] } {
let validationErrors: string[] = [];
if (!(this.stepName && this.stepName.trim())) {
validationErrors.push(this.CreateStepErrorMessage_StepNameIsEmpty);
}
if (!(this.jobName && this.jobName.trim())) {
validationErrors.push(this.CreateStepErrorMessage_JobNameIsEmpty);
}
return {
valid: validationErrors.length === 0,
errorMessages: validationErrors
};
}
}