-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes docs link for controller versions >= 4.3
- Loading branch information
1 parent
40d18e9
commit 4ed5549
Showing
1 changed file
with
10 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`; | ||
} |