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 (