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}
pluralizedItemName={t`Organizations`}
qsConfig={QS_CONFIG}
toolbarSearchColumns={[
{ name: t`Name`, key: 'name__icontains', isDefault: true },
]}
headerRow={
<HeaderRow qsConfig={QS_CONFIG} isSelectable={false}>
<HeaderCell sortKey="name">{t`Name`}</HeaderCell>

View File

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

View File

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