Skip to content

Commit

Permalink
Merge pull request #3843 from dlabrecq/wrapping
Browse files Browse the repository at this point in the history
Platform projects table wraps names incorrectly
  • Loading branch information
dlabrecq authored May 6, 2024
2 parents 7365125 + a34871d commit 508b6f5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
2 changes: 2 additions & 0 deletions src/routes/components/dataTable/dataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class DataTable extends React.Component<DataTableProps, any> {
{row.cells.map((item, cellIndex) =>
cellIndex === 0 && isSelectable ? (
<Td
className={item.className}
dataLabel={columns[cellIndex].name}
key={`cell-${cellIndex}-${rowIndex}`}
modifier="nowrap"
Expand All @@ -169,6 +170,7 @@ class DataTable extends React.Component<DataTableProps, any> {
/>
) : (
<Td
className={item.className}
dataLabel={columns[cellIndex].name}
key={`cell-${rowIndex}-${cellIndex}`}
modifier="nowrap"
Expand Down
10 changes: 10 additions & 0 deletions src/routes/settings/platformProjects/platformProjects.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@media only screen and (min-width: 1450px) {
.pf-v5-c-table__td {
&.defaultColumn {
width: 70%;
}
&.groupColumn {
width: 20%;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,12 @@ export const styles = {
action: {
marginLeft: global_spacer_md.var,
},
defaultColumn: {
width: '20%',
},
descContainer: {
backgroundColor: global_BackgroundColor_light_100.value,
paddingLeft: global_spacer_md.value,
paddingRight: global_spacer_md.value,
paddingTop: global_spacer_md.value,
},
groupColumn: {
width: '20%',
},
nameColumn: {
width: '1%',
},
pagination: {
backgroundColor: global_BackgroundColor_light_100.value,
paddingBottom: global_spacer_md.value,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'routes/components/dataTable/dataTable.scss';
import './platformProjects.scss';

import { Label } from '@patternfly/react-core';
import type { Settings, SettingsData } from 'api/settings';
Expand All @@ -8,8 +9,6 @@ import { useIntl } from 'react-intl';
import { Cluster } from 'routes/components/cluster';
import { DataTable } from 'routes/components/dataTable';

import { styles } from './platformProjects.styles';

interface PlatformProjectsTableOwnProps {
canWrite?: boolean;
filterBy?: any;
Expand Down Expand Up @@ -75,17 +74,17 @@ const PlatformProjectsTable: React.FC<PlatformProjectsTableProps> = ({
{}, // Empty cell for row selection
{
value: item.project ? item.project : '',
style: styles.nameColumn,
},
{
className: 'defaultColumn',
value: item.default ? <Label color="green">{intl.formatMessage(messages.default)}</Label> : null,
},
{
className: 'groupColumn',
value:
item.group === 'Platform' ? <Label color="green">{intl.formatMessage(messages.platform)}</Label> : null,
style: styles.defaultColumn,
},
{ value: <Cluster clusters={item.clusters} groupBy="clusters" />, style: styles.groupColumn },
{ value: <Cluster clusters={item.clusters} groupBy="clusters" /> },
],
item,
selected: selectedItems && selectedItems.find(val => val.project === item.project) !== undefined,
Expand Down

0 comments on commit 508b6f5

Please sign in to comment.