Skip to content

Commit 8bef571

Browse files
authored
Use CSS class for synthetic stages styling in console view (#132)
* Use CSS class for synthetic stages styling in console view * Prefix synthetic CSS class names to avoid clashes
1 parent f8a7e8c commit 8bef571

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

src/main/frontend/pipeline-console-view/pipeline-console/main/DataTreeView.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ export interface TreeItemData {
3535
children: TreeItemData[];
3636
}
3737

38-
interface StageTreeItemProps extends TreeItemProps {
39-
synthetic?: boolean;
40-
}
41-
4238
// Tree Item for stages
4339
const StageTreeItem = withStyles((theme: Theme) =>
4440
createStyles({
@@ -53,12 +49,9 @@ const StageTreeItem = withStyles((theme: Theme) =>
5349
paddingLeft: 18,
5450
borderLeft: `1px dashed ${fade(theme.palette.text.primary, 0.4)}`,
5551
},
56-
label: {
57-
fontStyle: (props: StageTreeItemProps) =>
58-
props.synthetic ? "italic" : "inherit",
59-
},
52+
label: {},
6053
})
61-
)((props: StageTreeItemProps) => <TreeItem {...props} />);
54+
)((props: TreeItemProps) => <TreeItem {...props} />);
6255

6356
// Tree Item for steps
6457
const StepTreeItem = withStyles((theme: Theme) =>
@@ -101,7 +94,11 @@ const getTreeItemsFromStage = (
10194
nodeId={String(stageItemData.id)}
10295
label={stageItemData.name}
10396
children={children}
104-
synthetic={stageItemData.synthetic}
97+
classes={{
98+
label: stageItemData.synthetic
99+
? "pgw-graph-node--synthetic"
100+
: undefined,
101+
}}
105102
/>
106103
);
107104
});

src/main/frontend/pipeline-console-view/pipeline-console/main/pipeline-console.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@
136136
box-shadow: 0 0 1px rgb(0 0 0 / 6%);
137137
}
138138

139+
.MuiTreeItem-label.pgw-graph-node--synthetic {
140+
font-style: italic;
141+
}
142+
139143
#main-panel {
140144
padding-left: 0;
141145
}

src/main/frontend/pipeline-graph-view/pipeline-graph/main/support/labels.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function BigLabel({
7878
classNames.push("selected");
7979
}
8080
if (details.stage && details.stage.synthetic) {
81-
classNames.push("synthetic");
81+
classNames.push("pgw-graph-node--synthetic");
8282
}
8383

8484
return (

src/main/frontend/pipeline-graph-view/pipeline-graph/styles/PipelineGraphWidget.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ circle.halo {
142142
font-weight: bold;
143143
}
144144

145-
.PWGx-pipeline-big-label.synthetic {
145+
.PWGx-pipeline-big-label.pgw-graph-node--synthetic {
146146
font-style: italic;
147147
}
148148

0 commit comments

Comments
 (0)