@principal-ade/dynamic-file-tree 0.2.6 → 0.2.8
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.mjs
CHANGED
|
@@ -2231,13 +2231,53 @@ var buildTreeDataFromStoryboards = (storyboards, workflowCoverageMap, traceWorkf
|
|
|
2231
2231
|
return null;
|
|
2232
2232
|
}
|
|
2233
2233
|
const storyboardId = versionPrefix ? `storyboard:${versionPrefix}:${storyboard.id}` : `storyboard:${storyboard.id}`;
|
|
2234
|
+
const storyboardCanvasStatus = canvasNodeStatusMap?.[storyboard.canvas.path] ?? canvasNodeStatusMap?.[storyboard.id];
|
|
2235
|
+
const getAggregatedGitStatus = () => {
|
|
2236
|
+
if (!gitStatusMap)
|
|
2237
|
+
return null;
|
|
2238
|
+
const statusPriority = {
|
|
2239
|
+
M: 1,
|
|
2240
|
+
MM: 1,
|
|
2241
|
+
A: 2,
|
|
2242
|
+
AM: 2,
|
|
2243
|
+
D: 3,
|
|
2244
|
+
"??": 4,
|
|
2245
|
+
U: 5,
|
|
2246
|
+
R: 6,
|
|
2247
|
+
C: 7
|
|
2248
|
+
};
|
|
2249
|
+
let bestStatus = null;
|
|
2250
|
+
let bestPriority = Infinity;
|
|
2251
|
+
const canvasStatus2 = lookupGitStatus(storyboard.canvas.path, gitStatusMap);
|
|
2252
|
+
if (canvasStatus2 && (statusPriority[canvasStatus2] ?? 99) < bestPriority) {
|
|
2253
|
+
bestStatus = canvasStatus2;
|
|
2254
|
+
bestPriority = statusPriority[canvasStatus2] ?? 99;
|
|
2255
|
+
}
|
|
2256
|
+
if (storyboard.canvas.markdownPath) {
|
|
2257
|
+
const mdStatus = lookupGitStatus(storyboard.canvas.markdownPath, gitStatusMap);
|
|
2258
|
+
if (mdStatus && (statusPriority[mdStatus] ?? 99) < bestPriority) {
|
|
2259
|
+
bestStatus = mdStatus;
|
|
2260
|
+
bestPriority = statusPriority[mdStatus] ?? 99;
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
2263
|
+
for (const workflow of storyboard.workflows) {
|
|
2264
|
+
const wfStatus = lookupGitStatus(workflow.path, gitStatusMap);
|
|
2265
|
+
if (wfStatus && (statusPriority[wfStatus] ?? 99) < bestPriority) {
|
|
2266
|
+
bestStatus = wfStatus;
|
|
2267
|
+
bestPriority = statusPriority[wfStatus] ?? 99;
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
return bestStatus;
|
|
2271
|
+
};
|
|
2234
2272
|
return {
|
|
2235
2273
|
id: storyboardId,
|
|
2236
2274
|
name: storyboard.name,
|
|
2237
2275
|
type: "storyboard",
|
|
2238
2276
|
storyboard,
|
|
2239
2277
|
children,
|
|
2240
|
-
hasTraces: storyboardHasTracedWorkflows
|
|
2278
|
+
hasTraces: storyboardHasTracedWorkflows,
|
|
2279
|
+
canvasNodeStatus: storyboardCanvasStatus,
|
|
2280
|
+
gitStatus: getAggregatedGitStatus()
|
|
2241
2281
|
};
|
|
2242
2282
|
};
|
|
2243
2283
|
const hasMultiplePackages = packagesMap.size > 1;
|
|
@@ -2506,7 +2546,25 @@ var StoryboardWorkflowsTreeCore = ({
|
|
|
2506
2546
|
}) : /* @__PURE__ */ React13.createElement(Workflow, {
|
|
2507
2547
|
size: 16
|
|
2508
2548
|
});
|
|
2509
|
-
const
|
|
2549
|
+
const getStoryboardColor = () => {
|
|
2550
|
+
const status = data.canvasNodeStatus;
|
|
2551
|
+
if (!status) {
|
|
2552
|
+
return data.hasTraces ? theme.colors.success : theme.colors.textSecondary;
|
|
2553
|
+
}
|
|
2554
|
+
const { implemented, approved, draft } = status;
|
|
2555
|
+
const total = implemented + approved + draft;
|
|
2556
|
+
if (total === 0) {
|
|
2557
|
+
return theme.colors.textSecondary;
|
|
2558
|
+
}
|
|
2559
|
+
if (draft === 0 && approved === 0 && implemented > 0) {
|
|
2560
|
+
return theme.colors.success || "#10b981";
|
|
2561
|
+
}
|
|
2562
|
+
if (draft === 0 && approved > 0) {
|
|
2563
|
+
return theme.colors.warning || "#f59e0b";
|
|
2564
|
+
}
|
|
2565
|
+
return theme.colors.textSecondary;
|
|
2566
|
+
};
|
|
2567
|
+
const nameColor = data.type === "version" ? data.hasTraces ? "#a855f7" : theme.colors.textMuted : data.type === "package" ? theme.colors.primary : data.type === "storyboard" ? getStoryboardColor() : data.type === "overview" ? theme.colors.info || "#3b82f6" : data.type === "canvas" ? theme.colors.warning || "#f59e0b" : data.type === "workflows" ? theme.colors.text : data.type === "workflow" ? data.hasTraces ? theme.colors.textSecondary : theme.colors.textMuted : data.type === "scenario" ? data.hasTraces ? theme.colors.textSecondary : theme.colors.textMuted : theme.colors.textSecondary;
|
|
2510
2568
|
const nodeHorizontalPadding = data.type === "overview" || data.type === "canvas" || data.type === "workflows" || data.type === "workflow" || data.type === "scenario" ? `calc(${horizontalNodePadding} + 12px)` : horizontalNodePadding;
|
|
2511
2569
|
const rightContent = (() => {
|
|
2512
2570
|
const indicators = [];
|
|
@@ -2634,7 +2692,7 @@ var StoryboardWorkflowsTreeCore = ({
|
|
|
2634
2692
|
})));
|
|
2635
2693
|
}
|
|
2636
2694
|
}
|
|
2637
|
-
if (data.gitStatus && (data.type === "canvas" || data.type === "overview" || data.type === "workflow")) {
|
|
2695
|
+
if (data.gitStatus && (data.type === "storyboard" || data.type === "canvas" || data.type === "overview" || data.type === "workflow")) {
|
|
2638
2696
|
const gitDisplay = getGitStatusDisplay3(data.gitStatus, theme);
|
|
2639
2697
|
if (gitDisplay) {
|
|
2640
2698
|
indicators.push(/* @__PURE__ */ React13.createElement("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoryboardWorkflowsTreeCore.d.ts","sourceRoot":"","sources":["../../../../src/components/StoryboardWorkflowsTree/StoryboardWorkflowsTreeCore.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+C,MAAM,OAAO,CAAC;AASpE,OAAO,KAAK,EAEV,4BAA4B,EAQ7B,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"StoryboardWorkflowsTreeCore.d.ts","sourceRoot":"","sources":["../../../../src/components/StoryboardWorkflowsTree/StoryboardWorkflowsTreeCore.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+C,MAAM,OAAO,CAAC;AASpE,OAAO,KAAK,EAEV,4BAA4B,EAQ7B,MAAM,SAAS,CAAC;AA6ejB,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAke9E,CAAC"}
|