mirror of
https://github.com/ansible/awx.git
synced 2026-02-28 08:18:43 -03:30
Renames files to match the tabs better.
This commit is contained in:
@@ -16,7 +16,7 @@ import ContentError from '../../components/ContentError';
|
|||||||
import TeamDetail from './TeamDetail';
|
import TeamDetail from './TeamDetail';
|
||||||
import TeamEdit from './TeamEdit';
|
import TeamEdit from './TeamEdit';
|
||||||
import { TeamsAPI } from '../../api';
|
import { TeamsAPI } from '../../api';
|
||||||
import TeamAccessList from './TeamAccess';
|
import TeamAccessList from './TeamRoles';
|
||||||
import { ResourceAccessList } from '../../components/ResourceAccessList';
|
import { ResourceAccessList } from '../../components/ResourceAccessList';
|
||||||
|
|
||||||
function Team({ i18n, setBreadcrumb }) {
|
function Team({ i18n, setBreadcrumb }) {
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
export { default } from './TeamAccessList';
|
|
||||||
@@ -11,7 +11,7 @@ import { Link } from 'react-router-dom';
|
|||||||
import { DetailList, Detail } from '../../../components/DetailList';
|
import { DetailList, Detail } from '../../../components/DetailList';
|
||||||
import DataListCell from '../../../components/DataListCell';
|
import DataListCell from '../../../components/DataListCell';
|
||||||
|
|
||||||
function TeamAccessListItem({ role, i18n, detailUrl, onSelect }) {
|
function TeamRoleListItem({ role, i18n, detailUrl, onSelect }) {
|
||||||
const labelId = `teamRole-${role.id}`;
|
const labelId = `teamRole-${role.id}`;
|
||||||
return (
|
return (
|
||||||
<DataListItem key={role.id} aria-labelledby={labelId} id={`${role.id}`}>
|
<DataListItem key={role.id} aria-labelledby={labelId} id={`${role.id}`}>
|
||||||
@@ -60,4 +60,4 @@ function TeamAccessListItem({ role, i18n, detailUrl, onSelect }) {
|
|||||||
</DataListItem>
|
</DataListItem>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
export default withI18n()(TeamAccessListItem);
|
export default withI18n()(TeamRoleListItem);
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mountWithContexts } from '../../../../testUtils/enzymeHelpers';
|
import { mountWithContexts } from '../../../../testUtils/enzymeHelpers';
|
||||||
import TeamAccessListItem from './TeamAccessListItem';
|
import TeamRoleListItem from './TeamRoleListItem';
|
||||||
|
|
||||||
describe('<TeamAccessListItem/>', () => {
|
describe('<TeamRoleListItem/>', () => {
|
||||||
let wrapper;
|
let wrapper;
|
||||||
const role = {
|
const role = {
|
||||||
id: 1,
|
id: 1,
|
||||||
@@ -20,7 +20,7 @@ describe('<TeamAccessListItem/>', () => {
|
|||||||
|
|
||||||
test('should mount properly', () => {
|
test('should mount properly', () => {
|
||||||
wrapper = mountWithContexts(
|
wrapper = mountWithContexts(
|
||||||
<TeamAccessListItem
|
<TeamRoleListItem
|
||||||
role={role}
|
role={role}
|
||||||
detailUrl="/templates/job_template/15/details"
|
detailUrl="/templates/job_template/15/details"
|
||||||
/>
|
/>
|
||||||
@@ -31,7 +31,7 @@ describe('<TeamAccessListItem/>', () => {
|
|||||||
|
|
||||||
test('should render proper list item data', () => {
|
test('should render proper list item data', () => {
|
||||||
wrapper = mountWithContexts(
|
wrapper = mountWithContexts(
|
||||||
<TeamAccessListItem
|
<TeamRoleListItem
|
||||||
role={role}
|
role={role}
|
||||||
detailUrl="/templates/job_template/15/details"
|
detailUrl="/templates/job_template/15/details"
|
||||||
/>
|
/>
|
||||||
@@ -49,7 +49,7 @@ describe('<TeamAccessListItem/>', () => {
|
|||||||
});
|
});
|
||||||
test('should render deletable chip', () => {
|
test('should render deletable chip', () => {
|
||||||
wrapper = mountWithContexts(
|
wrapper = mountWithContexts(
|
||||||
<TeamAccessListItem
|
<TeamRoleListItem
|
||||||
role={role}
|
role={role}
|
||||||
detailUrl="/templates/job_template/15/details"
|
detailUrl="/templates/job_template/15/details"
|
||||||
/>
|
/>
|
||||||
@@ -59,7 +59,7 @@ describe('<TeamAccessListItem/>', () => {
|
|||||||
test('should render read only chip', () => {
|
test('should render read only chip', () => {
|
||||||
role.summary_fields.user_capabilities.unattach = false;
|
role.summary_fields.user_capabilities.unattach = false;
|
||||||
wrapper = mountWithContexts(
|
wrapper = mountWithContexts(
|
||||||
<TeamAccessListItem
|
<TeamRoleListItem
|
||||||
role={role}
|
role={role}
|
||||||
detailUrl="/templates/job_template/15/details"
|
detailUrl="/templates/job_template/15/details"
|
||||||
/>
|
/>
|
||||||
@@ -19,7 +19,7 @@ import PaginatedDataList from '../../../components/PaginatedDataList';
|
|||||||
import { getQSConfig, parseQueryString } from '../../../util/qs';
|
import { getQSConfig, parseQueryString } from '../../../util/qs';
|
||||||
import ErrorDetail from '../../../components/ErrorDetail';
|
import ErrorDetail from '../../../components/ErrorDetail';
|
||||||
import AlertModal from '../../../components/AlertModal';
|
import AlertModal from '../../../components/AlertModal';
|
||||||
import TeamAccessListItem from './TeamAccessListItem';
|
import TeamRoleListItem from './TeamRoleListItem';
|
||||||
import UserAndTeamAccessAdd from '../../../components/UserAndTeamAccessAdd/UserAndTeamAccessAdd';
|
import UserAndTeamAccessAdd from '../../../components/UserAndTeamAccessAdd/UserAndTeamAccessAdd';
|
||||||
|
|
||||||
const QS_CONFIG = getQSConfig('roles', {
|
const QS_CONFIG = getQSConfig('roles', {
|
||||||
@@ -28,7 +28,7 @@ const QS_CONFIG = getQSConfig('roles', {
|
|||||||
order_by: 'id',
|
order_by: 'id',
|
||||||
});
|
});
|
||||||
|
|
||||||
function TeamAccessList({ i18n }) {
|
function TeamRolesList({ i18n }) {
|
||||||
const [isWizardOpen, setIsWizardOpen] = useState(false);
|
const [isWizardOpen, setIsWizardOpen] = useState(false);
|
||||||
const { search } = useLocation();
|
const { search } = useLocation();
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
@@ -165,7 +165,7 @@ function TeamAccessList({ i18n }) {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
renderItem={role => (
|
renderItem={role => (
|
||||||
<TeamAccessListItem
|
<TeamRoleListItem
|
||||||
key={role.id}
|
key={role.id}
|
||||||
role={role}
|
role={role}
|
||||||
detailUrl={detailUrl(role)}
|
detailUrl={detailUrl(role)}
|
||||||
@@ -234,4 +234,4 @@ function TeamAccessList({ i18n }) {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
export default withI18n()(TeamAccessList);
|
export default withI18n()(TeamRolesList);
|
||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
mountWithContexts,
|
mountWithContexts,
|
||||||
waitForElement,
|
waitForElement,
|
||||||
} from '../../../../testUtils/enzymeHelpers';
|
} from '../../../../testUtils/enzymeHelpers';
|
||||||
import TeamAccessList from './TeamAccessList';
|
import TeamRolesList from './TeamRolesList';
|
||||||
|
|
||||||
jest.mock('../../../api/models/Teams');
|
jest.mock('../../../api/models/Teams');
|
||||||
jest.mock('../../../api/models/Roles');
|
jest.mock('../../../api/models/Roles');
|
||||||
@@ -92,7 +92,7 @@ const roles = {
|
|||||||
const options = {
|
const options = {
|
||||||
data: { actions: { POST: { id: 1, disassociate: true } } },
|
data: { actions: { POST: { id: 1, disassociate: true } } },
|
||||||
};
|
};
|
||||||
describe('<TeamAccessList />', () => {
|
describe('<TeamRolesList />', () => {
|
||||||
let wrapper;
|
let wrapper;
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
@@ -104,9 +104,9 @@ describe('<TeamAccessList />', () => {
|
|||||||
TeamsAPI.readRoleOptions.mockResolvedValue(options);
|
TeamsAPI.readRoleOptions.mockResolvedValue(options);
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
wrapper = mountWithContexts(<TeamAccessList />);
|
wrapper = mountWithContexts(<TeamRolesList />);
|
||||||
});
|
});
|
||||||
expect(wrapper.find('TeamAccessList').length).toBe(1);
|
expect(wrapper.find('TeamRolesList').length).toBe(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should create proper detailUrl', async () => {
|
test('should create proper detailUrl', async () => {
|
||||||
@@ -114,7 +114,7 @@ describe('<TeamAccessList />', () => {
|
|||||||
TeamsAPI.readRoleOptions.mockResolvedValue(options);
|
TeamsAPI.readRoleOptions.mockResolvedValue(options);
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
wrapper = mountWithContexts(<TeamAccessList />);
|
wrapper = mountWithContexts(<TeamRolesList />);
|
||||||
});
|
});
|
||||||
waitForElement(wrapper, 'ContentEmpty', el => el.length === 0);
|
waitForElement(wrapper, 'ContentEmpty', el => el.length === 0);
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ describe('<TeamAccessList />', () => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
wrapper = mountWithContexts(<TeamAccessList />);
|
wrapper = mountWithContexts(<TeamRolesList />);
|
||||||
});
|
});
|
||||||
|
|
||||||
waitForElement(wrapper, 'ContentEmpty', el => el.length === 0);
|
waitForElement(wrapper, 'ContentEmpty', el => el.length === 0);
|
||||||
@@ -175,7 +175,7 @@ describe('<TeamAccessList />', () => {
|
|||||||
TeamsAPI.readRoleOptions.mockResolvedValue(options);
|
TeamsAPI.readRoleOptions.mockResolvedValue(options);
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
wrapper = mountWithContexts(<TeamAccessList />);
|
wrapper = mountWithContexts(<TeamRolesList />);
|
||||||
});
|
});
|
||||||
|
|
||||||
waitForElement(wrapper, 'ContentEmpty', el => el.length === 0);
|
waitForElement(wrapper, 'ContentEmpty', el => el.length === 0);
|
||||||
@@ -228,7 +228,7 @@ describe('<TeamAccessList />', () => {
|
|||||||
TeamsAPI.readRoleOptions.mockResolvedValue(options);
|
TeamsAPI.readRoleOptions.mockResolvedValue(options);
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
wrapper = mountWithContexts(<TeamAccessList />);
|
wrapper = mountWithContexts(<TeamRolesList />);
|
||||||
});
|
});
|
||||||
|
|
||||||
waitForElement(wrapper, 'ContentEmpty', el => el.length === 0);
|
waitForElement(wrapper, 'ContentEmpty', el => el.length === 0);
|
||||||
@@ -285,7 +285,7 @@ describe('<TeamAccessList />', () => {
|
|||||||
TeamsAPI.readRoleOptions.mockResolvedValue(options);
|
TeamsAPI.readRoleOptions.mockResolvedValue(options);
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
wrapper = mountWithContexts(<TeamAccessList />);
|
wrapper = mountWithContexts(<TeamRolesList />);
|
||||||
});
|
});
|
||||||
|
|
||||||
waitForElement(
|
waitForElement(
|
||||||
1
awx/ui_next/src/screens/Team/TeamRoles/index.js
Normal file
1
awx/ui_next/src/screens/Team/TeamRoles/index.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export { default } from './TeamRolesList';
|
||||||
Reference in New Issue
Block a user