@outbuild-company/schedule-core 1.35.2 → 1.35.3
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.cjs
CHANGED
|
@@ -13027,7 +13027,7 @@ function resolveDataDateProgressButton(activity, progress, progressChanges, deps
|
|
|
13027
13027
|
);
|
|
13028
13028
|
}
|
|
13029
13029
|
function resolveDataDateFieldChanges(activity, changes, deps, column, confirmations, progressRouting, editedStart = null) {
|
|
13030
|
-
const
|
|
13030
|
+
const routed = routeGenericColumnEdit(
|
|
13031
13031
|
activity,
|
|
13032
13032
|
routeConstraintTypeEdit(activity, changes, column),
|
|
13033
13033
|
deps,
|
|
@@ -13036,9 +13036,8 @@ function resolveDataDateFieldChanges(activity, changes, deps, column, confirmati
|
|
|
13036
13036
|
progressRouting,
|
|
13037
13037
|
editedStart
|
|
13038
13038
|
);
|
|
13039
|
-
if (
|
|
13040
|
-
if ("accepted" in
|
|
13041
|
-
const routed = limitTransitionActuals(activity, generic, deps, column);
|
|
13039
|
+
if (routed === null) return rejected(REJECTION_REASON.INVALID_VALUE);
|
|
13040
|
+
if ("accepted" in routed) return routed;
|
|
13042
13041
|
if (routed.dataDatePatch === void 0) return accepted(routed);
|
|
13043
13042
|
if (activity.p6 === void 0 || deps.dataDateCapability === null) {
|
|
13044
13043
|
return rejected(REJECTION_REASON.INVALID_VALUE);
|
|
@@ -13098,32 +13097,6 @@ function withMirroredProgress(activity, changes, next, deps, column) {
|
|
|
13098
13097
|
}
|
|
13099
13098
|
return { ...changes, patch: { ...changes.patch, progress: percent } };
|
|
13100
13099
|
}
|
|
13101
|
-
var EXECUTION_TRANSITION_COLUMNS = /* @__PURE__ */ new Set([
|
|
13102
|
-
COLUMN.PROGRESS,
|
|
13103
|
-
COLUMN.EXECUTION_STATUS,
|
|
13104
|
-
COLUMN.PHYSICAL_PERCENT_COMPLETE
|
|
13105
|
-
]);
|
|
13106
|
-
function limitTransitionActuals(activity, changes, deps, column) {
|
|
13107
|
-
const dataDate = deps.dataDateSettings?.dataDate ?? null;
|
|
13108
|
-
if (!EXECUTION_TRANSITION_COLUMNS.has(column) || dataDate === null || changes.dataDatePatch === void 0 || !hasActiveDataDate(deps.dataDateSettings, deps.dataDateEnabled)) {
|
|
13109
|
-
return changes;
|
|
13110
|
-
}
|
|
13111
|
-
const calendar = deps.ctx.calendars.getCalendar(activity.calendarId);
|
|
13112
|
-
const limit = calendar === null ? { start: dataDate, finish: dataDate } : completionActualsLimit(dataDate, calendar);
|
|
13113
|
-
const recordedStart = activity.p6?.actualStart ?? null;
|
|
13114
|
-
const floor = recordedStart !== null && recordedStart <= dataDate ? recordedStart : null;
|
|
13115
|
-
const alternative = changes.confirmationAlternative;
|
|
13116
|
-
return {
|
|
13117
|
-
...changes,
|
|
13118
|
-
dataDatePatch: capActualDates(changes.dataDatePatch, floor, limit),
|
|
13119
|
-
...alternative === void 0 ? {} : {
|
|
13120
|
-
confirmationAlternative: {
|
|
13121
|
-
...alternative,
|
|
13122
|
-
effects: capActualDates(alternative.effects, floor, limit)
|
|
13123
|
-
}
|
|
13124
|
-
}
|
|
13125
|
-
};
|
|
13126
|
-
}
|
|
13127
13100
|
function accepted(changes) {
|
|
13128
13101
|
return { accepted: true, changes };
|
|
13129
13102
|
}
|
|
@@ -31162,13 +31135,11 @@ function prepareDataDateSettingsUpdate(current, patch) {
|
|
|
31162
31135
|
};
|
|
31163
31136
|
}
|
|
31164
31137
|
function prepareDataDateActivityUpdate(current, patch, primaryConstraint) {
|
|
31165
|
-
const
|
|
31138
|
+
const synchronized = synchronizeNotStartedDurations(current, patch);
|
|
31139
|
+
const percentRouted = routeActivityPercentComplete(current, synchronized);
|
|
31166
31140
|
validateActivityInputPatch(percentRouted);
|
|
31167
31141
|
validateSecondaryConstraint(percentRouted, primaryConstraint);
|
|
31168
|
-
const routed =
|
|
31169
|
-
current,
|
|
31170
|
-
gatePhysicalPercentInput(current, percentRouted)
|
|
31171
|
-
);
|
|
31142
|
+
const routed = gatePhysicalPercentInput(current, percentRouted);
|
|
31172
31143
|
const next = cloneDomainValue({
|
|
31173
31144
|
...current,
|
|
31174
31145
|
...routed,
|
|
@@ -31181,7 +31152,7 @@ function prepareDataDateActivityUpdate(current, patch, primaryConstraint) {
|
|
|
31181
31152
|
};
|
|
31182
31153
|
}
|
|
31183
31154
|
function synchronizeNotStartedDurations(current, patch) {
|
|
31184
|
-
if (current.executionStatus !== P6_EXECUTION_STATUS.NOT_STARTED || patch.remainingDurationHours === void 0 || patch.originalDurationHours !== void 0) {
|
|
31155
|
+
if (current.executionStatus !== P6_EXECUTION_STATUS.NOT_STARTED || patch.actualStart != null || patch.activityPercentComplete !== void 0 || patch.remainingDurationHours === void 0 || patch.originalDurationHours !== void 0) {
|
|
31185
31156
|
return patch;
|
|
31186
31157
|
}
|
|
31187
31158
|
return {
|
|
@@ -31226,7 +31197,7 @@ function routeActivityPercentComplete(current, patch) {
|
|
|
31226
31197
|
case P6_PERCENT_COMPLETE_TYPE.DURATION:
|
|
31227
31198
|
return {
|
|
31228
31199
|
...rest,
|
|
31229
|
-
remainingDurationHours: current.originalDurationHours * (1 - activityPercentComplete / FULL_PERCENT)
|
|
31200
|
+
remainingDurationHours: (rest.originalDurationHours ?? current.originalDurationHours) * (1 - activityPercentComplete / FULL_PERCENT)
|
|
31230
31201
|
};
|
|
31231
31202
|
case P6_PERCENT_COMPLETE_TYPE.UNITS:
|
|
31232
31203
|
throw new Error(
|