From 62c91aea4acf51a03ce496527300b9f75d725280 Mon Sep 17 00:00:00 2001 From: Marliana Lara Date: Fri, 9 Apr 2021 15:42:41 -0400 Subject: [PATCH] Fix bug where falsy details return 0 --- .../components/TemplateList/TemplateListItem.jsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/awx/ui_next/src/components/TemplateList/TemplateListItem.jsx b/awx/ui_next/src/components/TemplateList/TemplateListItem.jsx index 2e056b17d5..ca935c6f7a 100644 --- a/awx/ui_next/src/components/TemplateList/TemplateListItem.jsx +++ b/awx/ui_next/src/components/TemplateList/TemplateListItem.jsx @@ -231,11 +231,13 @@ function TemplateListItem({ value={template.description} dataCy={`template-${template.id}-description`} /> - } - dataCy={`template-${template.id}-activity`} - /> + {summaryFields.recent_jobs && summaryFields.recent_jobs.length ? ( + } + dataCy={`template-${template.id}-activity`} + /> + ) : null} {summaryFields.organization && ( - {summaryFields.credentials && summaryFields.credentials.length && ( + {summaryFields.credentials && summaryFields.credentials.length ? ( - )} + ) : null} {summaryFields.labels && summaryFields.labels.results.length > 0 && (