From 03ab52ad077addc1b61e3939667e0785ff4be7c9 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 1 Jul 2016 11:57:35 -0400 Subject: [PATCH] Added cancel icon and fixed bug where jobs list was not refreshing properly after a relaunch. --- awx/ui/client/src/helpers/search.js | 5 +++++ awx/ui/client/src/shared/generator-helpers.js | 3 +++ .../src/shared/list-generator/list-generator.factory.js | 3 +-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/src/helpers/search.js b/awx/ui/client/src/helpers/search.js index 3e54cce9df..32248a305d 100644 --- a/awx/ui/client/src/helpers/search.js +++ b/awx/ui/client/src/helpers/search.js @@ -343,6 +343,11 @@ export default var i, modifier, widgets = (list.searchWidgets) ? list.searchWidgets : 1; + // Initialize SearchParams as an empty string if it's not defined. If we don't do this and SearchParams === undefined + // then 'undefined' will sneak into the string as we are concatenating and the request will never get sent since we + // regex search for 'undefined' in the doSearch section of this process. + scope[iterator + 'SearchParams'] = (!scope[iterator + 'SearchParams'] || scope[iterator + 'SearchParams'] === undefined) ? '' : scope[iterator + 'SearchParams']; + for (i = 1; i <= widgets; i++) { modifier = (i === 1) ? '' : i; scope[iterator + 'HoldInput' + modifier] = true; diff --git a/awx/ui/client/src/shared/generator-helpers.js b/awx/ui/client/src/shared/generator-helpers.js index 36d00db7c5..ccddbbc4c4 100644 --- a/awx/ui/client/src/shared/generator-helpers.js +++ b/awx/ui/client/src/shared/generator-helpers.js @@ -184,6 +184,9 @@ angular.module('GeneratorHelpers', [systemStatus.name]) case 'copy': icon = "fa-copy"; break; + case 'cancel': + icon = "fa-minus-circle"; + break; } icon += (size) ? " " + size : ""; return Icon(icon); diff --git a/awx/ui/client/src/shared/list-generator/list-generator.factory.js b/awx/ui/client/src/shared/list-generator/list-generator.factory.js index 4d3d00ef6c..30c4625a59 100644 --- a/awx/ui/client/src/shared/list-generator/list-generator.factory.js +++ b/awx/ui/client/src/shared/list-generator/list-generator.factory.js @@ -545,8 +545,7 @@ export default ['$location', '$compile', '$rootScope', 'SearchWidget', 'Paginate innerTable += (fAction.href) ? "href=\"" + fAction.href + "\" " : ""; innerTable += (fAction.ngHref) ? "ng-href=\"" + fAction.ngHref + "\" " : ""; innerTable += "class=\"List-actionButton "; - innerTable += (field_action === 'delete') ? "List-actionButton--delete" : ""; - innerTable += (field_action === 'cancel') ? "cancel red-txt" : ""; + innerTable += (field_action === 'delete' || field_action === 'cancel') ? "List-actionButton--delete" : ""; innerTable += "\" "; // rowBeingEdited === '{{ " + list.iterator + ".id }}' && listBeingEdited === '" + list.name + "' ? 'List-tableRow--selected' : ''"; innerTable += (field_action === 'edit') ? "ng-class=\"[rowBeingEdited === '{{ " + list.iterator + ".id }}' && listBeingEdited === '" + list.name + "' ? 'List-editButton--selected' : '']\"" : "";