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 40d18e9 commit 4ed5549
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 4ed5549

Please sign in to comment.