From 9aea64eb3f9abe1c353ccae4e548185c374f4f37 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Thu, 13 Feb 2014 16:19:21 +0000 Subject: [PATCH] Fixed minor bugs lingering from package upgrades. Org lookup on User add page was throwing a js error. Flash message was not clearing on modal display. Store link was not working from modal button. --- awx/ui/static/js/helpers/Lookup.js | 3 +-- awx/ui/static/lib/ansible/form-generator.js | 1 + awx/ui/static/lib/ansible/license.js | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/awx/ui/static/js/helpers/Lookup.js b/awx/ui/static/js/helpers/Lookup.js index c1a906b814..3b0407c7cb 100644 --- a/awx/ui/static/js/helpers/Lookup.js +++ b/awx/ui/static/js/helpers/Lookup.js @@ -104,7 +104,7 @@ angular.module('LookUpHelper', ['RestServices', 'Utilities', 'SearchHelper', 'Pa listScope['toggle_' + list.iterator] = function (id) { var i; - for (i = 0; i < scope[list.name].length; i++) { + for (i = 0; i < listScope[list.name].length; i++) { if (listScope[list.name][i].id === id) { listScope[list.name][i].checked = '1'; listScope[list.name][i].success_class = 'success'; @@ -135,7 +135,6 @@ angular.module('LookUpHelper', ['RestServices', 'Utilities', 'SearchHelper', 'Pa listScope.lookupPostRefreshRemove = scope.$on('PostRefresh', function () { var fld, i; for (fld in list.fields) { - if (list.fields[fld].type && list.fields[fld].type === 'date') { //convert dates to our standard format for (i = 0; i < scope[list.name].length; i++) { diff --git a/awx/ui/static/lib/ansible/form-generator.js b/awx/ui/static/lib/ansible/form-generator.js index 88d2de6e59..7fccc482e5 100644 --- a/awx/ui/static/lib/ansible/form-generator.js +++ b/awx/ui/static/lib/ansible/form-generator.js @@ -127,6 +127,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities']) } if (options.modal) { + $rootScope.flashMessage = null; this.scope.formModalActionDisabled = false; this.scope.formModalInfo = false; //Disable info button for default modal if (form) { diff --git a/awx/ui/static/lib/ansible/license.js b/awx/ui/static/lib/ansible/license.js index 42b20a3c7c..2942a490af 100644 --- a/awx/ui/static/lib/ansible/license.js +++ b/awx/ui/static/lib/ansible/license.js @@ -66,8 +66,7 @@ angular.module('License', ['RestServices', 'Utilities', 'FormGenerator', 'Prompt "the Ansible online store. Would you like to purchase or extend your license now?

", 'class': 'btn-primary', action: function () { - var href = $('#license-link').attr('href'); - window.open(href, 'storeWindow'); + window.open('http://www.ansible.com/ansible-pricing', 'storeWindow'); } }); }; @@ -127,8 +126,7 @@ angular.module('License', ['RestServices', 'Utilities', 'FormGenerator', 'Prompt }) .error(function (data, status) { - ProcessErrors($rootScope, data, status, form, { - hdr: 'Error!', + ProcessErrors($rootScope, data, status, form, { hdr: 'Error!', msg: 'Failed to retrieve license. GET status: ' + status }); });