Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove direct references to table classNames
Browse files Browse the repository at this point in the history
- they no longer have styles attached to them and thus no longer do anything

- replace with direct component usage instead (or in some cases remove if they're not doing anything)
cee-chen committed Apr 11, 2024
1 parent 3db5f8c commit 86ce80b
Showing 6 changed files with 27 additions and 67 deletions.
Original file line number Diff line number Diff line change
@@ -133,7 +133,7 @@ export const BenchmarksSection = ({
id="xpack.csp.dashboard.benchmarkSection.columnsHeader.complianceScoreTitle"
defaultMessage="Compliance Score"
/>
<EuiIcon className="euiTableSortIcon" type={benchmarkSortingIcon} />
<EuiIcon type={benchmarkSortingIcon} />
</div>
</EuiTitle>
</button>
Original file line number Diff line number Diff line change
@@ -56,9 +56,7 @@ export const markdownRenderers = (
refs: MutableRefObject<Map<string, HTMLDivElement | null>>
): TransformOptions['components'] => {
return {
table: ({ children }) => (
<EuiTable className="euiEuiTable euiTable--responsive">{children}</EuiTable>
),
table: ({ children }) => <EuiTable>{children}</EuiTable>,
tr: ({ children }) => <EuiTableRow>{children}</EuiTableRow>,
th: ({ children }) => <EuiTableHeaderCell>{children}</EuiTableHeaderCell>,
td: ({ children }) => <EuiTableRowCell>{children}</EuiTableRowCell>,
Original file line number Diff line number Diff line change
@@ -374,24 +374,11 @@ export class IndexTable extends Component {
return columnConfigs.map((columnConfig) => {
const { name } = index;
const { fieldName } = columnConfig;
if (fieldName === 'name') {
return (
<th
key={`${fieldName}-${name}`}
className="euiTableRowCell"
scope="row"
data-test-subj={`indexTableCell-${fieldName}`}
>
<div className={`euiTableCellContent indTable__cell--${fieldName}`}>
<span className="eui-textLeft">{this.buildRowCell(index, columnConfig)}</span>
</div>
</th>
);
}
return (
<EuiTableRowCell
key={`${fieldName}-${name}`}
truncateText={false}
setScopeRow={fieldName === 'name'}
data-test-subj={`indexTableCell-${fieldName}`}
className={'indTable__cell--' + fieldName}
header={fieldName}
Original file line number Diff line number Diff line change
@@ -304,13 +304,10 @@ export class JobsList extends Component {
field: 'latestTimestampSortValue',
'data-test-subj': 'mlJobListColumnLatestTimestamp',
sortable: true,
render: (time, item) => (
<span className="euiTableCellContent__text">
{item.latestTimestampMs === undefined
? ''
: moment(item.latestTimestampMs).format(TIME_FORMAT)}
</span>
),
render: (time, item) =>
item.latestTimestampMs === undefined
? ''
: moment(item.latestTimestampMs).format(TIME_FORMAT),
textOnly: true,
width: '15%',
},
Original file line number Diff line number Diff line change
@@ -5,6 +5,10 @@
* 2.0.
*/
import {
EuiTable,
EuiTableRow,
EuiTableRowCell,
EuiTableHeaderCell,
EuiMarkdownFormat,
EuiSpacer,
EuiText,
@@ -141,36 +145,21 @@ export function MessageText({ loading, content, onActionClick }: Props) {
},
table: (props) => (
<>
<div className="euiBasicTable">
{' '}
<table className="euiTable" {...props} />
</div>
<EuiTable {...props} />
<EuiSpacer size="m" />
</>
),
th: (props) => {
const { children, ...rest } = props;
return (
<th className="euiTableHeaderCell" {...rest}>
<span className="euiTableCellContent">
<span className="euiTableCellContent__text" title={children}>
{children}
</span>
</span>
</th>
);
return <EuiTableHeaderCell {...rest}>{children}</EuiTableHeaderCell>;
},
tr: (props) => <tr className="euiTableRow" {...props} />,
tr: (props) => <EuiTableRow {...props} />,
td: (props) => {
const { children, ...rest } = props;
return (
<td className="euiTableRowCell" {...rest}>
<div className="euiTableCellContent euiTableCellContent--truncateText">
<span className="euiTableCellContent__text" title={children}>
{children}
</span>
</div>
</td>
<EuiTableRowCell truncateText={true} {...rest}>
{children}
</EuiTableRowCell>
);
},
};
Original file line number Diff line number Diff line change
@@ -5,6 +5,10 @@
* 2.0.
*/
import {
EuiTable,
EuiTableRow,
EuiTableRowCell,
EuiTableHeaderCell,
EuiMarkdownFormat,
EuiSpacer,
EuiText,
@@ -114,36 +118,21 @@ const getPluginDependencies = () => {
},
table: (props) => (
<>
<div className="euiBasicTable">
{' '}
<table className="euiTable" {...props} />
</div>
<EuiTable {...props} />
<EuiSpacer size="m" />
</>
),
th: (props) => {
const { children, ...rest } = props;
return (
<th className="euiTableHeaderCell" {...rest}>
<span className="euiTableCellContent">
<span className="euiTableCellContent__text" title={children}>
{children}
</span>
</span>
</th>
);
return <EuiTableHeaderCell {...rest}>{children}</EuiTableHeaderCell>;
},
tr: (props) => <tr className="euiTableRow" {...props} />,
tr: (props) => <EuiTableRow {...props} />,
td: (props) => {
const { children, ...rest } = props;
return (
<td className="euiTableRowCell" {...rest}>
<div className="euiTableCellContent euiTableCellContent--truncateText">
<span className="euiTableCellContent__text" title={children}>
{children}
</span>
</div>
</td>
<EuiTableRowCell truncateText={true} {...rest}>
{children}
</EuiTableRowCell>
);
},
};

0 comments on commit 86ce80b

Please sign in to comment.