Skip to content

Commit

Permalink
fix deleteEdge
Browse files Browse the repository at this point in the history
  • Loading branch information
jomarko committed Sep 27, 2024
1 parent 38ce320 commit 006000e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/dmn-editor/src/mutations/deleteEdge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { addOrGetDrd } from "./addOrGetDrd";
import { DmnDiagramEdgeData } from "../diagram/edges/Edges";
import { repopulateInputDataAndDecisionsOnAllDecisionServices } from "./repopulateInputDataAndDecisionsOnDecisionService";
import { Normalized } from "../normalization/normalize";
import { xmlHrefToQName } from "../xml/xmlHrefToQName";

export enum EdgeDeletionMode {
FROM_DRG_AND_ALL_DRDS,
Expand Down Expand Up @@ -88,7 +89,9 @@ export function deleteEdge({
continue;
}

const dmnEdgeIndex = (diagramElements ?? []).findIndex((d) => d["@_dmnElementRef"] === edge.id);
const dmnEdgeIndex = (diagramElements ?? []).findIndex(
(d) => d["@_dmnElementRef"] === xmlHrefToQName(edge.id, definitions)
);
if (dmnEdgeIndex >= 0) {
if (i === drdIndex) {
deletedDmnEdgeOnCurrentDrd = diagramElements[dmnEdgeIndex];
Expand Down
1 change: 0 additions & 1 deletion packages/dmn-editor/src/mutations/deleteNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import { Computed } from "../store/Store";
import { computeContainingDecisionServiceHrefsByDecisionHrefs } from "../store/computed/computeContainingDecisionServiceHrefsByDecisionHrefs.ts";
import { xmlHrefToQName } from "../xml/xmlHrefToQName";
import { Normalized } from "../normalization/normalize";
import { NodeDmnObjects } from "../diagram/nodes/Nodes";

export enum NodeDeletionMode {
FROM_DRG_AND_ALL_DRDS,
Expand Down

0 comments on commit 006000e

Please sign in to comment.