minor changes

This commit is contained in:
Maxim 2022-08-22 12:57:54 +03:00
parent 874be7fc90
commit 97f135b69d
3 changed files with 8 additions and 3 deletions

View file

@ -54,8 +54,8 @@ class ScheduleFinal extends Component<ScheduleFinalProps, ScheduleOverridesState
const currentTimeHidden = currentTimeX < 0 || currentTimeX > 1;
console.log(toJS(shifts));
console.log(toJS(layers));
/* console.log('shifts', toJS(shifts));
console.log('layers', toJS(layers)); */
return (
<>

View file

@ -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)) }],

View file

@ -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<Shift>) {