Skip to content

Commit

Permalink
remove directional condition, fix tests
Browse files Browse the repository at this point in the history
resolve linting issues

remove unused vars
  • Loading branch information
jenny-s51 committed Apr 5, 2024
1 parent 41cd7f4 commit cbe5a13
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 35 deletions.
14 changes: 5 additions & 9 deletions frontend/src/concepts/topology/TaskEdge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
observer,
Edge,
integralShapePath,
DEFAULT_SPACER_NODE_TYPE,
ConnectorArrow,
DagreLayoutOptions,
} from '@patternfly/react-topology';
Expand Down Expand Up @@ -35,14 +34,11 @@ const TaskEdge: React.FunctionComponent<TaskEdgeProps> = ({
d={integralShapePath(startPoint, endPoint, startIndent, nodeSeparation, verticalLayout)}
shapeRendering="geometricPrecision"
/>

{element.getTarget().getType() !== DEFAULT_SPACER_NODE_TYPE ? (
<ConnectorArrow
className={styles.topologyEdge}
startPoint={endPoint.clone().translate(0, -1)}
endPoint={endPoint}
/>
) : null}
<ConnectorArrow
className={styles.topologyEdge}
startPoint={endPoint.clone().translate(0, -1)}
endPoint={endPoint}
/>
</g>
);
};
Expand Down
47 changes: 21 additions & 26 deletions frontend/src/concepts/topology/customNodes/StandardTaskNode.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import * as React from 'react';
import {
DEFAULT_LAYER,
DEFAULT_WHEN_OFFSET,
DEFAULT_WHEN_SIZE,
GraphElement,
Layer,
observer,
RunStatus,
ScaleDetailsLevel,
TaskNode,
TOP_LAYER,
useHover,
WhenDecorator,
WithContextMenuProps,
Expand All @@ -36,29 +33,27 @@ const StandardTaskNode: React.FunctionComponent<StandardTaskNodeProps> = ({
) : null;

return (
<Layer id={detailsLevel !== ScaleDetailsLevel.high && hover ? TOP_LAYER : DEFAULT_LAYER}>
<g ref={hoverRef as React.LegacyRef<SVGGElement>}>
<TaskNode
element={element}
onSelect={onSelect}
selected={selected}
scaleNode={hover && detailsLevel !== ScaleDetailsLevel.high}
status={data?.status}
hideDetailsAtMedium
hiddenDetailsShownStatuses={[
RunStatus.Succeeded,
RunStatus.Cancelled,
RunStatus.Failed,
RunStatus.Running,
]}
whenOffset={data?.whenStatus ? DEFAULT_WHEN_OFFSET : 0}
whenSize={data?.whenStatus ? DEFAULT_WHEN_SIZE : 0}
{...rest}
>
{whenDecorator}
</TaskNode>
</g>
</Layer>
<g ref={hoverRef as React.LegacyRef<SVGGElement>}>
<TaskNode
element={element}
onSelect={onSelect}
selected={selected}
scaleNode={hover && detailsLevel !== ScaleDetailsLevel.high}
status={data?.status}
hideDetailsAtMedium
hiddenDetailsShownStatuses={[
RunStatus.Succeeded,
RunStatus.Cancelled,
RunStatus.Failed,
RunStatus.Running,
]}
whenOffset={data?.whenStatus ? DEFAULT_WHEN_OFFSET : 0}
whenSize={data?.whenStatus ? DEFAULT_WHEN_SIZE : 0}
{...rest}
>
{whenDecorator}
</TaskNode>
</g>
);
};

Expand Down

0 comments on commit cbe5a13

Please sign in to comment.