Skip to content

Commit

Permalink
remove artifact preview
Browse files Browse the repository at this point in the history
[RHOAIENG-8124]: show pipeline group label on hover at  low scale

fix(pipelineDefaultTaskGroup): format

fix(pipelineDefaultTaskGroup): remove unused declarations
  • Loading branch information
Gkrumbach07 authored and jenny-s51 committed Jun 20, 2024
1 parent a1c9c39 commit 3dc20c1
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 138 deletions.
49 changes: 21 additions & 28 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@patternfly/react-styles": "^5.2.1",
"@patternfly/react-table": "^5.2.1",
"@patternfly/react-tokens": "^5.2.1",
"@patternfly/react-topology": "^5.4.0-prerelease.6",
"@patternfly/react-topology": "^5.4.0-prerelease.9",
"@patternfly/react-virtualized-extension": "^5.0.0",
"@types/classnames": "^2.3.1",
"axios": "^1.6.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
DescriptionListGroup,
DescriptionListTerm,
DescriptionListDescription,
StackItem,
} from '@patternfly/react-core';

import { Artifact } from '~/third_party/mlmd';
Expand All @@ -21,7 +20,6 @@ import PipelinesTableRowTime from '~/concepts/pipelines/content/tables/Pipelines
import PipelineRunDrawerRightContent from '~/concepts/pipelines/content/pipelinesDetails/pipelineRun/PipelineRunDrawerRightContent';
import { SupportedArea, useIsAreaAvailable } from '~/concepts/areas';
import { ArtifactUriLink } from '~/concepts/pipelines/content/artifacts/ArtifactUriLink';
import ArtifactPreview from '~/concepts/pipelines/content/pipelinesDetails/taskDetails/ArtifactPreview';

type ArtifactNodeDetailsProps = Pick<
React.ComponentProps<typeof PipelineRunDrawerRightContent>,
Expand Down Expand Up @@ -90,14 +88,7 @@ export const ArtifactNodeDetails: React.FC<ArtifactNodeDetailsProps> = ({
<DescriptionListGroup>
<DescriptionListTerm>{artifactName}</DescriptionListTerm>
<DescriptionListDescription>
<Stack hasGutter>
<StackItem>
<ArtifactUriLink uri={artifact.getUri()} />
</StackItem>
<StackItem>
<ArtifactPreview artifact={artifact} />
</StackItem>
</Stack>
<ArtifactUriLink uri={artifact.getUri()} />
</DescriptionListDescription>
</DescriptionListGroup>
</DescriptionList>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import TaskDetailsSection from '~/concepts/pipelines/content/pipelinesDetails/ta
import TaskDetailsPrintKeyValues from '~/concepts/pipelines/content/pipelinesDetails/taskDetails/TaskDetailsPrintKeyValues';
import { PipelineTaskArtifact } from '~/concepts/pipelines/topology';
import { ArtifactUriLink } from '~/concepts/pipelines/content/artifacts/ArtifactUriLink';
import ArtifactPreview from './ArtifactPreview';

type TaskDetailsInputOutputProps = {
type: 'Input' | 'Output';
Expand All @@ -29,7 +28,6 @@ const TaskDetailsInputOutput: React.FC<TaskDetailsInputOutputProps> = ({
return {
label: artifactInputOutput.label,
value: <ArtifactUriLink uri={artifact.getUri()} />,
preview: <ArtifactPreview artifact={artifact} />,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { Grid, GridItem, Truncate } from '@patternfly/react-core';

type TaskDetailsPrintKeyValuesProps = {
items: { label: string; value: React.ReactNode; preview?: React.ReactNode }[];
items: { label: string; value: React.ReactNode }[];
};

const TaskDetailsPrintKeyValues: React.FC<TaskDetailsPrintKeyValuesProps> = ({ items }) => (
Expand All @@ -15,7 +15,6 @@ const TaskDetailsPrintKeyValues: React.FC<TaskDetailsPrintKeyValuesProps> = ({ i
</b>
</GridItem>
<GridItem span={6}>{result.value}</GridItem>
{result.preview && <GridItem span={12}>{result.preview}</GridItem>}
</React.Fragment>
))}
</Grid>
Expand Down
37 changes: 16 additions & 21 deletions frontend/src/concepts/topology/PipelineDefaultTaskGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import {
Node,
GraphElement,
RunStatus,
DEFAULT_LAYER,
Layer,
ScaleDetailsLevel,
TOP_LAYER,
NodeModel,
useHover,
PipelineNodeModel,
Expand Down Expand Up @@ -65,7 +62,7 @@ const DefaultTaskGroupInner: React.FunctionComponent<PipelinesDefaultGroupInnerP
hideDetailsAtMedium
showStatusState
scaleNode={hover && detailsLevel !== ScaleDetailsLevel.high}
showLabel={detailsLevel === ScaleDetailsLevel.high}
showLabelOnHover
status={element.getData()?.runStatus}
hiddenDetailsShownStatuses={[
RunStatus.Succeeded,
Expand All @@ -79,23 +76,21 @@ const DefaultTaskGroupInner: React.FunctionComponent<PipelinesDefaultGroupInnerP
);

return (
<Layer id={detailsLevel !== ScaleDetailsLevel.high && hover ? TOP_LAYER : DEFAULT_LAYER}>
<g ref={hoverRef as React.LegacyRef<SVGGElement>}>
{element.isCollapsed() ? (
<Popover
triggerRef={popoverRef}
triggerAction="hover"
aria-label="Hoverable popover"
headerContent={element.getLabel()}
bodyContent={getPopoverTasksList(element.getAllNodeChildren())}
>
<g ref={popoverRef}>{groupNode}</g>
</Popover>
) : (
groupNode
)}
</g>
</Layer>
<g ref={hoverRef as React.LegacyRef<SVGGElement>}>
{element.isCollapsed() ? (
<Popover
triggerRef={popoverRef}
triggerAction="hover"
aria-label="Hoverable popover"
headerContent={element.getLabel()}
bodyContent={getPopoverTasksList(element.getAllNodeChildren())}
>
<g ref={popoverRef}>{groupNode}</g>
</Popover>
) : (
groupNode
)}
</g>
);
},
);
Expand Down

0 comments on commit 3dc20c1

Please sign in to comment.