mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 10:30:03 -03:30
make call to pendo setting and set check box based on that when license already exists
This commit is contained in:
parent
f8c6187007
commit
c65342acc9
@ -9,9 +9,9 @@ import {N_} from "../i18n";
|
||||
export default
|
||||
['Wait', '$state', '$scope', '$rootScope',
|
||||
'ProcessErrors', 'CheckLicense', 'moment','$window',
|
||||
'ConfigService', 'FeaturesService', 'pendoService', 'i18n', 'config',
|
||||
'ConfigService', 'FeaturesService', 'pendoService', 'i18n', 'config', 'Rest', 'GetBasePath',
|
||||
function(Wait, $state, $scope, $rootScope, ProcessErrors, CheckLicense, moment,
|
||||
$window, ConfigService, FeaturesService, pendoService, i18n, config) {
|
||||
$window, ConfigService, FeaturesService, pendoService, i18n, config, Rest, GetBasePath) {
|
||||
|
||||
const calcDaysRemaining = function(seconds) {
|
||||
// calculate the number of days remaining on the license
|
||||
@ -43,7 +43,7 @@ export default
|
||||
if ($rootScope.licenseMissing) {
|
||||
$scope.title = $rootScope.BRAND_NAME + i18n._(" License");
|
||||
} else {
|
||||
$scope.title = i18n._("License Management")
|
||||
$scope.title = i18n._("License Management");
|
||||
}
|
||||
|
||||
$scope.license = config;
|
||||
@ -55,7 +55,19 @@ export default
|
||||
$scope.compliant = $scope.license.license_info.compliant;
|
||||
$scope.newLicense = {};
|
||||
|
||||
$scope.newLicense.pendo = true;
|
||||
Rest.setUrl(`${GetBasePath('settings')}ui`);
|
||||
Rest.get()
|
||||
.then(({data}) => {
|
||||
if (data.PENDO_TRACKING_STATE === 'off' && !$rootScope.licenseMissing) {
|
||||
$scope.newLicense.pendo = false;
|
||||
} else {
|
||||
$scope.newLicense.pendo = true;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
// default pendo tracking to true when settings is not accessible
|
||||
$scope.newLicense.pendo = true;
|
||||
});
|
||||
};
|
||||
|
||||
init(config);
|
||||
|
||||
@ -130,7 +130,7 @@
|
||||
<a target="_blank"
|
||||
href="http://docs.ansible.com/ansible-tower/latest/html/installandreference/user-data.html#index-0">
|
||||
this Tower documentation page
|
||||
</a>.
|
||||
</a>. Uncheck this box to disable this feature.
|
||||
</translate>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user