From ae29eb9673a3c4f071870b829cb09cadd0c88d0b Mon Sep 17 00:00:00 2001 From: nixocio Date: Wed, 30 Sep 2020 13:32:43 -0400 Subject: [PATCH] Make ContainerGroupDetails a bit more robust In order to create a container group is necessary to provide a credential. See: https://github.com/ansible/awx/issues/8184 This change makes the code related to display the credential as part of the container group details a bit more robust. Avoiding to attempt to show a non-existent credential - what is not supposed to exist. Closes: https://github.com/ansible/awx/issues/8199 --- .../ContainerGroupDetails.jsx | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/awx/ui_next/src/screens/InstanceGroup/ContainerGroupDetails/ContainerGroupDetails.jsx b/awx/ui_next/src/screens/InstanceGroup/ContainerGroupDetails/ContainerGroupDetails.jsx index a9e90229b0..6cce625c78 100644 --- a/awx/ui_next/src/screens/InstanceGroup/ContainerGroupDetails/ContainerGroupDetails.jsx +++ b/awx/ui_next/src/screens/InstanceGroup/ContainerGroupDetails/ContainerGroupDetails.jsx @@ -48,15 +48,17 @@ function ContainerGroupDetails({ instanceGroup, i18n }) { value={i18n._(t`Container group`)} dataCy="container-group-type" /> - - {instanceGroup.summary_fields.credential.name} - - } - dataCy="container-group-credential" - /> + {instanceGroup.summary_fields.credential && ( + + {instanceGroup.summary_fields.credential?.name} + + } + dataCy="container-group-credential" + /> + )}