mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
Merge pull request #12178 from Tioborto/feat/add-token-description-column
feat: add token description column
This commit is contained in:
@@ -7,6 +7,7 @@ import { parseQueryString, updateQueryString } from 'util/qs';
|
|||||||
|
|
||||||
const Th = styled(PFTh)`
|
const Th = styled(PFTh)`
|
||||||
--pf-c-table--cell--Overflow: initial;
|
--pf-c-table--cell--Overflow: initial;
|
||||||
|
--pf-c-table--cell--MaxWidth: none;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export default function HeaderRow({
|
export default function HeaderRow({
|
||||||
|
|||||||
@@ -9071,7 +9071,7 @@ msgstr "Utilisateur"
|
|||||||
|
|
||||||
#: components/AppContainer/PageHeaderToolbar.js:165
|
#: components/AppContainer/PageHeaderToolbar.js:165
|
||||||
msgid "User Details"
|
msgid "User Details"
|
||||||
msgstr "Détails de l'erreur"
|
msgstr "Détails de l'utilisateur"
|
||||||
|
|
||||||
#: screens/Setting/SettingList.js:117
|
#: screens/Setting/SettingList.js:117
|
||||||
#: screens/Setting/Settings.js:114
|
#: screens/Setting/Settings.js:114
|
||||||
|
|||||||
@@ -134,6 +134,10 @@ function UserTokenList() {
|
|||||||
name: t`Application name`,
|
name: t`Application name`,
|
||||||
key: 'application__name',
|
key: 'application__name',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: t`Description`,
|
||||||
|
key: 'description',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: t`Scope`,
|
name: t`Scope`,
|
||||||
key: 'scope',
|
key: 'scope',
|
||||||
@@ -181,6 +185,7 @@ function UserTokenList() {
|
|||||||
headerRow={
|
headerRow={
|
||||||
<HeaderRow qsConfig={QS_CONFIG}>
|
<HeaderRow qsConfig={QS_CONFIG}>
|
||||||
<HeaderCell sortKey="application__name">{t`Application Name`}</HeaderCell>
|
<HeaderCell sortKey="application__name">{t`Application Name`}</HeaderCell>
|
||||||
|
<HeaderCell sortKey="description">{t`Description`}</HeaderCell>
|
||||||
<HeaderCell sortKey="scope">{t`Scope`}</HeaderCell>
|
<HeaderCell sortKey="scope">{t`Scope`}</HeaderCell>
|
||||||
<HeaderCell sortKey="expires">{t`Expires`}</HeaderCell>
|
<HeaderCell sortKey="expires">{t`Expires`}</HeaderCell>
|
||||||
</HeaderRow>
|
</HeaderRow>
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ function UserTokenListItem({ token, isSelected, onSelect, rowIndex }) {
|
|||||||
: t`Personal access token`}
|
: t`Personal access token`}
|
||||||
</Link>
|
</Link>
|
||||||
</Td>
|
</Td>
|
||||||
|
<Td dataLabel={t`Description`} id={`token-description-${token.id}`}>
|
||||||
|
{toTitleCase(token.description)}
|
||||||
|
</Td>
|
||||||
<Td dataLabel={t`Scope`} id={`token-scope-${token.id}`}>
|
<Td dataLabel={t`Scope`} id={`token-scope-${token.id}`}>
|
||||||
{toTitleCase(token.scope)}
|
{toTitleCase(token.scope)}
|
||||||
</Td>
|
</Td>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const token = {
|
|||||||
},
|
},
|
||||||
created: '2020-06-23T15:06:43.188634Z',
|
created: '2020-06-23T15:06:43.188634Z',
|
||||||
modified: '2020-06-23T15:06:43.224151Z',
|
modified: '2020-06-23T15:06:43.224151Z',
|
||||||
description: '',
|
description: 'foobar-token',
|
||||||
user: 1,
|
user: 1,
|
||||||
token: '************',
|
token: '************',
|
||||||
refresh_token: '************',
|
refresh_token: '************',
|
||||||
@@ -62,8 +62,9 @@ describe('<UserTokenListItem />', () => {
|
|||||||
});
|
});
|
||||||
expect(wrapper.find('Td').first().prop('select').isSelected).toBe(false);
|
expect(wrapper.find('Td').first().prop('select').isSelected).toBe(false);
|
||||||
expect(wrapper.find('Td').at(1).text()).toBe('Foobar app');
|
expect(wrapper.find('Td').at(1).text()).toBe('Foobar app');
|
||||||
expect(wrapper.find('Td').at(2).text()).toContain('Read');
|
expect(wrapper.find('Td').at(2).text()).toBe('Foobar-token');
|
||||||
expect(wrapper.find('Td').at(3).text()).toContain('10/25/3019, 3:06:43 PM');
|
expect(wrapper.find('Td').at(3).text()).toContain('Read');
|
||||||
|
expect(wrapper.find('Td').at(4).text()).toContain('10/25/3019, 3:06:43 PM');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should render personal access token row properly', async () => {
|
test('should render personal access token row properly', async () => {
|
||||||
@@ -89,8 +90,9 @@ describe('<UserTokenListItem />', () => {
|
|||||||
});
|
});
|
||||||
expect(wrapper.find('Td').first().prop('select').isSelected).toBe(false);
|
expect(wrapper.find('Td').first().prop('select').isSelected).toBe(false);
|
||||||
expect(wrapper.find('Td').at(1).text()).toEqual('Personal access token');
|
expect(wrapper.find('Td').at(1).text()).toEqual('Personal access token');
|
||||||
expect(wrapper.find('Td').at(2).text()).toEqual('Write');
|
expect(wrapper.find('Td').at(2).text()).toEqual('Foobar-token');
|
||||||
expect(wrapper.find('Td').at(3).text()).toContain('10/25/3019, 3:06:43 PM');
|
expect(wrapper.find('Td').at(3).text()).toEqual('Write');
|
||||||
|
expect(wrapper.find('Td').at(4).text()).toContain('10/25/3019, 3:06:43 PM');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should be checked', async () => {
|
test('should be checked', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user