Skip to content

Commit

Permalink
PR feedback from Jeff, merge into one pipeline component factory
Browse files Browse the repository at this point in the history
  • Loading branch information
jenny-s51 committed Apr 22, 2024
1 parent 5a6ddb9 commit b6a5d3e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
16 changes: 0 additions & 16 deletions frontend/src/concepts/topology/factories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,8 @@ export const pipelineComponentFactory: ComponentFactory = (kind, type) => {
return SpacerNode;
case DEFAULT_EDGE_TYPE:
return PipelineTaskEdge;
default:
return undefined;
}
};

export const pipelineGroupsComponentFactory: ComponentFactory = (kind, type) => {
if (kind === ModelKind.graph) {
return withPanZoom()(GraphComponent);
}
switch (type) {
case EXECUTION_TASK_NODE_TYPE:
return withSelection()(PipelineDefaultTaskGroup);
case DEFAULT_TASK_NODE_TYPE:
return withSelection()(StandardTaskNode);
case ICON_TASK_NODE_TYPE:
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
return withSelection()(ArtifactTaskNode);
default:
return undefined;
}
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/concepts/topology/useTopologyController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Visualization,
} from '@patternfly/react-topology';
import pipelineElementFactory from '@patternfly/react-topology/dist/esm/pipelines/elements/pipelineElementFactory';
import { pipelineComponentFactory, pipelineGroupsComponentFactory } from './factories';
import { pipelineComponentFactory } from './factories';
import { PIPELINE_LAYOUT, PIPELINE_NODE_SEPARATION_VERTICAL } from './const';

const useTopologyController = (graphId: string): Visualization | null => {
Expand All @@ -19,7 +19,6 @@ const useTopologyController = (graphId: string): Visualization | null => {
visualizationController.setFitToScreenOnLayout(true);
visualizationController.registerElementFactory(pipelineElementFactory);
visualizationController.registerComponentFactory(pipelineComponentFactory);
visualizationController.registerComponentFactory(pipelineGroupsComponentFactory);
visualizationController.registerLayoutFactory(
(type: string, graph: Graph): Layout | undefined =>
new PipelineDagreGroupsLayout(graph, {
Expand Down

0 comments on commit b6a5d3e

Please sign in to comment.