Skip to content

Commit

Permalink
fixes docs link for controller versions >= 4.3 (ansible#14287)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSCorey authored and djyasin committed Sep 11, 2024
1 parent a6208f7 commit 18e1ec5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion awx/ui/src/util/getDocsBaseUrl.js
Original file line number Diff line number Diff line change
@@ -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}`;
}

0 comments on commit 18e1ec5

Please sign in to comment.