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