diff --git a/grafana-plugin/src/containers/Rotations/ScheduleFinal.tsx b/grafana-plugin/src/containers/Rotations/ScheduleFinal.tsx index 1df5c54f..3b4373b4 100644 --- a/grafana-plugin/src/containers/Rotations/ScheduleFinal.tsx +++ b/grafana-plugin/src/containers/Rotations/ScheduleFinal.tsx @@ -54,8 +54,8 @@ class ScheduleFinal extends Component 1; - console.log(toJS(shifts)); - console.log(toJS(layers)); + /* console.log('shifts', toJS(shifts)); + console.log('layers', toJS(layers)); */ return ( <> diff --git a/grafana-plugin/src/models/schedule/schedule.helpers.ts b/grafana-plugin/src/models/schedule/schedule.helpers.ts index 54df9f54..fda67137 100644 --- a/grafana-plugin/src/models/schedule/schedule.helpers.ts +++ b/grafana-plugin/src/models/schedule/schedule.helpers.ts @@ -89,6 +89,11 @@ export const enrichLayers = ( shiftId: Shift['id'] | 'new', priority: Shift['priority_level'] ) => { + /*const event = newEvents.find((event) => !event.is_gap); + if (event) { + shiftId = event.shift.pk; + }*/ + const updatingLayer = { priority, shifts: [{ shiftId: shiftId, events: fillGaps(newEvents.filter((event: Event) => !event.is_gap)) }], diff --git a/grafana-plugin/src/models/schedule/schedule.ts b/grafana-plugin/src/models/schedule/schedule.ts index b625f5cd..87e6fcb4 100644 --- a/grafana-plugin/src/models/schedule/schedule.ts +++ b/grafana-plugin/src/models/schedule/schedule.ts @@ -220,7 +220,7 @@ export class ScheduleStore extends BaseStore { this.rotationPreview = layers; } - this.finalPreview = splitToShiftsAndFillGaps(response.final); /*.filter((shift) => shift.shiftId !== shiftId);*/ + this.finalPreview = splitToShiftsAndFillGaps(response.final).filter((shift) => shift.shiftId !== shiftId); } async updateRotation(shiftId: Shift['id'], params: Partial) {