diff --git a/awx/ui/client/src/shared/directives.js b/awx/ui/client/src/shared/directives.js index c244adbf23..e806f86ba5 100644 --- a/awx/ui/client/src/shared/directives.js +++ b/awx/ui/client/src/shared/directives.js @@ -65,64 +65,6 @@ angular.module('AWDirectives', ['RestServices', 'Utilities']) }; }) -// chkPass -// -// Enables use of js/shared/pwdmeter.js to check strengh of passwords. -// See controllers/Users.js for example. -// -.directive('chkPass', [function() { - return { - require: 'ngModel', - link: function(scope, elm, attrs, ctrl) { - $(elm).keyup(function() { - var validity = true; - if (elm.val()) { - if ($AnsibleConfig.password_length) { - validity = (ctrl.$modelValue.length >= $AnsibleConfig.password_length); - ctrl.$setValidity('password_length', validity); - } - if ($AnsibleConfig.password_hasLowercase) { - validity = (/[a-z]/.test(ctrl.$modelValue)); - ctrl.$setValidity('hasLowercase', validity); - } - if ($AnsibleConfig.password_hasUppercase) { - validity = (/[A-Z]/.test(ctrl.$modelValue)); - ctrl.$setValidity('hasUppercase', validity); - } - if ($AnsibleConfig.password_hasNumber) { - validity = (/[0-9]/.test(ctrl.$modelValue)); - ctrl.$setValidity('hasNumber', validity); - } - if ($AnsibleConfig.password_hasSymbol) { - validity = (/[\\#@$-/:-?{-~!"^_`\[\]]/.test(ctrl.$modelValue)); - ctrl.$setValidity('hasSymbol', validity); - } - } else { - validity = true; - if ($AnsibleConfig.password_length) { - ctrl.$setValidity('password_length', validity); - } - if ($AnsibleConfig.password_hasLowercase) { - ctrl.$setValidity('hasLowercase', validity); - } - if ($AnsibleConfig.password_hasUppercase) { - ctrl.$setValidity('hasUppercase', validity); - } - if ($AnsibleConfig.password_hasNumber) { - ctrl.$setValidity('hasNumber', validity); - } - if ($AnsibleConfig.password_hasSymbol) { - ctrl.$setValidity('hasSymbol', validity); - } - } - if (!scope.$$phase) { - scope.$digest(); - } - }); - } - }; -}]) - // imageUpload // // Accepts image and returns base64 information with basic validation @@ -1116,42 +1058,6 @@ function(ConfigurationUtils, i18n, $rootScope) { }; }]) -// -// awRefresh -// -// Creates a timer to call scope.refresh(iterator) ever N seconds, where -// N is a setting in config.js -// -.directive('awRefresh', ['$rootScope', function($rootScope) { - return { - link: function(scope) { - function msg() { - var num = '' + scope.refreshCnt; - while (num.length < 2) { - num = '0' + num; - } - return 'Refresh in ' + num + ' sec.'; - } - scope.refreshCnt = $AnsibleConfig.refresh_rate; - scope.refreshMsg = msg(); - if ($rootScope.timer) { - clearInterval($rootScope.timer); - } - $rootScope.timer = setInterval(function() { - scope.refreshCnt--; - if (scope.refreshCnt <= 0) { - scope.refresh(); - scope.refreshCnt = $AnsibleConfig.refresh_rate; - } - scope.refreshMsg = msg(); - if (!scope.$$phase) { - scope.$digest(); - } - }, 1000); - } - }; -}]) - /* * Make an element draggable. Used on inventory groups tree. * diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index 2991a138a0..10b6ae0a62 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -433,23 +433,6 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat scope[form.name + '_form'][fld].$setPristine(); scope[form.name + '_form'][fld].$setValidity('apiError', true); } - if (f.chkPass && scope[form.name + '_form'][fld] && $AnsibleConfig) { - if ($AnsibleConfig.password_length) { - scope[form.name + '_form'][fld].$setValidity('password_length', true); - } - if ($AnsibleConfig.password_hasLowercase) { - scope[form.name + '_form'][fld].$setValidity('hasLowercase', true); - } - if ($AnsibleConfig.password_hasUppercase) { - scope[form.name + '_form'][fld].$setValidity('hasUppercase', true); - } - if ($AnsibleConfig.password_hasNumber) { - scope[form.name + '_form'][fld].$setValidity('hasNumber', true); - } - if ($AnsibleConfig.password_hasSymbol) { - scope[form.name + '_form'][fld].$setValidity('hasSymbol', true); - } - } if (f.awPassMatch && scope[form.name + '_form'][fld]) { scope[form.name + '_form'][fld].$setValidity('awpassmatch', true); } @@ -920,7 +903,6 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat html += (field.controlNGClass) ? "ng-class='" + field.controlNGClass + "' " : ""; html += "class='form-control Form-textInput"; html += "' "; - html += (field.chkPass) ? "chk-pass " : ""; html += (field.placeholder) ? this.attr(field, 'placeholder') : ""; html += (field.required) ? "required " : ""; @@ -966,34 +948,6 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat html += "