diff --git a/app/javascript/oldjs/components/index.js b/app/javascript/oldjs/components/index.js index 5257dd4a0bd..c5283a809de 100644 --- a/app/javascript/oldjs/components/index.js +++ b/app/javascript/oldjs/components/index.js @@ -2,4 +2,3 @@ require('./ae_resolve_options/ae-resolve-options.js'); require('./index.js'); require('./miq-button.js'); require('./sanitize.js'); -require('./verify-button.js'); diff --git a/app/javascript/oldjs/components/verify-button.js b/app/javascript/oldjs/components/verify-button.js deleted file mode 100644 index 5a40495a79d..00000000000 --- a/app/javascript/oldjs/components/verify-button.js +++ /dev/null @@ -1,38 +0,0 @@ -ManageIQ.angular.app.component('verifyButton', { - bindings: { - validate: '<', - enabled: '<', - validateUrl: '@', - restful: '<', - valtype: '<', - buttonLabels: '<', - }, - controllerAs: 'vm', - controller: ['$scope', function($scope) { - $scope.__ = __; - var vm = this; - - vm.findScope = function() { - var parentScope = $scope; - while (!parentScope.angularForm) { - parentScope = parentScope.$parent; - } - return parentScope.angularForm; - }; - - vm.chooseValidation = function() { - if (vm.restful) { - vm.validate( - {target: '.validate_button:visible'}, - vm.valtype, - true, - vm.findScope, - vm.validateUrl - ); - } else { - vm.validate(vm.validateUrl); - } - }; - }], - templateUrl: '/static/verify-button.html.haml', -}); diff --git a/app/views/layouts/angular/_form_buttons_verify_angular.html.haml b/app/views/layouts/angular/_form_buttons_verify_angular.html.haml deleted file mode 100644 index 97b5e2e92ca..00000000000 --- a/app/views/layouts/angular/_form_buttons_verify_angular.html.haml +++ /dev/null @@ -1,35 +0,0 @@ -- if !session[:host_items].nil? - - verify_title_on ||= _("Validate the credentials by logging into the selected Host") - - verify_title_off ||= _("Host to validate against, Username and matching password fields are needed to perform verification of credentials") -- else - - verify_title_on = _("Validate the credentials by logging into the Server") - - verify_title_off ||= _("Server information, Username and matching password fields are needed to perform verification of credentials") -- if controller.send(:restful?) || controller.send(:validate_before_save?) - -# TODO: replace first argument with a sane way of submitting the form - - validate = "#{main_scope}.validateClicked({target: '.validate_button:visible'}, '#{valtype}', true, angularForm, '#{url_for_only_path(:action => validate_url, :id => id, :type => valtype, :button => "validate")}')" -- else - - validate = "#{main_scope}.validateClicked('#{url_for_only_path(:action => validate_url, :id => id, :type => valtype, :button => "validate")}')" -%div{"ng-show" => ng_show} - %miq-button{:class => 'validate_button', - :name => _("Validate"), - "disabled-title" => verify_title_off, - "enabled-title" => verify_title_on, - :enabled => basic_info_needed ? "#{main_scope}.canValidateBasicInfo(angularForm)" : "#{main_scope}.canValidate(angularForm)", - 'on-click' => validate, - :xs => 'true', - :primary => 'true'} - %div{"ng-if" => "#{main_scope}.checkAuthentication"} - .form-group{"ng-class" => "{'has-error': angularForm.#{valtype}_auth_status.$error.validationRequired}"} - .col-md-8 - %input.form-control{"type" => "checkbox", - "id" => "#{valtype}_auth_status", - "name" => "#{valtype}_auth_status", - "ng-model" => "$parent.#{main_scope}.#{ng_model}.#{valtype}_auth_status", - "prefix" => "#{valtype}", - "main-scope" => "$parent.#{main_scope}", - "validation-status" => "", - "adjust-error-on-tab" => "$parent.#{main_scope}.#{ng_model}.#{valtype}_auth_status", - "ng-show" => false, - "post-validation-model-registry" => "$parent.#{main_scope}.postValidationModelRegistry"} - %span.help-block{"ng-if" => "angularForm.#{valtype}_auth_status.$error.validationRequired"} - = _("Validation Required") diff --git a/app/views/static/verify-button.html.haml b/app/views/static/verify-button.html.haml deleted file mode 100644 index a50b47c1132..00000000000 --- a/app/views/static/verify-button.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -%miq-button.validate_button{:name => _('Validate'), - 'on-click' => "vm.chooseValidation()", - "disabled-title" => '{{vm.buttonLabels.verifyTitleOffLabel}}', - "enabled-title" => '{{vm.buttonLabels.verifyTitleOnLabel}}', - :enabled => 'vm.enabled', - :xs => 'true', - :primary => 'true'} diff --git a/spec/javascripts/components/verify-button_spec.js b/spec/javascripts/components/verify-button_spec.js deleted file mode 100644 index 0724636365a..00000000000 --- a/spec/javascripts/components/verify-button_spec.js +++ /dev/null @@ -1,23 +0,0 @@ -describe('verify-button', function() { - describe('render verify button', function() { - var $scope; - var compile; - beforeEach(module('ManageIQ')); - beforeEach(inject(function($compile, $rootScope) { - $scope = $rootScope; - $scope.vm = {}; - compile = $compile; - })); - - it('renders miq-button', function(done) { - Promise.resolve($.get('/static/verify-button.html.haml')) - .then(function(data) { - var element = angular.element(data); - element = compile(element)($scope); - expect(element.is('miq-button')).toBe(true); - }).catch(function() { - expect('Error').toEqual(null); - }).then(done); - }); - }); -});