Skip to content

Commit

Permalink
Merge branch 'patternfly:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
wise-king-sullyman authored Mar 22, 2024
2 parents 209b905 + e16b23a commit 230dce8
Show file tree
Hide file tree
Showing 18 changed files with 290 additions and 92 deletions.
24 changes: 24 additions & 0 deletions packages/demo-app-ts/src/demos/pipelineGroupsDemo/DemoTaskEdge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import * as React from 'react';
import { observer } from 'mobx-react';
import { Edge, EdgeTerminalType, GraphElement, TaskEdge } from '@patternfly/react-topology';

interface DemoTaskEdgeProps {
element: GraphElement;
}

const DemoTaskEdge: React.FunctionComponent<DemoTaskEdgeProps> = ({ element, ...props }) => {

const isDependency = (element as Edge).getTarget().getData()?.isDependency;

return (
<TaskEdge
element={element as Edge}
endTerminalType={
isDependency ? EdgeTerminalType.directional : EdgeTerminalType.none
}
{...props}
/>
);
};

export default observer(DemoTaskEdge);
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/* eslint-disable camelcase */
import {
PipelineNodeModel,
RunStatus,
} from '@patternfly/react-topology';
import { PipelineNodeModel, RunStatus } from '@patternfly/react-topology';

export const NODE_PADDING_VERTICAL = 15;
export const NODE_PADDING_HORIZONTAL = 15;
Expand All @@ -27,10 +24,11 @@ export const createExecution2 = (): [string, PipelineNodeModel[]] => {
runAfterTasks: [],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};

const task_2_1: PipelineNodeModel = {
const task_2_1: PipelineNodeModel = {
id: 'task_2_1',
label: 'Task 2-1',
type: 'Task',
Expand All @@ -42,10 +40,11 @@ export const createExecution2 = (): [string, PipelineNodeModel[]] => {
runAfterTasks: [],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};

const task_2_2: PipelineNodeModel = {
const task_2_2: PipelineNodeModel = {
id: 'task_2_2',
label: 'Task 2-2',
type: 'Task',
Expand All @@ -57,10 +56,11 @@ export const createExecution2 = (): [string, PipelineNodeModel[]] => {
runAfterTasks: ['task_2_1'],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};

const task_2_3: PipelineNodeModel = {
const task_2_3: PipelineNodeModel = {
id: 'task_2_3',
label: 'Task 2-3',
type: 'Task',
Expand All @@ -72,10 +72,11 @@ export const createExecution2 = (): [string, PipelineNodeModel[]] => {
runAfterTasks: ['task_2_1'],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};

const task_2_4: PipelineNodeModel = {
const task_2_4: PipelineNodeModel = {
id: 'task_2_4',
label: 'Task 2-4',
type: 'Task',
Expand All @@ -87,14 +88,15 @@ export const createExecution2 = (): [string, PipelineNodeModel[]] => {
runAfterTasks: ['task_2_1'],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
execution2.children = [task_2_1.id, task_2_2.id, task_2_3.id, task_2_4.id];

const nodes:PipelineNodeModel[] = [execution2, task_2_1, task_2_2, task_2_3, task_2_4];
const nodes: PipelineNodeModel[] = [execution2, task_2_1, task_2_2, task_2_3, task_2_4];

return ['execution-2', nodes]
}
return ['execution-2', nodes];
};

export const createExecution3 = (runAfter?: string): [string, PipelineNodeModel[]] => {
const execution3: PipelineNodeModel = {
Expand All @@ -110,6 +112,7 @@ export const createExecution3 = (runAfter?: string): [string, PipelineNodeModel[
runAfterTasks: runAfter ? [runAfter] : [],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};

Expand All @@ -125,6 +128,7 @@ export const createExecution3 = (runAfter?: string): [string, PipelineNodeModel[
runAfterTasks: [],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
const task_3_2: PipelineNodeModel = {
Expand All @@ -139,6 +143,7 @@ export const createExecution3 = (runAfter?: string): [string, PipelineNodeModel[
runAfterTasks: [task_3_1.id],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
const task_3_3: PipelineNodeModel = {
Expand All @@ -154,6 +159,7 @@ export const createExecution3 = (runAfter?: string): [string, PipelineNodeModel[
runAfterTasks: [task_3_1.id],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
const task_3_4: PipelineNodeModel = {
Expand All @@ -168,6 +174,7 @@ export const createExecution3 = (runAfter?: string): [string, PipelineNodeModel[
runAfterTasks: [task_3_1.id],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
const task_3_5: PipelineNodeModel = {
Expand All @@ -182,6 +189,7 @@ export const createExecution3 = (runAfter?: string): [string, PipelineNodeModel[
runAfterTasks: [task_3_4.id],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
const task_3_6: PipelineNodeModel = {
Expand All @@ -196,6 +204,7 @@ export const createExecution3 = (runAfter?: string): [string, PipelineNodeModel[
runAfterTasks: [task_3_4.id],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
const task_3_7: PipelineNodeModel = {
Expand All @@ -210,6 +219,7 @@ export const createExecution3 = (runAfter?: string): [string, PipelineNodeModel[
runAfterTasks: [task_3_5.id],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
const task_3_8: PipelineNodeModel = {
Expand All @@ -224,6 +234,7 @@ export const createExecution3 = (runAfter?: string): [string, PipelineNodeModel[
runAfterTasks: [task_3_2.id, task_3_7.id],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};

Expand All @@ -238,6 +249,7 @@ export const createExecution3 = (runAfter?: string): [string, PipelineNodeModel[
},
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
const task_3_3_2: PipelineNodeModel = {
Expand All @@ -252,6 +264,7 @@ export const createExecution3 = (runAfter?: string): [string, PipelineNodeModel[
},
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
const task_3_3_3: PipelineNodeModel = {
Expand All @@ -266,6 +279,7 @@ export const createExecution3 = (runAfter?: string): [string, PipelineNodeModel[
runAfterTasks: [task_3_3_1.id],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
const task_3_3_4: PipelineNodeModel = {
Expand All @@ -280,19 +294,43 @@ export const createExecution3 = (runAfter?: string): [string, PipelineNodeModel[
},
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
task_3_3.children = [task_3_3_1.id, task_3_3_2.id, task_3_3_3.id, task_3_3_4.id];

execution3.children = [task_3_1.id, task_3_2.id, task_3_3.id, task_3_4.id, task_3_5.id, task_3_6.id, task_3_7.id, task_3_8.id];
execution3.children = [
task_3_1.id,
task_3_2.id,
task_3_3.id,
task_3_4.id,
task_3_5.id,
task_3_6.id,
task_3_7.id,
task_3_8.id
];

const nodes:PipelineNodeModel[] = [execution3, task_3_1, task_3_2, task_3_3, task_3_4, task_3_5, task_3_6, task_3_7, task_3_8, task_3_3_1, task_3_3_2, task_3_3_3, task_3_3_4];
const nodes: PipelineNodeModel[] = [
execution3,
task_3_1,
task_3_2,
task_3_3,
task_3_4,
task_3_5,
task_3_6,
task_3_7,
task_3_8,
task_3_3_1,
task_3_3_2,
task_3_3_3,
task_3_3_4
];

return ['execution-3', nodes]
return ['execution-3', nodes];
};

export const createDemoPipelineGroupsNodes = (): PipelineNodeModel[] => {
const nodes:PipelineNodeModel[] = [];
const nodes: PipelineNodeModel[] = [];

const execution1: PipelineNodeModel = {
id: 'execution-1',
Expand All @@ -308,6 +346,7 @@ export const createDemoPipelineGroupsNodes = (): PipelineNodeModel[] => {
runAfterTasks: [],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
nodes.push(execution1);
Expand All @@ -316,7 +355,7 @@ export const createDemoPipelineGroupsNodes = (): PipelineNodeModel[] => {
execution1.children.push(execution2Id);
nodes.push(...execution2Nodes);

const task_1_1: PipelineNodeModel = {
const task_1_1: PipelineNodeModel = {
id: 'task_1_1',
label: 'Task 1-1',
type: 'Task',
Expand All @@ -328,9 +367,10 @@ export const createDemoPipelineGroupsNodes = (): PipelineNodeModel[] => {
runAfterTasks: [execution2Id],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
const task_1_2: PipelineNodeModel = {
const task_1_2: PipelineNodeModel = {
id: 'task_1_2',
label: 'Task 1-2',
type: 'Task',
Expand All @@ -342,9 +382,10 @@ export const createDemoPipelineGroupsNodes = (): PipelineNodeModel[] => {
runAfterTasks: [task_1_1.id],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
const task_1_3: PipelineNodeModel = {
const task_1_3: PipelineNodeModel = {
id: 'task_1_3',
label: 'Task 1-3',
type: 'Task',
Expand All @@ -356,9 +397,10 @@ export const createDemoPipelineGroupsNodes = (): PipelineNodeModel[] => {
runAfterTasks: [task_1_1.id],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
const task_1_4: PipelineNodeModel = {
const task_1_4: PipelineNodeModel = {
id: 'task_1_4',
label: 'Task 1-4',
type: 'Task',
Expand All @@ -370,6 +412,7 @@ export const createDemoPipelineGroupsNodes = (): PipelineNodeModel[] => {
runAfterTasks: [task_1_3.id],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
nodes.push(task_1_1, task_1_2, task_1_3, task_1_4);
Expand All @@ -379,7 +422,7 @@ export const createDemoPipelineGroupsNodes = (): PipelineNodeModel[] => {
execution1.children.push(execution3Id);
nodes.push(...execution3Nodes);

const task_1: PipelineNodeModel = {
const task_1: PipelineNodeModel = {
id: 'task_1',
label: 'Task 1',
type: 'Task',
Expand All @@ -391,9 +434,10 @@ export const createDemoPipelineGroupsNodes = (): PipelineNodeModel[] => {
runAfterTasks: [execution1.id],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
const task_2: PipelineNodeModel = {
const task_2: PipelineNodeModel = {
id: 'task_2',
label: 'Task 2',
type: 'Task',
Expand All @@ -405,9 +449,10 @@ export const createDemoPipelineGroupsNodes = (): PipelineNodeModel[] => {
runAfterTasks: [execution1.id],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
const task_3: PipelineNodeModel = {
const task_3: PipelineNodeModel = {
id: 'task_3',
label: 'Task 3',
type: 'Task',
Expand All @@ -419,9 +464,10 @@ export const createDemoPipelineGroupsNodes = (): PipelineNodeModel[] => {
runAfterTasks: [execution1.id],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
const task_4: PipelineNodeModel = {
const task_4: PipelineNodeModel = {
id: 'task_4',
label: 'Task 4',
type: 'Task',
Expand All @@ -433,9 +479,10 @@ export const createDemoPipelineGroupsNodes = (): PipelineNodeModel[] => {
runAfterTasks: [task_3.id],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
const task_5: PipelineNodeModel = {
const task_5: PipelineNodeModel = {
id: 'task_5',
label: 'Task 5',
type: 'Task',
Expand All @@ -447,9 +494,10 @@ export const createDemoPipelineGroupsNodes = (): PipelineNodeModel[] => {
runAfterTasks: [task_3.id],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
const task_6: PipelineNodeModel = {
const task_6: PipelineNodeModel = {
id: 'task_6',
label: 'Task 6',
type: 'Task',
Expand All @@ -461,6 +509,7 @@ export const createDemoPipelineGroupsNodes = (): PipelineNodeModel[] => {
runAfterTasks: [task_4.id],
data: {
status: RunStatus.Succeeded,
isDependency: true
}
};
nodes.push(task_1, task_2, task_3, task_4, task_5, task_6);
Expand Down
Loading

0 comments on commit 230dce8

Please sign in to comment.