From 2e90cd8d31d8b2f20ca9c87c0e0a77b85398eeed Mon Sep 17 00:00:00 2001 From: Alex Corey Date: Tue, 27 Oct 2020 14:37:09 -0400 Subject: [PATCH] fixes failing tests and template list dropdown --- .../Template/TemplateList/TemplateList.jsx | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/awx/ui_next/src/screens/Template/TemplateList/TemplateList.jsx b/awx/ui_next/src/screens/Template/TemplateList/TemplateList.jsx index b98d44bd8b..e88e6ce4db 100644 --- a/awx/ui_next/src/screens/Template/TemplateList/TemplateList.jsx +++ b/awx/ui_next/src/screens/Template/TemplateList/TemplateList.jsx @@ -133,32 +133,36 @@ function TemplateList({ i18n }) { jtActions && Object.prototype.hasOwnProperty.call(jtActions, 'POST'); const canAddWFJT = wfjtActions && Object.prototype.hasOwnProperty.call(wfjtActions, 'POST'); - // spreading Set() returns only unique keys const addTempate = toTitleCase(i18n._(t`Add Job Template`)); const addWFTemplate = toTitleCase(i18n._(t`Add Workflow Template`)); + const addDropDownButton = []; + if (canAddJT) { + addDropDownButton.push( + + {addTempate} + + ); + } + if (canAddWFJT) { + addDropDownButton.push( + + {addWFTemplate} + + ); + } const addButton = ( - - {addTempate} - , - - {addWFTemplate} - , - ]} - /> + ); return (