Merge pull request #10358 from jakemcdermott/fix-credlink

Make IG credential linkable

SUMMARY
Make the instance group credential detail link to the cred

Reviewed-by: Kersom <None>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
This commit is contained in:
softwarefactory-project-zuul[bot] 2021-06-04 15:12:03 +00:00 committed by GitHub
commit 12f2975809
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -55,9 +55,13 @@ function ContainerGroupDetails({ instanceGroup }) {
<Detail
label={t`Credential`}
value={
<Label variant="outline" color="blue">
{instanceGroup.summary_fields.credential?.name}
</Label>
<Link
to={`/credentials/${instanceGroup?.summary_fields?.credential?.id}`}
>
<Label variant="outline" color="blue">
{instanceGroup?.summary_fields?.credential?.name}
</Label>
</Link>
}
dataCy="container-group-credential"
/>

View File

@ -70,9 +70,9 @@ describe('<ContainerGroupDetails/>', () => {
expect(wrapper.find('Detail[label="Type"]').prop('value')).toEqual(
'Container group'
);
expect(
wrapper.find('Detail[label="Credential"]').prop('value').props.children
).toEqual(instanceGroup.summary_fields.credential.name);
expect(wrapper.find('Detail[label="Credential"]').text()).toContain(
instanceGroup.summary_fields.credential.name
);
expect(wrapper.find('VariablesDetail').prop('value')).toEqual(
instanceGroup.pod_spec_override
);