schedules now get added in edit job (#2915)

This commit is contained in:
Aditya Bist
2018-10-16 22:51:54 -07:00
committed by GitHub
parent 67514ccc5f
commit 7ba14a3925
6 changed files with 23 additions and 17 deletions

View File

@@ -108,12 +108,14 @@ export class JobDialog extends AgentDialog<JobData> {
// Alert tab controls
private alertsTable: sqlops.TableComponent;
private newAlertButton: sqlops.ButtonComponent;
private isEdit: boolean = false;
constructor(ownerUri: string, jobInfo: sqlops.AgentJobInfo = undefined) {
super(
ownerUri,
new JobData(ownerUri, jobInfo),
jobInfo ? JobDialog.EditDialogTitle : JobDialog.CreateDialogTitle);
this.isEdit = jobInfo ? true : false;
}
protected async initializeDialog() {
@@ -373,12 +375,12 @@ export class JobDialog extends AgentDialog<JobData> {
label: this.PickScheduleButtonString,
width: 80
}).component();
this.pickScheduleButton.onDidClick((e)=>{
let pickScheduleDialog = new PickScheduleDialog(this.model.ownerUri);
let pickScheduleDialog = new PickScheduleDialog(this.model.ownerUri, this.model.name);
pickScheduleDialog.onSuccess((dialogModel) => {
let selectedSchedule = dialogModel.selectedSchedule;
if (selectedSchedule) {
selectedSchedule.jobName = this.model.name;
this.model.addJobSchedule(selectedSchedule);
this.populateScheduleTable();
}

View File

@@ -33,8 +33,8 @@ export class PickScheduleDialog {
private _onSuccess: vscode.EventEmitter<PickScheduleData> = new vscode.EventEmitter<PickScheduleData>();
public readonly onSuccess: vscode.Event<PickScheduleData> = this._onSuccess.event;
constructor(ownerUri: string) {
this.model = new PickScheduleData(ownerUri);
constructor(ownerUri: string, jobName: string) {
this.model = new PickScheduleData(ownerUri, jobName);
}
public async showDialog() {