mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
schedules now get added in edit job (#2915)
This commit is contained in:
@@ -136,8 +136,13 @@ export class JobData implements IAgentDialogData {
|
||||
}
|
||||
|
||||
public addJobSchedule(schedule: sqlops.AgentJobScheduleInfo) {
|
||||
let existingSchedule = this.jobSchedules.find(item => item.name === schedule.name);
|
||||
if (!existingSchedule) {
|
||||
if (this.jobSchedules) {
|
||||
let existingSchedule = this.jobSchedules.find(item => item.name === schedule.name);
|
||||
if (!existingSchedule) {
|
||||
this.jobSchedules.push(schedule);
|
||||
}
|
||||
} else {
|
||||
this.jobSchedules = [];
|
||||
this.jobSchedules.push(schedule);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,9 +13,11 @@ export class PickScheduleData implements IAgentDialogData {
|
||||
public ownerUri: string;
|
||||
public schedules: sqlops.AgentJobScheduleInfo[];
|
||||
public selectedSchedule: sqlops.AgentJobScheduleInfo;
|
||||
private jobName: string;
|
||||
|
||||
constructor(ownerUri:string) {
|
||||
constructor(ownerUri:string, jobName: string) {
|
||||
this.ownerUri = ownerUri;
|
||||
this.jobName = jobName;
|
||||
}
|
||||
|
||||
public async initialize() {
|
||||
@@ -27,5 +29,8 @@ export class PickScheduleData implements IAgentDialogData {
|
||||
}
|
||||
|
||||
public async save() {
|
||||
let agentService = await AgentUtils.getAgentService();
|
||||
this.selectedSchedule.jobName = this.jobName;
|
||||
let result = await agentService.createJobSchedule(this.ownerUri, this.selectedSchedule);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user