Skip to content

Commit cd7b4e7

Browse files
authored
fix(orchestraotr): resolved grey background appears in actions column in workflows table (janus-idp#1317)
FLPATH-1016: resolved grey background appears in actions column in workflows table
1 parent 2fe15f5 commit cd7b4e7

File tree

2 files changed

+34
-7
lines changed

2 files changed

+34
-7
lines changed

plugins/orchestrator/src/components/WorkflowsTable.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import React, { useCallback, useEffect, useMemo, useState } from 'react';
22
import { useNavigate } from 'react-router-dom';
33

4-
import {
5-
Link,
6-
Table,
7-
TableColumn,
8-
TableProps,
9-
} from '@backstage/core-components';
4+
import { Link, TableColumn, TableProps } from '@backstage/core-components';
105
import { useRouteRef } from '@backstage/core-plugin-api';
116

127
import Pageview from '@material-ui/icons/Pageview';
@@ -26,6 +21,7 @@ import {
2621
workflowDefinitionsRouteRef,
2722
} from '../routes';
2823
import { capitalize } from '../utils/StringUtils';
24+
import OverrideBackstageTable from './ui/OverrideBackstageTable';
2925
import { WorkflowInstanceStatusIndicator } from './WorkflowInstanceStatusIndicator';
3026

3127
export interface WorkflowsTableProps {
@@ -132,7 +128,7 @@ export const WorkflowsTable = ({ items }: WorkflowsTableProps) => {
132128
);
133129

134130
return (
135-
<Table<FormattedWorkflowOverview>
131+
<OverrideBackstageTable<FormattedWorkflowOverview>
136132
title="Workflows"
137133
options={options}
138134
columns={columns}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React from 'react';
2+
3+
import {
4+
Table as BackstageTable,
5+
TableProps,
6+
} from '@backstage/core-components';
7+
8+
import { makeStyles } from '@material-ui/core';
9+
10+
// Workaround by issue created from overriding the tab theme in the backstage-showcase to add a gray background to disabled tabs.
11+
// This is achieved by overriding the global Mui-disabled class, which results in the actions column header background turning gray.
12+
// See https://github.com/janus-idp/backstage-showcase/blob/main/packages/app/src/themes/componentOverrides.ts#L59
13+
14+
const useStyles = makeStyles({
15+
orchestratorTable: {
16+
'& .Mui-disabled': {
17+
backgroundColor: 'transparent',
18+
},
19+
},
20+
});
21+
22+
const OverrideBackstageTable = <T extends object>(props: TableProps<T>) => {
23+
const classes = useStyles();
24+
return (
25+
<div className={classes.orchestratorTable}>
26+
<BackstageTable {...props} />
27+
</div>
28+
);
29+
};
30+
31+
export default OverrideBackstageTable;

0 commit comments

Comments
 (0)