Skip to content

Commit

Permalink
Linkify reference to EE on details page
Browse files Browse the repository at this point in the history
Linkify reference to EE on a few details page.

See: ansible#9189
  • Loading branch information
nixocio committed Mar 2, 2021
1 parent d86b008 commit d85ac3a
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ function OrganizationDetail({ i18n, organization }) {
{summary_fields?.default_environment?.name && (
<Detail
label={i18n._(t`Default Execution Environment`)}
value={summary_fields.default_environment.name}
value={
<Link
to={`/execution_environments/${summary_fields.default_environment.id}/details`}
>
{summary_fields.default_environment.name}
</Link>
}
/>
)}
<UserDateDetail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,15 @@ function ProjectDetail({ project, i18n }) {
{summary_fields?.default_environment?.name && (
<Detail
label={i18n._(t`Execution Environment`)}
value={summary_fields.default_environment.name}
value={
<Link
to={`/execution_environments/${summary_fields.default_environment.id}/details`}
>
{summary_fields.default_environment.name}
</Link>
}
/>
)}

<Config>
{({ project_base_dir }) => (
<Detail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,13 @@ function JobTemplateDetail({ i18n, template }) {
{summary_fields?.execution_environment && (
<Detail
label={i18n._(t`Execution Environment`)}
value={summary_fields.execution_environment.name}
value={
<Link
to={`/execution_environments/${summary_fields.execution_environment.id}/details`}
>
{summary_fields.execution_environment.name}
</Link>
}
/>
)}
<Detail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ describe('<JobTemplateDetail />', () => {
1
);
expect(
wrapper.find('Detail[label="Execution Environment"]').prop('value')
wrapper.find(`Detail[label="Execution Environment"] dd`).text()
).toBe('Default EE');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,13 @@ function WorkflowJobTemplateDetail({ template, i18n }) {
{summary_fields?.execution_environment && (
<Detail
label={i18n._(t`Execution Environment`)}
value={summary_fields.execution_environment.name}
value={
<Link
to={`/execution_environments/${summary_fields.execution_environment.id}/details`}
>
{summary_fields.execution_environment.name}
</Link>
}
/>
)}
<Detail label={i18n._(t`Job Type`)} value={toTitleCase(type)} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,6 @@ describe('<WorkflowJobTemplateDetail/>', () => {
prop: 'value',
value: 'Workflow Job Template',
},
{
element: 'Detail[label="Execution Environment"]',
prop: 'value',
value: 'Demo EE',
},
];

const organization = wrapper
Expand All @@ -162,6 +157,10 @@ describe('<WorkflowJobTemplateDetail/>', () => {
};

renderedValues.map(value => assertValue(value));

expect(
wrapper.find(`Detail[label="Execution Environment"] dd`).text()
).toBe('Demo EE');
});

test('link out resource have the correct url', () => {
Expand Down

0 comments on commit d85ac3a

Please sign in to comment.