Skip to content

Commit

Permalink
fix: mermaid graph generation
Browse files Browse the repository at this point in the history
  • Loading branch information
yottahmd committed May 27, 2022
1 parent 32ad0b1 commit e23c19d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions admin/src/components/GraphDag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ function GraphDag({ steps, type = "status", onClickNode }: Props) {
// @ts-ignore
window.onClickMermaidNode = onClickNode;
const addNodeFn = (step: Step, status: NodeStatus) => {
const id = step.Name.replace(/\s/, "_");
const id = step.Name.replace(/\s/g, "_");
let c = graphStatusMap[status] || "";
dat.push(`${id}(${step.Name})${c};`);
if (step.Depends) {
step.Depends.forEach((d) => {
const depId = d.replace(/\s/, "_");
const depId = d.replace(/\s/g, "_");
dat.push(`${depId}-->${id};`);
});
}
Expand Down
2 changes: 1 addition & 1 deletion admin/src/components/WorkflowTabStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function WorkflowTabStatus({ workflow, subtab, group, name, refresh }: Props) {
}
// find the clicked step
const n = workflow.Status?.Nodes.find(
(n) => n.Step.Name.replace(/\s/, "_") == id
(n) => n.Step.Name.replace(/\s/g, "_") == id
);
if (n) {
setSelectedStep(n.Step);
Expand Down
2 changes: 1 addition & 1 deletion internal/admin/handlers/web/assets/js/bundle.js

Large diffs are not rendered by default.

0 comments on commit e23c19d

Please sign in to comment.