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