@outbuild-company/schedule-core 1.13.4 → 1.13.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -14527,6 +14527,14 @@ async function dispatchActivityIndent(action, options, deps) {
14527
14527
  if (shift.before !== void 0) beforeImage.correlativeId = shift.before;
14528
14528
  beforeSnap.set(shift.activityId, beforeImage);
14529
14529
  }
14530
+ const invalidLinkIds = collectInvalidLinkIdsForCycle(succeededIds, adapter);
14531
+ const beforeLinks = /* @__PURE__ */ new Map();
14532
+ for (const linkId of invalidLinkIds) {
14533
+ const link = adapter.getLink(linkId);
14534
+ if (!link) continue;
14535
+ beforeLinks.set(linkId, { ...link });
14536
+ adapter.removeLink(linkId);
14537
+ }
14530
14538
  const { scheduledIds } = await runPostMutation(
14531
14539
  {
14532
14540
  adapter,
@@ -14542,7 +14550,6 @@ async function dispatchActivityIndent(action, options, deps) {
14542
14550
  options
14543
14551
  }
14544
14552
  );
14545
- const invalidLinkIds = collectInvalidLinkIdsForCycle(succeededIds, adapter);
14546
14553
  const trackingEvent = {
14547
14554
  name: DISPATCH_TRACK_EVENT.ACTIVITY_INDENT,
14548
14555
  properties: {
@@ -14557,6 +14564,15 @@ async function dispatchActivityIndent(action, options, deps) {
14557
14564
  if (action.eventSource !== void 0) {
14558
14565
  trackingEvent.properties.event_source = action.eventSource;
14559
14566
  }
14567
+ const changes = await assembleChangeSet(adapter, {
14568
+ source: action,
14569
+ beforeSnap,
14570
+ touchedIds: touched,
14571
+ scheduledIds,
14572
+ links: buildLinkDeletions(beforeLinks),
14573
+ trackingEvents: [trackingEvent],
14574
+ hoursPerDay: sector.hoursPerDay
14575
+ });
14560
14576
  return {
14561
14577
  ok: true,
14562
14578
  activityVerdicts: action.activityIds.map((activityId) => {
@@ -14569,14 +14585,8 @@ async function dispatchActivityIndent(action, options, deps) {
14569
14585
  reason: failure.reason
14570
14586
  } : { activityId: String(activityId), ok: true };
14571
14587
  }),
14572
- changes: await assembleChangeSet(adapter, {
14573
- source: action,
14574
- beforeSnap,
14575
- touchedIds: touched,
14576
- scheduledIds,
14577
- trackingEvents: [trackingEvent],
14578
- hoursPerDay: sector.hoursPerDay
14579
- })
14588
+ changes,
14589
+ __beforeLinks: beforeLinks
14580
14590
  };
14581
14591
  }
14582
14592
 
@@ -14865,6 +14875,7 @@ async function dispatchActivitySetProgress(action, options, deps) {
14865
14875
  changes.postProcessors ?? [],
14866
14876
  adapter
14867
14877
  );
14878
+ const autoscheduleFrom = changes.needsAutoSchedule ? ctx.hierarchy.hasChildren(action.activityId) ? AUTOSCHEDULE_SCOPE.ROOTS : action.activityId : null;
14868
14879
  const { scheduledIds } = await runPostMutation(
14869
14880
  {
14870
14881
  adapter,
@@ -14874,7 +14885,7 @@ async function dispatchActivitySetProgress(action, options, deps) {
14874
14885
  },
14875
14886
  {
14876
14887
  action,
14877
- autoscheduleFrom: changes.needsAutoSchedule ? action.activityId : null,
14888
+ autoscheduleFrom,
14878
14889
  recomputeParentsFrom: [],
14879
14890
  collectDirty: (sids) => collectDirtyForInlineEdit(action.activityId, touchedIds, sids),
14880
14891
  now: deps.now,