Agent - committer work (#4758)

* fix delete job

* added the ability to change and retrieve jobowner

* fixed UX for delete step

* improved operator actions

* fixed operators and proxies

* added errors for failures
This commit is contained in:
Aditya Bist
2019-03-29 13:46:52 -07:00
committed by GitHub
parent e70d5838a8
commit d4f287298f
9 changed files with 99 additions and 59 deletions

View File

@@ -202,7 +202,7 @@ export class JobDialog extends AgentDialog<JobData> {
await view.initializeModel(formModel);
this.nameTextBox.value = this.model.name;
this.ownerTextBox.value = this.model.defaultOwner;
this.ownerTextBox.value = this.model.owner;
this.categoryDropdown.values = this.model.jobCategories;
let idx: number = undefined;
@@ -349,13 +349,13 @@ export class JobDialog extends AgentDialog<JobData> {
}
});
this.deleteStepButton.onDidClick(() => {
this.deleteStepButton.onDidClick(async() => {
if (this.stepsTable.selectedRows.length === 1) {
let rowNumber = this.stepsTable.selectedRows[0];
AgentUtils.getAgentService().then((agentService) => {
AgentUtils.getAgentService().then(async (agentService) => {
let stepData = this.steps[rowNumber];
if (stepData.jobId) {
agentService.deleteJobStep(this.ownerUri, stepData).then((result) => {
await agentService.deleteJobStep(this.ownerUri, stepData).then((result) => {
if (result && result.success) {
this.steps.splice(rowNumber, 1);
let data = this.convertStepsToData(this.steps);

View File

@@ -97,20 +97,18 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
this.generalTab.registerContent(async view => {
this.nameTextBox = view.modelBuilder.inputBox().component();
this.enabledCheckBox = view.modelBuilder.checkBox()
.withProperties({
label: OperatorDialog.EnabledCheckboxLabel
}).component();
this.enabledCheckBox.checked = true;
this.nameTextBox.value = this.model.name;
this.emailNameTextBox = view.modelBuilder.inputBox().component();
this.emailNameTextBox.value = this.model.emailAddress;
this.pagerEmailNameTextBox = view.modelBuilder.inputBox().component();
this.pagerEmailNameTextBox.value = this.model.pagerAddress;
this.enabledCheckBox = view.modelBuilder.checkBox()
.withProperties({
label: OperatorDialog.EnabledCheckboxLabel
}).component();
this.enabledCheckBox.checked = this.model.enabled;
this.pagerMondayCheckBox = view.modelBuilder.checkBox()
.withProperties({
@@ -367,7 +365,6 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
}] ,
title: OperatorDialog.PagerDutyScheduleLabel
}]).withLayout({ width: '100%' }).component();
await view.initializeModel(formModel);
});
}