From bd0089fd35541d73a2a13be56e7d002cde035486 Mon Sep 17 00:00:00 2001 From: Alex Corey Date: Wed, 26 Jul 2023 17:54:39 -0400 Subject: [PATCH] fixes docs link for controller versions >= 4.3 (#14287) --- awx/ui/src/util/getDocsBaseUrl.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/awx/ui/src/util/getDocsBaseUrl.js b/awx/ui/src/util/getDocsBaseUrl.js index d88996a751..6b408ca8d3 100644 --- a/awx/ui/src/util/getDocsBaseUrl.js +++ b/awx/ui/src/util/getDocsBaseUrl.js @@ -1,8 +1,17 @@ export default function getDocsBaseUrl(config) { let version = 'latest'; const licenseType = config?.license_info?.license_type; + if (licenseType && licenseType !== 'open') { - version = config?.version ? config.version.split('-')[0] : 'latest'; + if (config?.version) { + if (parseFloat(config?.version.split('-')[0]) >= 4.3) { + version = parseFloat(config?.version.split('-')[0]); + } else { + version = config?.version.split('-')[0]; + } + } + } else { + version = 'latest'; } return `https://docs.ansible.com/automation-controller/${version}`; }