Skip to content

Commit

Permalink
fixes docs link for controller versions >= 4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSCorey committed Jul 26, 2023
1 parent 852bb07 commit 4630e7b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion awx/ui/src/util/getDocsBaseUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ 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';
// eslint-disable-next-line no-nested-ternary
version = config?.version
? parseFloat(config.version.split('-')[0]) >= 4.3
? parseFloat(config.version.split('-')[0])
: config.version.split('-')[0]
: 'latest';
}
return `https://docs.ansible.com/automation-controller/${version}`;
}

0 comments on commit 4630e7b

Please sign in to comment.