@outbuild-company/schedule-core 1.29.1 → 1.30.0
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/build-fingerprint.json +2 -2
- package/dist/cdn/schedule-core.global.js +1 -1
- package/dist/cdn/schedule-core.global.js.map +1 -1
- package/dist/index.cjs +70 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +70 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -21,6 +21,10 @@ var STATUS_CRITERIA = {
|
|
|
21
21
|
BASELINE: "Baseline",
|
|
22
22
|
ACTUAL: "Actual"
|
|
23
23
|
};
|
|
24
|
+
var BASELINE_ROLE = {
|
|
25
|
+
PROJECT: 1,
|
|
26
|
+
PRIMARY: 2
|
|
27
|
+
};
|
|
24
28
|
var STATUS = {
|
|
25
29
|
DONE: "Done",
|
|
26
30
|
OVERDUE: "Overdue",
|
|
@@ -2453,7 +2457,9 @@ var ACTIVITY_PROPERTY = {
|
|
|
2453
2457
|
NEW_ACTIVITIES_ARRAY: "newActivityIds",
|
|
2454
2458
|
HAS_NEW_ACTIVITIES: "hasNewActivities",
|
|
2455
2459
|
CALENDAR_DURATION: "calendarDuration",
|
|
2456
|
-
BASELINE_VARIANCE_DAYS: "baselineVarianceDays"
|
|
2460
|
+
BASELINE_VARIANCE_DAYS: "baselineVarianceDays",
|
|
2461
|
+
PROJECT_BASELINE_VARIANCE_DAYS: "projectBaselineVarianceDays",
|
|
2462
|
+
PRIMARY_BASELINE_VARIANCE_DAYS: "primaryBaselineVarianceDays"};
|
|
2457
2463
|
var LINK_PROPERTY = {
|
|
2458
2464
|
SOURCE: "source",
|
|
2459
2465
|
TARGET: "target",
|
|
@@ -7084,7 +7090,9 @@ function mergeCorrelativeShiftIntoDiff(diff, correlativeBefore, activityId, live
|
|
|
7084
7090
|
}
|
|
7085
7091
|
var DERIVED_DISPLAY_FIELDS = [
|
|
7086
7092
|
ACTIVITY_PROPERTY.CALENDAR_DURATION,
|
|
7087
|
-
ACTIVITY_PROPERTY.BASELINE_VARIANCE_DAYS
|
|
7093
|
+
ACTIVITY_PROPERTY.BASELINE_VARIANCE_DAYS,
|
|
7094
|
+
ACTIVITY_PROPERTY.PROJECT_BASELINE_VARIANCE_DAYS,
|
|
7095
|
+
ACTIVITY_PROPERTY.PRIMARY_BASELINE_VARIANCE_DAYS
|
|
7088
7096
|
];
|
|
7089
7097
|
function diffActivity(before, after) {
|
|
7090
7098
|
const fields = {};
|
|
@@ -7341,6 +7349,20 @@ function applyStatusPass(state, criteria) {
|
|
|
7341
7349
|
return changed2;
|
|
7342
7350
|
}
|
|
7343
7351
|
|
|
7352
|
+
// src/propagations/shared/get-primary-baseline.ts
|
|
7353
|
+
function getPrimaryBaseline(activity) {
|
|
7354
|
+
const points = activity?.baselinePoints;
|
|
7355
|
+
if (!Array.isArray(points) || points.length === 0) return null;
|
|
7356
|
+
return points.find((point) => point.isPrimaryVersion) ?? null;
|
|
7357
|
+
}
|
|
7358
|
+
|
|
7359
|
+
// src/propagations/shared/get-project-baseline.ts
|
|
7360
|
+
function getProjectBaseline(activity) {
|
|
7361
|
+
const points = activity?.baselinePoints;
|
|
7362
|
+
if (!Array.isArray(points) || points.length === 0) return null;
|
|
7363
|
+
return points.find((point) => point.isProjectVersion) ?? null;
|
|
7364
|
+
}
|
|
7365
|
+
|
|
7344
7366
|
// src/propagations/shared/get-visible-baseline.ts
|
|
7345
7367
|
function getVisibleBaseline(activity) {
|
|
7346
7368
|
const points = activity?.baselinePoints;
|
|
@@ -7351,9 +7373,8 @@ function getVisibleBaseline(activity) {
|
|
|
7351
7373
|
// src/columns/baseline-variance/compute.ts
|
|
7352
7374
|
var VARIANCE_DECIMAL_SCALE = 100;
|
|
7353
7375
|
var roundToVariancePrecision = (days) => Math.round(days * VARIANCE_DECIMAL_SCALE) / VARIANCE_DECIMAL_SCALE;
|
|
7354
|
-
function
|
|
7376
|
+
function varianceDaysForBaselineEnd(activity, baselineEnd, calendars, hoursPerDay) {
|
|
7355
7377
|
if (hoursPerDay <= 0) return null;
|
|
7356
|
-
const baselineEnd = getVisibleBaseline(activity)?.endDate;
|
|
7357
7378
|
const activityEnd = activity.endDate;
|
|
7358
7379
|
if (!baselineEnd || !activityEnd) return null;
|
|
7359
7380
|
const finishesLate = activityEnd.getTime() > baselineEnd.getTime();
|
|
@@ -7367,6 +7388,14 @@ function computeBaselineVarianceDays(activity, calendars, hoursPerDay) {
|
|
|
7367
7388
|
const magnitude = roundToVariancePrecision(durationHours / hoursPerDay);
|
|
7368
7389
|
return finishesLate ? magnitude : -magnitude;
|
|
7369
7390
|
}
|
|
7391
|
+
function computeBaselineVarianceDays(activity, calendars, hoursPerDay) {
|
|
7392
|
+
return varianceDaysForBaselineEnd(
|
|
7393
|
+
activity,
|
|
7394
|
+
getVisibleBaseline(activity)?.endDate ?? null,
|
|
7395
|
+
calendars,
|
|
7396
|
+
hoursPerDay
|
|
7397
|
+
);
|
|
7398
|
+
}
|
|
7370
7399
|
function applyBaselineVariancePass(state, hoursPerDay) {
|
|
7371
7400
|
const changed2 = [];
|
|
7372
7401
|
state.forEachActivity((activity, id) => {
|
|
@@ -7377,6 +7406,30 @@ function applyBaselineVariancePass(state, hoursPerDay) {
|
|
|
7377
7406
|
});
|
|
7378
7407
|
return changed2;
|
|
7379
7408
|
}
|
|
7409
|
+
function applyRoleBaselineVariancePass(state, hoursPerDay) {
|
|
7410
|
+
const changed2 = [];
|
|
7411
|
+
state.forEachActivity((activity, id) => {
|
|
7412
|
+
const project = varianceDaysForBaselineEnd(
|
|
7413
|
+
activity,
|
|
7414
|
+
getProjectBaseline(activity)?.endDate ?? null,
|
|
7415
|
+
state,
|
|
7416
|
+
hoursPerDay
|
|
7417
|
+
);
|
|
7418
|
+
const primary = varianceDaysForBaselineEnd(
|
|
7419
|
+
activity,
|
|
7420
|
+
getPrimaryBaseline(activity)?.endDate ?? null,
|
|
7421
|
+
state,
|
|
7422
|
+
hoursPerDay
|
|
7423
|
+
);
|
|
7424
|
+
const projectChanged = activity.projectBaselineVarianceDays !== project;
|
|
7425
|
+
const primaryChanged = activity.primaryBaselineVarianceDays !== primary;
|
|
7426
|
+
if (!projectChanged && !primaryChanged) return;
|
|
7427
|
+
if (projectChanged) activity.projectBaselineVarianceDays = project;
|
|
7428
|
+
if (primaryChanged) activity.primaryBaselineVarianceDays = primary;
|
|
7429
|
+
changed2.push(String(id));
|
|
7430
|
+
});
|
|
7431
|
+
return changed2;
|
|
7432
|
+
}
|
|
7380
7433
|
|
|
7381
7434
|
// src/critical-path/legacy/shims/moment.js
|
|
7382
7435
|
function moment(input) {
|
|
@@ -13110,6 +13163,7 @@ async function runDerivedRecomputes(deps, passes, now) {
|
|
|
13110
13163
|
}
|
|
13111
13164
|
if (passes.has(DERIVED_PASS.BASELINE_VARIANCE)) {
|
|
13112
13165
|
applyBaselineVariancePass(deps.adapter, deps.sector.hoursPerDay);
|
|
13166
|
+
applyRoleBaselineVariancePass(deps.adapter, deps.sector.hoursPerDay);
|
|
13113
13167
|
}
|
|
13114
13168
|
if (passes.has(DERIVED_PASS.CRITICAL_PATH)) {
|
|
13115
13169
|
await applyCriticalPath(deps.adapter, deps.sector.hoursPerDay);
|
|
@@ -14718,6 +14772,8 @@ var NEW_ACTIVITY_DEFAULTS = Object.freeze({
|
|
|
14718
14772
|
baselinePoints: [],
|
|
14719
14773
|
baselineSnapshot: null,
|
|
14720
14774
|
baselineVarianceDays: null,
|
|
14775
|
+
projectBaselineVarianceDays: null,
|
|
14776
|
+
primaryBaselineVarianceDays: null,
|
|
14721
14777
|
recursiveDurationHours: 0,
|
|
14722
14778
|
isCritical: false,
|
|
14723
14779
|
freeSlackHours: null,
|
|
@@ -18806,6 +18862,8 @@ function normalizeBaselinePoint(point, reporter, diagnostic2, isMilestone = fals
|
|
|
18806
18862
|
versionId: typeof point.sectorbaselineversionId === "number" ? point.sectorbaselineversionId : null,
|
|
18807
18863
|
isActiveVersion: Boolean(point.sectorbaselineversion?.active),
|
|
18808
18864
|
isVisibleVersion: Boolean(point.sectorbaselineversion?.visible),
|
|
18865
|
+
isProjectVersion: point.sectorbaselineversion?.role === BASELINE_ROLE.PROJECT,
|
|
18866
|
+
isPrimaryVersion: point.sectorbaselineversion?.role === BASELINE_ROLE.PRIMARY,
|
|
18809
18867
|
baseCalendarId: point.baseCalendarId != null ? String(point.baseCalendarId) : null,
|
|
18810
18868
|
hoursPerDay: typeof point.hoursPerDay === "number" ? point.hoursPerDay : null,
|
|
18811
18869
|
hoursPerWeek: typeof point.hoursPerWeek === "number" ? point.hoursPerWeek : null
|
|
@@ -18985,6 +19043,7 @@ async function dispatchBaselineApply(action, deps) {
|
|
|
18985
19043
|
void 0
|
|
18986
19044
|
);
|
|
18987
19045
|
applyBaselineVariancePass(deps.adapter, deps.sector.hoursPerDay);
|
|
19046
|
+
applyRoleBaselineVariancePass(deps.adapter, deps.sector.hoursPerDay);
|
|
18988
19047
|
if (activeBaselineSignature(deps) !== activeBaselineBefore) {
|
|
18989
19048
|
recomputeBaselineWeightedFields(
|
|
18990
19049
|
deps,
|
|
@@ -25070,6 +25129,8 @@ var ACTIVITY_SAVE_FIELD_POLICY = {
|
|
|
25070
25129
|
freeSlackHours: SAVE_FIELD_POLICY.IGNORED,
|
|
25071
25130
|
calendarDuration: SAVE_FIELD_POLICY.IGNORED,
|
|
25072
25131
|
baselineVarianceDays: SAVE_FIELD_POLICY.IGNORED,
|
|
25132
|
+
projectBaselineVarianceDays: SAVE_FIELD_POLICY.IGNORED,
|
|
25133
|
+
primaryBaselineVarianceDays: SAVE_FIELD_POLICY.IGNORED,
|
|
25073
25134
|
expectedProgress: SAVE_FIELD_POLICY.IGNORED,
|
|
25074
25135
|
expectedProgressBaseline: SAVE_FIELD_POLICY.IGNORED,
|
|
25075
25136
|
status: SAVE_FIELD_POLICY.IGNORED,
|
|
@@ -25925,6 +25986,8 @@ function parseActivity(raw, context) {
|
|
|
25925
25986
|
),
|
|
25926
25987
|
baselineSnapshot: null,
|
|
25927
25988
|
baselineVarianceDays: null,
|
|
25989
|
+
projectBaselineVarianceDays: null,
|
|
25990
|
+
primaryBaselineVarianceDays: null,
|
|
25928
25991
|
recursiveDurationHours: durationToHours(
|
|
25929
25992
|
Number(raw.sumOfDurationRecursively ?? 0),
|
|
25930
25993
|
context.hoursPerDay
|
|
@@ -26968,6 +27031,7 @@ async function runInitialPasses(deps) {
|
|
|
26968
27031
|
applyStatusPass(state, sector.statusCriteria);
|
|
26969
27032
|
}
|
|
26970
27033
|
applyBaselineVariancePass(state, sector.hoursPerDay);
|
|
27034
|
+
applyRoleBaselineVariancePass(state, sector.hoursPerDay);
|
|
26971
27035
|
return;
|
|
26972
27036
|
}
|
|
26973
27037
|
const result = await scheduler.schedule({});
|
|
@@ -26981,6 +27045,7 @@ async function runInitialPasses(deps) {
|
|
|
26981
27045
|
applyStatusPass(state, sector.statusCriteria);
|
|
26982
27046
|
}
|
|
26983
27047
|
applyBaselineVariancePass(state, sector.hoursPerDay);
|
|
27048
|
+
applyRoleBaselineVariancePass(state, sector.hoursPerDay);
|
|
26984
27049
|
}
|
|
26985
27050
|
function recomputeSkippedLeafEnds(state) {
|
|
26986
27051
|
state.forEachActivity((activity) => {
|
|
@@ -35048,6 +35113,7 @@ exports.ACTIVITY_FIELD = ACTIVITY_FIELD;
|
|
|
35048
35113
|
exports.ACTIVITY_PONDERATOR_CRITERION = ACTIVITY_PONDERATOR_CRITERION;
|
|
35049
35114
|
exports.ACTIVITY_PROGRESS_ORIGIN = ACTIVITY_PROGRESS_ORIGIN;
|
|
35050
35115
|
exports.ACTIVITY_TYPE = ACTIVITY_TYPE;
|
|
35116
|
+
exports.BASELINE_ROLE = BASELINE_ROLE;
|
|
35051
35117
|
exports.CALENDAR_UNIT = CALENDAR_UNIT;
|
|
35052
35118
|
exports.CHANGE_SET_SOURCE_KIND = CHANGE_SET_SOURCE_KIND;
|
|
35053
35119
|
exports.COLUMN = COLUMN;
|