Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feat-workflow-tools1' into feat-…
Browse files Browse the repository at this point in the history
…workflow-tools1
  • Loading branch information
ramedina86 committed Sep 30, 2024
2 parents a533a7a + 9e4f638 commit adfd003
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
10 changes: 4 additions & 6 deletions src/ui/src/builder/useComponentActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export function useComponentActions(wf: Core, ssbm: BuilderManager) {
type: string,
parentId: Component["id"],
position?: number,
initProperties?: Partial<Component>,
initProperties?: Partial<Omit<Component, 'id' | 'type' | 'parent' | 'content' | 'handlers' | 'position'>>,
) {
const newId = generateNewComponentId();
const definition = wf.getComponentDefinition(type);
Expand Down Expand Up @@ -729,11 +729,9 @@ export function useComponentActions(wf: Core, ssbm: BuilderManager) {
ssbm.openMutationTransaction(transactionId, `Edit out`, true);
ssbm.registerPreMutation(component);

component.outs = [
...component.outs.filter(
(o) => !(out.outId === o.outId && out.toNodeId === o.toNodeId),
),
];
component.outs = component.outs.filter(
(o) => !(out.outId === o.outId && out.toNodeId === o.toNodeId),
);

ssbm.registerPostMutation(component);
ssbm.closeMutationTransaction(transactionId);
Expand Down
14 changes: 6 additions & 8 deletions src/ui/src/components/workflows/WorkflowsWorkflow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,12 @@ watch(
async (postChildren, preChildren) => {
// Remove references when a node is deleted
const preIds = preChildren.map((c) => c.id);
const postIds = postChildren.map((c) => c.id);
const removedIds = preIds.filter((cId) => !postIds.includes(cId));
removedIds.forEach((removedId) => {
postChildren.forEach((c) => {
if (!c.outs || c.outs.length == 0) return;
c.outs = c.outs.filter((out) => out.toNodeId !== removedId);
});
const removedIds = new Set(postChildren.map((c) => c.id));
preChildren.forEach(c => removedIds.delete(c.id));
postChildren.forEach((c) => {
c.outs = c.outs?.filter((out) => !removedIds.has(out.toNodeId));
});
});
// Refresh arrows
Expand Down
9 changes: 8 additions & 1 deletion src/ui/src/components/workflows/base/WorkflowArrow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@
opacity: isSelected ? `0.2` : `0`,
}"
></path>
<g v-if="isSelected" class="delete" @click="handleDeleteClick">
<g
v-if="isSelected"
class="delete"
tabindex="0"
aria-label="Delete relation"
@click="handleDeleteClick"
@keypress.enter="handleDeleteClick"
>
<circle :cx="points[3].x" :cy="points[3].y" r="12" />
<line
class="cross"
Expand Down

0 comments on commit adfd003

Please sign in to comment.