From 0a276a6276ee8f4866aa56fab95028f7eeedc079 Mon Sep 17 00:00:00 2001 From: Alex Corey Date: Tue, 25 May 2021 15:21:01 -0400 Subject: [PATCH] resolves some poor styling on some lists --- .../components/AddRole/SelectResourceStep.jsx | 17 ++++++++++++++--- .../CheckboxListItem/CheckboxListItem.jsx | 17 ++++++++++++++--- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/awx/ui_next/src/components/AddRole/SelectResourceStep.jsx b/awx/ui_next/src/components/AddRole/SelectResourceStep.jsx index 3a0ec2c5fe..7489b707a8 100644 --- a/awx/ui_next/src/components/AddRole/SelectResourceStep.jsx +++ b/awx/ui_next/src/components/AddRole/SelectResourceStep.jsx @@ -5,11 +5,11 @@ import { t } from '@lingui/macro'; import useRequest from '../../util/useRequest'; import { SearchColumns, SortColumns } from '../../types'; -import PaginatedDataList from '../PaginatedDataList'; import DataListToolbar from '../DataListToolbar'; import CheckboxListItem from '../CheckboxListItem'; import SelectedList from '../SelectedList'; import { getQSConfig, parseQueryString } from '../../util/qs'; +import PaginatedTable, { HeaderCell, HeaderRow } from '../PaginatedTable'; const QS_Config = sortColumns => { return getQSConfig('resource', { @@ -86,7 +86,8 @@ function SelectResourceStep({ selected={selectedResourceRows} /> )} - ( + headerRow={ + + {sortColumns.map(({ name, key }) => ( + {name} + ))} + + } + renderRow={(item, index) => ( i.id === item.id)} itemId={item.id} + item={item} + rowIndex={index} key={item.id} + columns={sortColumns} name={item[displayKey]} label={item[displayKey]} onSelect={() => onRowClick(item)} diff --git a/awx/ui_next/src/components/CheckboxListItem/CheckboxListItem.jsx b/awx/ui_next/src/components/CheckboxListItem/CheckboxListItem.jsx index ac167e61de..c76a542ea2 100644 --- a/awx/ui_next/src/components/CheckboxListItem/CheckboxListItem.jsx +++ b/awx/ui_next/src/components/CheckboxListItem/CheckboxListItem.jsx @@ -13,6 +13,8 @@ const CheckboxListItem = ({ onDeselect, rowIndex, onSelect, + columns, + item, }) => { return ( @@ -28,9 +30,18 @@ const CheckboxListItem = ({ name={name} dataLabel={t`Selected`} /> - - {label} - + + {columns?.length > 0 ? ( + columns.map(col => ( + + {item[col.key]} + + )) + ) : ( + + {label} + + )} ); };