airbyte-faros-destination 0.19.13 → 0.19.15
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.
|
@@ -35,7 +35,7 @@ class Iterations extends common_1.AzureWorkitemsConverter {
|
|
|
35
35
|
uid: String(Iteration.id),
|
|
36
36
|
name: Iteration.name,
|
|
37
37
|
description: faros_js_client_1.Utils.cleanAndTruncate(Iteration.path),
|
|
38
|
-
state: this.toState((_c = Iteration.attributes) === null || _c === void 0 ? void 0 : _c.timeFrame, startedAt,
|
|
38
|
+
state: this.toState((_c = Iteration.attributes) === null || _c === void 0 ? void 0 : _c.timeFrame, startedAt, closedAt),
|
|
39
39
|
startedAt,
|
|
40
40
|
openedAt,
|
|
41
41
|
endedAt,
|
|
@@ -45,7 +45,7 @@ class Iterations extends common_1.AzureWorkitemsConverter {
|
|
|
45
45
|
},
|
|
46
46
|
];
|
|
47
47
|
}
|
|
48
|
-
toState(state,
|
|
48
|
+
toState(state, startedAt, closedAt) {
|
|
49
49
|
// If timeFrame is provided (backward compatibility), use it
|
|
50
50
|
if (state) {
|
|
51
51
|
switch (state.toLowerCase()) {
|
|
@@ -60,27 +60,29 @@ class Iterations extends common_1.AzureWorkitemsConverter {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
// Calculate state based on dates if timeFrame is not available
|
|
63
|
-
// Check
|
|
64
|
-
if (
|
|
63
|
+
// Check closed date first - if it's in the past (end of day), iteration is closed
|
|
64
|
+
if (closedAt && closedAt < this.now) {
|
|
65
65
|
return 'Closed';
|
|
66
66
|
}
|
|
67
67
|
// If we have a start date that's in the future, iteration is future
|
|
68
|
-
if (
|
|
68
|
+
if (startedAt && startedAt > this.now) {
|
|
69
69
|
return 'Future';
|
|
70
70
|
}
|
|
71
|
-
// If we're
|
|
72
|
-
|
|
71
|
+
// If we're past the start date and before/on the close date, iteration is active
|
|
72
|
+
// Use startedAt to make sprint active from the day it starts (not end-of-day)
|
|
73
|
+
// Use closedAt (end-of-day) to keep sprint active through the entire end date
|
|
74
|
+
if (startedAt && startedAt <= this.now && closedAt && closedAt >= this.now) {
|
|
73
75
|
return 'Active';
|
|
74
76
|
}
|
|
75
|
-
// Handle edge case: start date exists and has passed, but no
|
|
77
|
+
// Handle edge case: start date exists and has passed, but no close date
|
|
76
78
|
// Note: Sprints with start date but no end date are treated as Active if started.
|
|
77
79
|
// This handles cases where sprints are created but end date hasn't been set yet,
|
|
78
80
|
// or for indefinite iterations like "Backlog". Azure's exact behavior for this
|
|
79
81
|
// edge case is unclear, but treating started iterations as Active seems reasonable.
|
|
80
|
-
if (
|
|
82
|
+
if (startedAt && startedAt <= this.now && !closedAt) {
|
|
81
83
|
return 'Active';
|
|
82
84
|
}
|
|
83
|
-
// Default: no dates set, or only future start date, or only future
|
|
85
|
+
// Default: no dates set, or only future start date, or only future close date
|
|
84
86
|
return 'Future';
|
|
85
87
|
}
|
|
86
88
|
toEndOfDay(date) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iterations.js","sourceRoot":"","sources":["../../../src/converters/azure-workitems/iterations.ts"],"names":[],"mappings":";;;AAEA,qDAAsC;AACtC,iCAA+B;AAG/B,qCAAiD;AAEjD,MAAa,UAAW,SAAQ,gCAAuB;IAAvD;;QACW,sBAAiB,GAAoC,CAAC,YAAY,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"iterations.js","sourceRoot":"","sources":["../../../src/converters/azure-workitems/iterations.ts"],"names":[],"mappings":";;;AAEA,qDAAsC;AACtC,iCAA+B;AAG/B,qCAAiD;AAEjD,MAAa,UAAW,SAAQ,gCAAuB;IAAvD;;QACW,sBAAiB,GAAoC,CAAC,YAAY,CAAC,CAAC;IAoG/E,CAAC;IAjGC,sFAAsF;IAC9E,UAAU;QAChB,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YACd,IAAI,CAAC,GAAG,GAAG,gBAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,K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