Skip to content

Commit

Permalink
fix: added the delete tooltip title according to node.
Browse files Browse the repository at this point in the history
  • Loading branch information
srvEq committed Jan 7, 2025
1 parent 13aa135 commit faba6fc
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions components/canvas/ChoiceNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ export const ChoiceNode = ({
data={data}
userCanEdit={userCanEdit}
handleNodeDelete={handleNodeDelete}
title="Delete Choice"
/>
)}
</div>
Expand Down
1 change: 1 addition & 0 deletions components/canvas/LinkedProcessNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export const LinkedProcessNode = ({
data={data}
userCanEdit={userCanEdit}
handleNodeDelete={handleNodeDelete}
title="Delete Linked Process"
/>
)}
</div>
Expand Down
1 change: 1 addition & 0 deletions components/canvas/MainActivityNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export const MainActivityNode = ({
data={data}
userCanEdit={userCanEdit}
handleNodeDelete={handleNodeDelete}
title="Delete Main Activity"
/>
)}
</div>
Expand Down
4 changes: 3 additions & 1 deletion components/canvas/NodeDelete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ type NodeDelete = {
data: Node["data"];
userCanEdit?: boolean;
handleNodeDelete?: () => void;
title: string;
};

export const NodeDelete = ({
data,
userCanEdit,
handleNodeDelete,
title,
}: NodeDelete) => {
return (
<Button
disabled={!canDeleteNode(data) || !userCanEdit}
variant="ghost_icon"
title="Delete Node"
title={title}
color="danger"
onClick={(event) => {
handleNodeDelete && handleNodeDelete();
Expand Down
1 change: 1 addition & 0 deletions components/canvas/SubActivityNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export const SubActivityNode = ({
data={data}
userCanEdit={userCanEdit}
handleNodeDelete={handleNodeDelete}
title="Delete Sub Activity"
/>
)}
</div>
Expand Down
1 change: 1 addition & 0 deletions components/canvas/WaitingNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ export const WaitingNode = ({
data={data}
userCanEdit={userCanEdit}
handleNodeDelete={handleNodeDelete}
title="Delete Waiting"
/>
)}
</div>
Expand Down

0 comments on commit faba6fc

Please sign in to comment.