Skip to content

Commit

Permalink
use hypens consistently in URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
keithjgrant committed May 22, 2024
1 parent 731aa00 commit 4f822ea
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ describe('Create Edit Container Group Form', () => {
{ fixture: 'credentials.json' }
);
cy.mount(<CreateContainerGroup />, {
path: '/instance_groups/container-group/create',
initialEntries: [`/instance_groups/container-group/create`],
path: '/instance-groups/container-group/create',
initialEntries: [`/instance-groups/container-group/create`],
});
cy.get('[data-cy="name"]').type('Test name');
cy.get('[data-cy="credential-select"]').type('E2E Credential ARWM');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ describe('Create Edit Instance Group Form', () => {

it('should pass correct request body after editing ee', () => {
cy.mount(<EditInstanceGroup />, {
path: '/instance_groups/:id/edit',
initialEntries: [`/instance_groups/1/edit`],
path: '/instance-groups/:id/edit',
initialEntries: [`/instance-groups/1/edit`],
});
cy.get('[data-cy="name"]').clear();
cy.get('[data-cy="name"]').type('Test name- edited');
Expand Down Expand Up @@ -99,8 +99,8 @@ describe('Create Edit Instance Group Form', () => {

it('should validate required fields on save', () => {
cy.mount(<EditInstanceGroup />, {
path: '/instance_groups/:id/edit',
initialEntries: [`/instance_groups/1/edit`],
path: '/instance-groups/:id/edit',
initialEntries: [`/instance-groups/1/edit`],
});
cy.get('[data-cy="name"]').clear();
cy.clickButton(/^Save Instance Group$/);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ describe('Instance Group Details', () => {
{ fixture: 'instance_group.json' }
);
cy.mount(<InstanceGroupDetails />, {
path: 'instance_groups/:id/details',
initialEntries: ['/instance_groups/1/details'],
path: 'instance-groups/:id/details',
initialEntries: ['/instance-groups/1/details'],
});
cy.fixture('instance_group').then((instance_group: InstanceGroup) => {
cy.get('[data-cy="name"]').should('have.text', instance_group.name);
Expand Down Expand Up @@ -42,8 +42,8 @@ describe('Instance Group Details', () => {
{ fixture: 'container_group.json' }
);
cy.mount(<InstanceGroupDetails />, {
path: 'instance_groups/:id/details',
initialEntries: ['/instance_groups/2/details'],
path: 'instance-groups/:id/details',
initialEntries: ['/instance-groups/2/details'],
});
cy.fixture('container_group').then((container_group: InstanceGroup) => {
cy.get('[data-cy="name"]').should('have.text', container_group.name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ describe('InstanceGroupTeamAccess', () => {
});

it('should render team assignments', () => {
const path = '/instance_groups/instance_group/:id/team-access';
const initialEntries = ['/instance_groups/instance_group/1/team-access'];
const path = '/instance-groups/instance_group/:id/team-access';
const initialEntries = ['/instance-groups/instance_group/1/team-access'];
const params = {
path,
initialEntries,
Expand Down
2 changes: 1 addition & 1 deletion frontend/awx/main/routes/useAwxInstanceGroupsRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function useAwxInstanceGroupsRoutes() {
() => ({
id: AwxRoute.InstanceGroups,
label: t('Instance Groups'),
path: 'instance_groups',
path: 'instance-groups',
children: [
{
id: AwxRoute.CreateContainerGroup,
Expand Down
12 changes: 6 additions & 6 deletions frontend/awx/main/routes/useAwxInventoryRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export function useAwxInventoryRoutes() {
},
{
id: AwxRoute.InventoryGroupRelatedGroupsCreate,
path: ':inventory_type/:id/groups/:group_id/nested_groups/add',
path: ':inventory_type/:id/groups/:group_id/nested-groups/add',
element: <CreateRelatedGroup />,
},
{
Expand All @@ -153,19 +153,19 @@ export function useAwxInventoryRoutes() {
},
{
id: AwxRoute.InventoryGroupRelatedGroups,
path: 'nested_groups',
path: 'nested-groups',
element: <GroupRelatedGroups />,
},
{
id: AwxRoute.InventoryGroupHost,
path: 'nested_hosts',
path: 'nested-hosts',
element: <GroupHosts />,
},
],
},
{
id: AwxRoute.InventoryGroupHostAdd,
path: ':inventory_type/:id/group/:group_id/nested_hosts/add',
path: ':inventory_type/:id/group/:group_id/nested-hosts/add',
element: <CreateHost />,
},
{
Expand Down Expand Up @@ -264,12 +264,12 @@ export function useAwxInventoryRoutes() {
},
{
id: AwxRoute.CreateSmartInventory,
path: 'smart_inventory/create',
path: 'smart-inventory/create',
element: <CreateInventory inventoryKind="smart" />,
},
{
id: AwxRoute.CreateConstructedInventory,
path: 'constructed_inventory/create',
path: 'constructed-inventory/create',
element: <CreateInventory inventoryKind="constructed" />,
},
{
Expand Down
2 changes: 1 addition & 1 deletion frontend/awx/main/routes/useAwxProjectRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function useAwxProjectRoutes() {
},
{
id: AwxRoute.ProjectJobTemplates,
path: 'job_templates',
path: 'job-templates',
element: <ProjectJobTemplates />,
},
{
Expand Down
6 changes: 3 additions & 3 deletions frontend/awx/main/routes/useAwxTemplateRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function useAwxTemplateRoutes() {
path: 'templates',
children: [
{
path: 'job_template',
path: 'job-template',
children: [
{
id: AwxRoute.CreateJobTemplate,
Expand Down Expand Up @@ -172,7 +172,7 @@ export function useAwxTemplateRoutes() {
],
},
{
path: 'workflow_job_template',
path: 'workflow-job-template',
children: [
{
id: AwxRoute.CreateWorkflowJobTemplate,
Expand Down Expand Up @@ -256,7 +256,7 @@ export function useAwxTemplateRoutes() {
},
{
id: AwxRoute.WorkflowJobTemplateJobs,
path: 'workflow_jobs',
path: 'workflow-jobs',
element: <TemplateJobs resourceType="workflow_job_templates" />,
},
{
Expand Down
6 changes: 3 additions & 3 deletions frontend/awx/resources/groups/GroupHosts.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ describe('GroupHosts', () => {
const kinds = ['', 'constructed'];

kinds.forEach((kind) => {
const path = '/inventories/:inventory_type/:id/groups/:group_id/nested_hosts';
const path = '/inventories/:inventory_type/:id/groups/:group_id/nested-hosts';
const initialEntries =
kind === ''
? ['/inventories/inventory/1/groups/176/nested_hosts']
: ['/inventories/constructed_inventory/1/groups/176/nested_hosts'];
? ['/inventories/inventory/1/groups/176/nested-hosts']
: ['/inventories/constructed_inventory/1/groups/176/nested-hosts'];

it(`renders group hosts (${kind === '' ? 'inventory' : kind})`, () => {
cy.mount(<GroupHosts />, {
Expand Down
4 changes: 2 additions & 2 deletions frontend/awx/resources/groups/GroupRelatedGroups.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const inventories = ['inventory', 'constructed_inventory'];

inventories.forEach((inventory) => {
describe(`GroupRelatedGroups (${inventory})`, () => {
const path = '/inventories/:inventory_type/:id/groups/:group_id/nested_groups';
const initialEntries = [`/inventories/${inventory}/1/groups/176/nested_groups`];
const path = '/inventories/:inventory_type/:id/groups/:group_id/nested-groups';
const initialEntries = [`/inventories/${inventory}/1/groups/176/nested-groups`];

beforeEach(() => {
cy.intercept(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ describe('Empty state', () => {
{ fixture: 'workflowJobTemplate.json' }
);
cy.mount(<WorkflowVisualizer />, {
path: '/templates/workflow_job_template/:id/visualizer',
initialEntries: ['/templates/workflow_job_template/123/visualizer'],
path: '/templates/workflow-job-template/:id/visualizer',
initialEntries: ['/templates/workflow-job-template/123/visualizer'],
});
cy.get('h4.pf-v5-c-empty-state__title-text').should(
'have.text',
Expand Down Expand Up @@ -281,8 +281,8 @@ describe('Empty state', () => {
{ fixture: 'jobTemplates.json' }
);
cy.mount(<WorkflowVisualizer />, {
path: '/templates/workflow_job_template/:id/visualizer',
initialEntries: ['/templates/workflow_job_template/123/visualizer'],
path: '/templates/workflow-job-template/:id/visualizer',
initialEntries: ['/templates/workflow-job-template/123/visualizer'],
});
cy.get('div.pf-v5-c-empty-state__actions').within(() => {
cy.get('[data-cy="add-node-button"]').click();
Expand Down
4 changes: 2 additions & 2 deletions frontend/awx/resources/templates/hooks/useDeleteSurvey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ export function useDeleteSurvey(props: {
const deleteRequest = useDeleteRequest();

const jobTemplateSurveyId = useMatch(
'/templates/job_template/:id/survey'
'/templates/job-template/:id/survey'
)?.params?.id?.toString();
const workflowTemplateSurveyId = useMatch(
'/templates/workflow_job_template/:id/survey'
'/templates/workflow-job-template/:id/survey'
)?.params?.id?.toString();

const surveySpecEndpoint = jobTemplateSurveyId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export function useSurveyToolbarActions(view: ISurveyView) {
const { id } = useParams<{ id: string }>();
const deleteQuestions = useDeleteSurveyDialog(view.unselectItemsAndRefresh);

const jobTemplateSurvey = useMatch('/templates/job_template/:id/survey')?.params?.id?.toString();
const jobTemplateSurvey = useMatch('/templates/job-template/:id/survey')?.params?.id?.toString();
const workflowTemplateSurvey = useMatch(
'/templates/workflow_job_template/:id/survey'
'/templates/workflow-job-template/:id/survey'
)?.params?.id?.toString();

const { openManageQuestionOrder } = useManageSurveyQuestions(jobTemplateSurvey);
Expand Down
8 changes: 4 additions & 4 deletions frontend/awx/views/jobs/jobUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function getScheduleUrl(job: UnifiedJob) {
: '';
break;
case 'job':
scheduleUrl = `/templates/job_template/${templateId}/schedules/${scheduleId}/details`;
scheduleUrl = `/templates/job-template/${templateId}/schedules/${scheduleId}/details`;
break;
case 'project_update':
scheduleUrl = `/projects/${templateId}/schedules/${scheduleId}/details`;
Expand All @@ -77,7 +77,7 @@ export function getScheduleUrl(job: UnifiedJob) {
scheduleUrl = `/management_jobs/${templateId}/schedules/${scheduleId}/details`;
break;
case 'workflow_job':
scheduleUrl = `/templates/workflow_job_template/${templateId}/schedules/${scheduleId}/details`;
scheduleUrl = `/templates/workflow-job-template/${templateId}/schedules/${scheduleId}/details`;
break;
default:
break;
Expand Down Expand Up @@ -112,9 +112,9 @@ export function getLaunchedByDetails(job: UnifiedJob) {
case 'webhook':
value = 'Webhook';
link = jobTemplate
? `/templates/job_template/${jobTemplate.id}/details`
? `/templates/job-template/${jobTemplate.id}/details`
: workflowJT
? `/templates/workflow_job_template/${workflowJT.id}/details`
? `/templates/workflow-job-template/${workflowJT.id}/details`
: undefined;
break;
case 'scheduled':
Expand Down
16 changes: 8 additions & 8 deletions frontend/awx/views/schedules/wizard/ScheduleEditWizard.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ describe('ScheduleEditWizard', () => {

it('Should render the correct steps on initial ', () => {
cy.mount(<ScheduleEditWizard />, {
initialEntries: ['/templates/job_template/7/schedules/1/edit'],
path: '/templates/job_template/:id/schedules/:schedule_id/edit',
initialEntries: ['/templates/job-template/7/schedules/1/edit'],
path: '/templates/job-template/:id/schedules/:schedule_id/edit',
});

cy.get('[data-cy="wizard-nav"]').within(() => {
Expand All @@ -120,8 +120,8 @@ describe('ScheduleEditWizard', () => {

it('Should not go to next step due to failed validation', () => {
cy.mount(<ScheduleEditWizard />, {
initialEntries: ['/templates/job_template/7/schedules/1/edit'],
path: '/templates/job_template/:id/schedules/:schedule_id/edit',
initialEntries: ['/templates/job-template/7/schedules/1/edit'],
path: '/templates/job-template/:id/schedules/:schedule_id/edit',
});

cy.get('[data-cy="name"]').clear();
Expand All @@ -139,8 +139,8 @@ describe('ScheduleEditWizard', () => {
cy.intercept('/api/v2/job_templates/100/', { id: 100, name: 'Mock Job Template' });
cy.intercept('/api/v2/job_templates/100/launch/', {});
cy.mount(<ScheduleEditWizard />, {
initialEntries: ['/templates/job_template/7/schedules/1/edit'],
path: '/templates/job_template/:id/schedules/:schedule_id/edit',
initialEntries: ['/templates/job-template/7/schedules/1/edit'],
path: '/templates/job-template/:id/schedules/:schedule_id/edit',
});

cy.get('[data-cy="wizard-nav"]').within(() => {
Expand Down Expand Up @@ -227,8 +227,8 @@ describe('ScheduleEditWizard', () => {
});
it('Should be able to add rules while editing a schedule.', () => {
cy.mount(<ScheduleEditWizard />, {
initialEntries: ['/templates/job_template/7/schedules/1/edit'],
path: '/templates/job_template/:id/schedules/:schedule_id/edit',
initialEntries: ['/templates/job-template/7/schedules/1/edit'],
path: '/templates/job-template/:id/schedules/:schedule_id/edit',
});

cy.clickButton(/^Next$/);
Expand Down

0 comments on commit 4f822ea

Please sign in to comment.