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

@@ -10,6 +10,7 @@ import { JobStepDialog } from './jobStepDialog';
import { PickScheduleDialog } from './pickScheduleDialog';
import { AlertDialog } from './alertDialog';
import { AgentDialog } from './agentDialog';
import { AgentUtils } from '../agentUtils';
const localize = nls.loadMessageBundle();
@@ -234,10 +235,14 @@ export class JobDialog extends AgentDialog<JobData> {
width: 80
}).component();
let stepDialog = new JobStepDialog(this.model.ownerUri, '' , data.length + 1, this.model);
stepDialog.onSuccess((step) => {
this.model.jobSteps.push(step);
this.stepsTable.data = this.convertStepsToData(this.model.jobSteps);
});
this.newStepButton.onDidClick((e)=>{
if (this.nameTextBox.value && this.nameTextBox.value.length > 0) {
let stepDialog = new JobStepDialog(this.model.ownerUri, this.nameTextBox.value, '' , 1, this.model);
stepDialog.openNewStepDialog();
stepDialog.openDialog();
} else {
this.dialog.message = { text: this.BlankJobNameErrorText };
}
@@ -273,9 +278,17 @@ export class JobDialog extends AgentDialog<JobData> {
});
this.deleteStepButton.onDidClick((e) => {
// implement delete steps
AgentUtils.getAgentService().then((agentService) => {
let steps = this.model.jobSteps ? this.model.jobSteps : [];
agentService.deleteJobStep(this.ownerUri, stepData).then((result) => {
if (result && result.success) {
delete steps[rowNumber];
this.model.jobSteps = steps;
let data = this.convertStepsToData(steps);
this.stepsTable.data = data;
}
});
});
});
}
});
@@ -529,7 +542,6 @@ export class JobDialog extends AgentDialog<JobData> {
let result = [];
alerts.forEach(alert => {
let cols = [];
console.log(alert);
cols.push(alert.name);
cols.push(alert.isEnabled);
cols.push(alert.alertType.toString());