fix user list sorting issues; clean up comments

This commit is contained in:
Keith J. Grant
2021-04-30 10:23:03 -07:00
parent d1cb0781ce
commit b21db2fd31
3 changed files with 6 additions and 16 deletions

View File

@@ -56,6 +56,9 @@ function UserOrganizationList() {
itemCount={count} itemCount={count}
pluralizedItemName={t`Organizations`} pluralizedItemName={t`Organizations`}
qsConfig={QS_CONFIG} qsConfig={QS_CONFIG}
toolbarSearchColumns={[
{ name: t`Name`, key: 'name__icontains', isDefault: true },
]}
headerRow={ headerRow={
<HeaderRow qsConfig={QS_CONFIG} isSelectable={false}> <HeaderRow qsConfig={QS_CONFIG} isSelectable={false}>
<HeaderCell sortKey="name">{t`Name`}</HeaderCell> <HeaderCell sortKey="name">{t`Name`}</HeaderCell>

View File

@@ -147,17 +147,11 @@ function UserRolesList({ user }) {
isDefault: true, isDefault: true,
}, },
]} ]}
toolbarSortColumns={[
{
name: t`ID`,
key: 'id',
},
]}
toolbarSearchableKeys={searchableKeys} toolbarSearchableKeys={searchableKeys}
toolbarRelatedSearchableKeys={relatedSearchableKeys} toolbarRelatedSearchableKeys={relatedSearchableKeys}
headerRow={ headerRow={
<HeaderRow qsConfig={QS_CONFIG} isSelectable={false}> <HeaderRow qsConfig={QS_CONFIG} isSelectable={false}>
<HeaderCell sortKey="name">{t`Name`}</HeaderCell> <HeaderCell>{t`Name`}</HeaderCell>
<HeaderCell>{t`Type`}</HeaderCell> <HeaderCell>{t`Type`}</HeaderCell>
<HeaderCell>{t`Role`}</HeaderCell> <HeaderCell>{t`Role`}</HeaderCell>
</HeaderRow> </HeaderRow>

View File

@@ -44,14 +44,8 @@ describe('<UserRolesListItem/>', () => {
); );
const cells = wrapper.find('Td'); const cells = wrapper.find('Td');
expect(cells.at(0).text()).toBe('template delete project'); expect(cells.at(0).text()).toBe('template delete project');
expect( expect(cells.at(1).text()).toContain('Job Template');
cells.at(1).text() expect(cells.at(2).text()).toContain('Admin');
// wrapper.find('PFDataListCell[aria-label="Resource type"]').text()
).toContain('Job Template');
expect(
cells.at(2).text()
// wrapper.find('PFDataListCell[aria-label="Resource role"]').text()
).toContain('Admin');
}); });
test('should render deletable chip', () => { test('should render deletable chip', () => {
@@ -103,7 +97,6 @@ describe('<UserRolesListItem/>', () => {
.find('Td') .find('Td')
.at(0) .at(0)
.text() .text()
// wrapper.find('PFDataListCell[aria-label="Resource name"]').text()
).toBe('System'); ).toBe('System');
}); });
}); });