Only show pendo checkbox on in license form if license is missing

This commit is contained in:
mabashian
2018-07-17 19:31:20 -04:00
parent 5c7c441b47
commit e82d4e9664
2 changed files with 29 additions and 42 deletions

View File

@@ -53,21 +53,9 @@ export default
$scope.time.expiresOn = calcExpiresOn($scope.license.license_info.license_date); $scope.time.expiresOn = calcExpiresOn($scope.license.license_info.license_date);
$scope.valid = CheckLicense.valid($scope.license.license_info); $scope.valid = CheckLicense.valid($scope.license.license_info);
$scope.compliant = $scope.license.license_info.compliant; $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); init(config);
@@ -119,14 +107,13 @@ export default
delete($rootScope.features); delete($rootScope.features);
FeaturesService.get(); FeaturesService.get();
if ($rootScope.licenseMissing === true) {
if ($scope.newLicense.pendo) { if ($scope.newLicense.pendo) {
pendoService.updatePendoTrackingState('detailed'); pendoService.updatePendoTrackingState('detailed');
pendoService.issuePendoIdentity(); pendoService.issuePendoIdentity();
} else { } else {
pendoService.updatePendoTrackingState('off'); pendoService.updatePendoTrackingState('off');
} }
if ($rootScope.licenseMissing === true) {
$state.go('dashboard', { $state.go('dashboard', {
licenseMissing: false licenseMissing: false
}); });

View File

@@ -122,7 +122,7 @@
</label> </label>
</div> </div>
</div> </div>
<div class="form-group License-detailsGroup License-detailsGroup--withSeparator"> <div class="form-group License-detailsGroup License-detailsGroup--withSeparator" ng-if="licenseMissing">
<div class="checkbox"> <div class="checkbox">
<label class="License-details--label"> <label class="License-details--label">
<input type="checkbox" ng-model="newLicense.pendo" ng-disabled="!user_is_superuser" required> <input type="checkbox" ng-model="newLicense.pendo" ng-disabled="!user_is_superuser" required>