From b99f9e2eee593af39c35c1bfbcf02a189b2bac14 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Wed, 29 Jun 2016 11:13:56 -0700 Subject: [PATCH 01/52] Hide password fields for radius/social auth users on the users edit form, the password/confirm password field will be hidden similar to ldap. the username will not be required as well --- awx/ui/client/legacy-styles/forms.less | 5 ++++- awx/ui/client/src/controllers/Users.js | 1 + awx/ui/client/src/forms/Users.js | 6 +++--- awx/ui/client/src/shared/form-generator.js | 2 ++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/awx/ui/client/legacy-styles/forms.less b/awx/ui/client/legacy-styles/forms.less index 6e56199957..6763c7f7a2 100644 --- a/awx/ui/client/legacy-styles/forms.less +++ b/awx/ui/client/legacy-styles/forms.less @@ -55,7 +55,10 @@ min-height: 40px; } -.Form-title--is_superuser, .Form-title--is_system_auditor, .Form-title--is_ldap_user{ +.Form-title--is_superuser, +.Form-title--is_system_auditor, +.Form-title--is_ldap_user, +.Form-title--is_external_account{ height:15px; color: @default-interface-txt; background-color: @default-list-header-bg; diff --git a/awx/ui/client/src/controllers/Users.js b/awx/ui/client/src/controllers/Users.js index bf1f86feec..29c4a220a7 100644 --- a/awx/ui/client/src/controllers/Users.js +++ b/awx/ui/client/src/controllers/Users.js @@ -334,6 +334,7 @@ export function UsersEdit($scope, $rootScope, $location, $scope.not_ldap_user = !$scope.ldap_user; master.ldap_user = $scope.ldap_user; $scope.socialAuthUser = (data.auth.length > 0) ? true : false; + $scope.external_account = data.external_account; $scope.user_type = $scope.user_type_options[0]; $scope.is_system_auditor = false; diff --git a/awx/ui/client/src/forms/Users.js b/awx/ui/client/src/forms/Users.js index 6ce19602b4..f54553ebd1 100644 --- a/awx/ui/client/src/forms/Users.js +++ b/awx/ui/client/src/forms/Users.js @@ -46,7 +46,7 @@ export default label: 'Username', type: 'text', awRequiredWhen: { - reqExpression: "not_ldap_user", + reqExpression: "not_ldap_user && !external_account", init: true }, autocomplete: false @@ -69,7 +69,7 @@ export default label: 'Password', type: 'sensitive', hasShowInputButton: true, - ngShow: 'ldap_user == false && socialAuthUser === false', + ngShow: 'ldap_user == false && socialAuthUser === false && external_account === null', addRequired: true, editRequired: false, ngChange: "clearPWConfirm('password_confirm')", @@ -80,7 +80,7 @@ export default label: 'Confirm Password', type: 'sensitive', hasShowInputButton: true, - ngShow: 'ldap_user == false && socialAuthUser === false', + ngShow: 'ldap_user == false && socialAuthUser === false && external_account === null', addRequired: true, editRequired: false, awPassMatch: true, diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index 5417829724..b263362bf2 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -1487,6 +1487,8 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat "ng-show='is_system_auditor'>Auditor"; html+= "LDAP"; + html+= "{{external_account}}"; } html += "\n"; html += "
"; From 4770bc7f8bb4e0a9123482f0e88c2eef7ae9769d Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Wed, 29 Jun 2016 12:41:05 -0700 Subject: [PATCH 02/52] Show password fields for new uers --- awx/ui/client/src/controllers/Users.js | 1 + 1 file changed, 1 insertion(+) diff --git a/awx/ui/client/src/controllers/Users.js b/awx/ui/client/src/controllers/Users.js index 29c4a220a7..f368f8a61a 100644 --- a/awx/ui/client/src/controllers/Users.js +++ b/awx/ui/client/src/controllers/Users.js @@ -162,6 +162,7 @@ export function UsersAdd($scope, $rootScope, $compile, $location, $log, $scope.not_ldap_user = !$scope.ldap_user; $scope.ldap_dn = null; $scope.socialAuthUser = false; + $scope.external_account = null; generator.reset(); From d6f644bc712f25ddd636abdc8bc118f5a64a5878 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Wed, 29 Jun 2016 13:11:50 -0700 Subject: [PATCH 03/52] make username required if not radius/ldap --- awx/ui/client/src/forms/Users.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/src/forms/Users.js b/awx/ui/client/src/forms/Users.js index f54553ebd1..ddcda6e296 100644 --- a/awx/ui/client/src/forms/Users.js +++ b/awx/ui/client/src/forms/Users.js @@ -46,7 +46,7 @@ export default label: 'Username', type: 'text', awRequiredWhen: { - reqExpression: "not_ldap_user && !external_account", + reqExpression: "not_ldap_user && external_account === null", init: true }, autocomplete: false From 8ab00e2d05d9f8383f19499ec15a97f1a319c7b9 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Wed, 29 Jun 2016 11:13:56 -0700 Subject: [PATCH 04/52] Hide password fields for radius/social auth users on the users edit form, the password/confirm password field will be hidden similar to ldap. the username will not be required as well --- awx/ui/client/legacy-styles/forms.less | 5 ++++- awx/ui/client/src/controllers/Users.js | 1 + awx/ui/client/src/forms/Users.js | 6 +++--- awx/ui/client/src/shared/form-generator.js | 2 ++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/awx/ui/client/legacy-styles/forms.less b/awx/ui/client/legacy-styles/forms.less index b77d3738a2..efe89119c2 100644 --- a/awx/ui/client/legacy-styles/forms.less +++ b/awx/ui/client/legacy-styles/forms.less @@ -55,7 +55,10 @@ min-height: 40px; } -.Form-title--is_superuser, .Form-title--is_system_auditor, .Form-title--is_ldap_user{ +.Form-title--is_superuser, +.Form-title--is_system_auditor, +.Form-title--is_ldap_user, +.Form-title--is_external_account{ height:15px; color: @default-interface-txt; background-color: @default-list-header-bg; diff --git a/awx/ui/client/src/controllers/Users.js b/awx/ui/client/src/controllers/Users.js index 7c9560f7ad..2ea27b76d5 100644 --- a/awx/ui/client/src/controllers/Users.js +++ b/awx/ui/client/src/controllers/Users.js @@ -334,6 +334,7 @@ export function UsersEdit($scope, $rootScope, $location, $scope.not_ldap_user = !$scope.ldap_user; master.ldap_user = $scope.ldap_user; $scope.socialAuthUser = (data.auth.length > 0) ? true : false; + $scope.external_account = data.external_account; $scope.user_type = $scope.user_type_options[0]; $scope.is_system_auditor = false; diff --git a/awx/ui/client/src/forms/Users.js b/awx/ui/client/src/forms/Users.js index 6ce19602b4..f54553ebd1 100644 --- a/awx/ui/client/src/forms/Users.js +++ b/awx/ui/client/src/forms/Users.js @@ -46,7 +46,7 @@ export default label: 'Username', type: 'text', awRequiredWhen: { - reqExpression: "not_ldap_user", + reqExpression: "not_ldap_user && !external_account", init: true }, autocomplete: false @@ -69,7 +69,7 @@ export default label: 'Password', type: 'sensitive', hasShowInputButton: true, - ngShow: 'ldap_user == false && socialAuthUser === false', + ngShow: 'ldap_user == false && socialAuthUser === false && external_account === null', addRequired: true, editRequired: false, ngChange: "clearPWConfirm('password_confirm')", @@ -80,7 +80,7 @@ export default label: 'Confirm Password', type: 'sensitive', hasShowInputButton: true, - ngShow: 'ldap_user == false && socialAuthUser === false', + ngShow: 'ldap_user == false && socialAuthUser === false && external_account === null', addRequired: true, editRequired: false, awPassMatch: true, diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index 4b889eeb75..09132fd22c 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -1487,6 +1487,8 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat "ng-show='is_system_auditor'>Auditor"; html+= "LDAP"; + html+= "{{external_account}}"; } html += "
\n"; html += "
"; From 8ef59091acd7fc188c4f5b28b5c519a9313b8485 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Wed, 29 Jun 2016 12:41:05 -0700 Subject: [PATCH 05/52] Show password fields for new uers --- awx/ui/client/src/controllers/Users.js | 1 + 1 file changed, 1 insertion(+) diff --git a/awx/ui/client/src/controllers/Users.js b/awx/ui/client/src/controllers/Users.js index 2ea27b76d5..103e1d1c84 100644 --- a/awx/ui/client/src/controllers/Users.js +++ b/awx/ui/client/src/controllers/Users.js @@ -162,6 +162,7 @@ export function UsersAdd($scope, $rootScope, $compile, $location, $log, $scope.not_ldap_user = !$scope.ldap_user; $scope.ldap_dn = null; $scope.socialAuthUser = false; + $scope.external_account = null; generator.reset(); From 4f563a431361318d924ae7bade40cdd5032a4c48 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Wed, 29 Jun 2016 13:11:50 -0700 Subject: [PATCH 06/52] make username required if not radius/ldap --- awx/ui/client/src/forms/Users.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/src/forms/Users.js b/awx/ui/client/src/forms/Users.js index f54553ebd1..ddcda6e296 100644 --- a/awx/ui/client/src/forms/Users.js +++ b/awx/ui/client/src/forms/Users.js @@ -46,7 +46,7 @@ export default label: 'Username', type: 'text', awRequiredWhen: { - reqExpression: "not_ldap_user && !external_account", + reqExpression: "not_ldap_user && external_account === null", init: true }, autocomplete: false From 0331c7a2c78ca7f3640837418ecb7dbdaad12b23 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Thu, 14 Jul 2016 15:18:57 -0400 Subject: [PATCH 07/52] Fixed bug where schedule icon was disabled but clickable while scm update was running --- awx/ui/client/src/controllers/Projects.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/awx/ui/client/src/controllers/Projects.js b/awx/ui/client/src/controllers/Projects.js index 4dbb111f79..64f0bfc8c1 100644 --- a/awx/ui/client/src/controllers/Projects.js +++ b/awx/ui/client/src/controllers/Projects.js @@ -358,11 +358,8 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $stateParams, $scope.editSchedules = function(id) { var project = Find({ list: $scope.projects, key: 'id', val: id }); - if (project.scm_type === "Manual" || Empty(project.scm_type)) { - // Nothing to do - } - else { - $location.path('/projects/' + id + '/schedules'); + if (!(project.scm_type === "Manual" || Empty(project.scm_type)) && !(project.status === 'updating' || project.status === 'running' || project.status === 'pending')) { + $state.go('projectSchedules', {id: id}); } }; } From b78c2241e4901a421fccc81f5c08f4f69066b1a8 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Thu, 14 Jul 2016 15:26:29 -0400 Subject: [PATCH 08/52] Fixed bug where schedule icon was disabled but clickable while scm update was running --- .../controllers/organizations-projects.controller.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/awx/ui/client/src/organizations/linkout/controllers/organizations-projects.controller.js b/awx/ui/client/src/organizations/linkout/controllers/organizations-projects.controller.js index 406a1d1b78..a718b423c2 100644 --- a/awx/ui/client/src/organizations/linkout/controllers/organizations-projects.controller.js +++ b/awx/ui/client/src/organizations/linkout/controllers/organizations-projects.controller.js @@ -334,11 +334,8 @@ export default ['$scope', '$rootScope', '$location', '$log', $scope.editSchedules = function(id) { var project = Find({ list: $scope.projects, key: 'id', val: id }); - if (project.scm_type === "Manual" || Empty(project.scm_type)) { - // Nothing to do - } - else { - $location.path('/projects/' + id + '/schedules'); + if (!(project.scm_type === "Manual" || Empty(project.scm_type)) && !(project.status === 'updating' || project.status === 'running' || project.status === 'pending')) { + $state.go('projectSchedules', {id: id}); } }; From 89a4f8f77c0cee3d2f5ff9d34a0eddcebcc5953c Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Thu, 14 Jul 2016 15:38:51 -0400 Subject: [PATCH 09/52] add options for code mirror to be read only --- .../angular-codemirror/lib/AngularCodeMirror.js | 17 ++++++++++++----- awx/ui/client/src/helpers/Parse.js | 6 +++--- .../src/job-detail/job-detail.controller.js | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/awx/ui/client/lib/angular-codemirror/lib/AngularCodeMirror.js b/awx/ui/client/lib/angular-codemirror/lib/AngularCodeMirror.js index e4b9e5e02e..71ef0a674b 100644 --- a/awx/ui/client/lib/angular-codemirror/lib/AngularCodeMirror.js +++ b/awx/ui/client/lib/angular-codemirror/lib/AngularCodeMirror.js @@ -30,7 +30,7 @@ angular.module('AngularCodeMirrorModule', []) .factory('AngularCodeMirror', [ function() { - return function() { + return function(readOnly) { var fn = function() { this.myCodeMirror = null; @@ -47,9 +47,9 @@ angular.module('AngularCodeMirrorModule', []) height = 0; self.element = $(element); - + // We don't want to touch the original textarea. Angular likely has a model and other listeners - // attached to it. In prior iterations attaching CodeMirror to it seemed to go bad, so we'll insert a + // attached to it. In prior iterations attaching CodeMirror to it seemed to go bad, so we'll insert a //
under it, hide the textarea and let CodeMirror attach to the
. if ($('#cm-' + model + '-container').length > 0) { $('#cm-' + model + '-container').empty(); @@ -57,18 +57,25 @@ angular.module('AngularCodeMirrorModule', []) else { self.element.after("
"); } - + // Calc the height of the text area- our CodeMirror should match. height += self.element.attr('rows') * parseInt($(self.element).css('line-height').replace(/px/,''),10); height += parseInt(self.element.css('padding-top').replace(/px|%/,''),10) + parseInt(self.element.css('padding-bottom').replace(/px|%/,''),10); height += 2; //for the border - // hide self.element.hide(); // Initialize CodeMirror self.modes[mode].value = scope[model]; + + // if readOnly is passed to AngularCodeMirror, set the + // options for all modes to be readOnly + if (readOnly) { + Object.keys(self.modes).forEach(function(val) { + self.modes[val].readOnly = true; + }); + } self.myCodeMirror = CodeMirror(document.getElementById('cm-' + model + '-container'), self.modes[mode]); // Adjust the height diff --git a/awx/ui/client/src/helpers/Parse.js b/awx/ui/client/src/helpers/Parse.js index c484963162..a81f8c8194 100644 --- a/awx/ui/client/src/helpers/Parse.js +++ b/awx/ui/client/src/helpers/Parse.js @@ -25,7 +25,8 @@ export default fld = (params.variable) ? params.variable : 'variables', pfld = (params.parse_variable) ? params.parse_variable : 'parseType', onReady = params.onReady, - onChange = params.onChange; + onChange = params.onChange, + readOnly = params.readOnly; function removeField(fld) { //set our model to the last change in CodeMirror and then destroy CodeMirror @@ -35,8 +36,7 @@ export default function createField(onChange, onReady, fld) { //hide the textarea and show a fresh CodeMirror with the current mode (json or yaml) - - scope[fld + 'codeMirror'] = AngularCodeMirror(); + scope[fld + 'codeMirror'] = AngularCodeMirror(readOnly); scope[fld + 'codeMirror'].addModes($AnsibleConfig.variable_edit_modes); scope[fld + 'codeMirror'].showTextArea({ scope: scope, diff --git a/awx/ui/client/src/job-detail/job-detail.controller.js b/awx/ui/client/src/job-detail/job-detail.controller.js index 02cb21a5f1..9181b21b20 100644 --- a/awx/ui/client/src/job-detail/job-detail.controller.js +++ b/awx/ui/client/src/job-detail/job-detail.controller.js @@ -641,7 +641,7 @@ export default return true; }); //scope.setSearchAll('host'); - ParseTypeChange({ scope: scope, field_id: 'pre-formatted-variables' }); + ParseTypeChange({ scope: scope, field_id: 'pre-formatted-variables', readOnly: true }); scope.$emit('LoadPlays', data.related.job_events); }) .error(function(data, status) { From 3e7b993f282af434f07ca27b7b85f34c11547bb3 Mon Sep 17 00:00:00 2001 From: Ken Hoes Date: Fri, 15 Jul 2016 14:20:34 -0400 Subject: [PATCH 10/52] Changed tooltip position from right to top --- awx/ui/client/src/forms/JobTemplates.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/src/forms/JobTemplates.js b/awx/ui/client/src/forms/JobTemplates.js index 90c92f9f57..6cb6f833a2 100644 --- a/awx/ui/client/src/forms/JobTemplates.js +++ b/awx/ui/client/src/forms/JobTemplates.js @@ -281,7 +281,7 @@ export default column: 2, awPopOver: "callback_help", awPopOverWatch: "callback_help", - dataPlacement: 'right', + dataPlacement: 'top', dataTitle: 'Provisioning Callback URL', dataContainer: "body" }, From 8d7d933519c4246a04e3e36ee75fb1eeec42d404 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 15 Jul 2016 16:02:51 -0400 Subject: [PATCH 11/52] Added the ability to "See Less" labels on the job template list --- .../client/src/job-templates/labels/labelsList.block.less | 6 +++--- .../src/job-templates/labels/labelsList.directive.js | 7 +++++++ .../src/job-templates/labels/labelsList.partial.html | 4 +++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/awx/ui/client/src/job-templates/labels/labelsList.block.less b/awx/ui/client/src/job-templates/labels/labelsList.block.less index d851bd545e..2693ee99ee 100644 --- a/awx/ui/client/src/job-templates/labels/labelsList.block.less +++ b/awx/ui/client/src/job-templates/labels/labelsList.block.less @@ -8,7 +8,7 @@ } .LabelList-tagContainer, -.LabelList-seeMore { +.LabelList-seeMoreLess { display: flex; max-width: 100%; } @@ -27,7 +27,7 @@ overflow: hidden; } -.LabelList-seeMore { +.LabelList-seeMoreLess { color: @default-link; margin: 4px 0px; text-transform: uppercase; @@ -37,7 +37,7 @@ font-size: 11px; } -.LabelList-seeMore:hover { +.LabelList-seeMoreLess:hover { color: @default-link-hov; } diff --git a/awx/ui/client/src/job-templates/labels/labelsList.directive.js b/awx/ui/client/src/job-templates/labels/labelsList.directive.js index a5f055bb6e..ee5c1469d8 100644 --- a/awx/ui/client/src/job-templates/labels/labelsList.directive.js +++ b/awx/ui/client/src/job-templates/labels/labelsList.directive.js @@ -47,6 +47,13 @@ export default }); }; + scope.seeLess = function() { + // Trim the labels array back down to 10 items + scope.labels = scope.labels.slice(0, 10); + // Re-set the seeMoreInteractive flag so that the "See More" will be displayed + scope.seeMoreInactive = true; + }; + scope.deleteLabel = function(templateId, templateName, labelId, labelName) { var action = function () { $('#prompt-modal').modal('hide'); diff --git a/awx/ui/client/src/job-templates/labels/labelsList.partial.html b/awx/ui/client/src/job-templates/labels/labelsList.partial.html index 0bcc5f795a..b14ec6deb9 100644 --- a/awx/ui/client/src/job-templates/labels/labelsList.partial.html +++ b/awx/ui/client/src/job-templates/labels/labelsList.partial.html @@ -8,5 +8,7 @@ {{ label.name }}
-
View More
+
View Less
From 614acb438dfe50626da1a62230f42071584f4738 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 15 Jul 2016 16:28:35 -0400 Subject: [PATCH 12/52] Show working... spinner when toggling on/off notifications --- .../notifications/shared/toggle-notification.factory.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/src/notifications/shared/toggle-notification.factory.js b/awx/ui/client/src/notifications/shared/toggle-notification.factory.js index 2bbe8e2ff5..3a530606a4 100644 --- a/awx/ui/client/src/notifications/shared/toggle-notification.factory.js +++ b/awx/ui/client/src/notifications/shared/toggle-notification.factory.js @@ -36,6 +36,8 @@ export default ['Wait', 'GetBasePath', 'ProcessErrors', 'Rest', disassociate: 1 }; } + // Show the working spinner + Wait('start'); Rest.setUrl(url); Rest.post(params) .success( function(data) { @@ -43,9 +45,8 @@ export default ['Wait', 'GetBasePath', 'ProcessErrors', 'Rest', scope.$emit(callback, data.id); notifier[column] = !notifier[column]; } - else { - Wait('stop'); - } + // Hide the working spinner + Wait('stop'); }) .error( function(data, status) { ProcessErrors(scope, data, status, null, { hdr: 'Error!', From eabc83c9147ce417e490549f18186ed94863cf73 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Mon, 18 Jul 2016 09:53:10 -0400 Subject: [PATCH 13/52] use updated codemirror release --- .../client/lib/angular-codemirror/.bower.json | 15 +++++++------- .../client/lib/angular-codemirror/bower.json | 2 +- .../lib/AngularCodeMirror.css | 11 +++++----- .../lib/AngularCodeMirror.js | 20 +++++++------------ awx/ui/client/lib/ngToast/.bower.json | 5 ++--- 5 files changed, 23 insertions(+), 30 deletions(-) diff --git a/awx/ui/client/lib/angular-codemirror/.bower.json b/awx/ui/client/lib/angular-codemirror/.bower.json index 194a61b513..c88cb405db 100644 --- a/awx/ui/client/lib/angular-codemirror/.bower.json +++ b/awx/ui/client/lib/angular-codemirror/.bower.json @@ -1,6 +1,6 @@ { "name": "angular-codemirror", - "version": "1.0.2", + "version": "1.0.3", "dependencies": { "angular": "latest", "angular-route": "latest", @@ -13,14 +13,13 @@ "codemirror": "latest" }, "homepage": "https://github.com/chouseknecht/angular-codemirror", - "_release": "1.0.2", + "_release": "1.0.3", "_resolution": { "type": "version", - "tag": "v1.0.2", - "commit": "94b7aac548b036f4fbd94e56129ed9574e472616" + "tag": "1.0.3", + "commit": "b94dc86fde8f60a50b324054806d29d742177d21" }, - "_source": "git://github.com/chouseknecht/angular-codemirror.git", - "_target": "~1.0.2", - "_originalSource": "angular-codemirror", - "_direct": true + "_source": "https://github.com/chouseknecht/angular-codemirror.git", + "_target": "~1.0.3", + "_originalSource": "angular-codemirror" } \ No newline at end of file diff --git a/awx/ui/client/lib/angular-codemirror/bower.json b/awx/ui/client/lib/angular-codemirror/bower.json index 943b83b3e7..df7644686c 100644 --- a/awx/ui/client/lib/angular-codemirror/bower.json +++ b/awx/ui/client/lib/angular-codemirror/bower.json @@ -1,6 +1,6 @@ { "name": "angular-codemirror", - "version": "0.0.3", + "version": "1.0.2", "dependencies": { "angular": "latest", "angular-route": "latest", diff --git a/awx/ui/client/lib/angular-codemirror/lib/AngularCodeMirror.css b/awx/ui/client/lib/angular-codemirror/lib/AngularCodeMirror.css index a81ff6dff4..f233cc2941 100644 --- a/awx/ui/client/lib/angular-codemirror/lib/AngularCodeMirror.css +++ b/awx/ui/client/lib/angular-codemirror/lib/AngularCodeMirror.css @@ -1,6 +1,6 @@ /********************************************** * AngularCodeMirror.css - * + * * CodeMirror.css overrides * * Copyright (c) 2014 Chris Houseknecht @@ -30,14 +30,14 @@ .CodeMirror { height: auto; } - + .CodeMirror-activeline-background { background-color: #f7f7f7; } + - -/* Modal dialog overrides to make jqueryui dialog blend in with Twitter. +/* Modal dialog overrides to make jqueryui dialog blend in with Twitter. Why? Twitter's modal is not draggable or resizable, which is not very useful for a code editor */ @@ -71,7 +71,7 @@ border-color: #ffffff; color: #A9A9A9; } - + .ui-dialog .ui-resizable-se { right: 5px; bottom: 5px; @@ -108,3 +108,4 @@ .CodeMirror-lint-tooltip { z-index: 2060; } + diff --git a/awx/ui/client/lib/angular-codemirror/lib/AngularCodeMirror.js b/awx/ui/client/lib/angular-codemirror/lib/AngularCodeMirror.js index 71ef0a674b..2ef0ad4fe7 100644 --- a/awx/ui/client/lib/angular-codemirror/lib/AngularCodeMirror.js +++ b/awx/ui/client/lib/angular-codemirror/lib/AngularCodeMirror.js @@ -43,13 +43,12 @@ angular.module('AngularCodeMirrorModule', []) model = params.model, mode = params.mode, onReady = params.onReady, - onChange = params.onChange, height = 0; self.element = $(element); - + // We don't want to touch the original textarea. Angular likely has a model and other listeners - // attached to it. In prior iterations attaching CodeMirror to it seemed to go bad, so we'll insert a + // attached to it. In prior iterations attaching CodeMirror to it seemed to go bad, so we'll insert a //
under it, hide the textarea and let CodeMirror attach to the
. if ($('#cm-' + model + '-container').length > 0) { $('#cm-' + model + '-container').empty(); @@ -57,18 +56,19 @@ angular.module('AngularCodeMirrorModule', []) else { self.element.after("
"); } - + // Calc the height of the text area- our CodeMirror should match. height += self.element.attr('rows') * parseInt($(self.element).css('line-height').replace(/px/,''),10); height += parseInt(self.element.css('padding-top').replace(/px|%/,''),10) + parseInt(self.element.css('padding-bottom').replace(/px|%/,''),10); height += 2; //for the border + // hide self.element.hide(); // Initialize CodeMirror self.modes[mode].value = scope[model]; - + // if readOnly is passed to AngularCodeMirror, set the // options for all modes to be readOnly if (readOnly) { @@ -76,6 +76,7 @@ angular.module('AngularCodeMirrorModule', []) self.modes[val].readOnly = true; }); } + self.myCodeMirror = CodeMirror(document.getElementById('cm-' + model + '-container'), self.modes[mode]); // Adjust the height @@ -92,14 +93,7 @@ angular.module('AngularCodeMirrorModule', []) // Update the model on change self.myCodeMirror.on('change', function() { - setTimeout(function() { - scope.$apply(function(){ - scope[model] = self.myCodeMirror.getValue(); - if (onChange) { - onChange(); - } - }); - }, 500); + setTimeout(function() { scope.$apply(function(){ scope[model] = self.myCodeMirror.getValue(); }); }, 500); }); }; diff --git a/awx/ui/client/lib/ngToast/.bower.json b/awx/ui/client/lib/ngToast/.bower.json index 446800a71d..27c51cca55 100644 --- a/awx/ui/client/lib/ngToast/.bower.json +++ b/awx/ui/client/lib/ngToast/.bower.json @@ -52,8 +52,7 @@ "tag": "2.0.0", "commit": "8a1951c54a956c33964c99b338f3a4830e652689" }, - "_source": "git://github.com/tameraydin/ngToast.git", + "_source": "https://github.com/tameraydin/ngToast.git", "_target": "~2.0.0", - "_originalSource": "ngtoast", - "_direct": true + "_originalSource": "ngtoast" } \ No newline at end of file From 7c34b2d8094567ebcedd91f7b8f2597a267ea4ca Mon Sep 17 00:00:00 2001 From: Ken Hoes Date: Mon, 18 Jul 2016 10:51:22 -0400 Subject: [PATCH 14/52] Added canceled tooltip for projects listing --- awx/ui/client/src/helpers/Projects.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/awx/ui/client/src/helpers/Projects.js b/awx/ui/client/src/helpers/Projects.js index 816fd73ba3..e284bc07d1 100644 --- a/awx/ui/client/src/helpers/Projects.js +++ b/awx/ui/client/src/helpers/Projects.js @@ -75,6 +75,9 @@ export default case 'missing': result = 'Missing. Click for details'; break; + case 'canceled': + result = 'Canceled. Click for details'; + break; } return result; }; From 6a8c9a2bfe5baadbf170a9c4cf88f5915f4600b2 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Mon, 18 Jul 2016 14:02:05 -0400 Subject: [PATCH 15/52] Removed the track by $index default from our lists. This will fall back to track by $id(item) and re-render dom elements in ng-repeat. --- .../client/src/shared/list-generator/list-generator.factory.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9fc63e0969..dd7a6beb41 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 @@ -466,7 +466,7 @@ export default ['$location', '$compile', '$rootScope', 'SearchWidget', 'Paginate innerTable += "ng-class-odd=\"'List-tableRow--oddRow'\" "; innerTable += "ng-class-even=\"'List-tableRow--evenRow'\" "; innerTable += "ng-repeat=\"" + list.iterator + " in " + list.name; - innerTable += (list.trackBy) ? " track by " + list.trackBy : " track by $index"; + innerTable += (list.trackBy) ? " track by " + list.trackBy : ""; innerTable += (list.orderBy) ? " | orderBy:'" + list.orderBy + "'" : ""; innerTable += (list.filterBy) ? " | filter: " + list.filterBy : ""; innerTable += "\">\n"; From bc1a29e5bf201af792b5b5601a1cba93dc40c67e Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Mon, 18 Jul 2016 14:47:08 -0400 Subject: [PATCH 16/52] Make home/host columns sortable --- .../hosts/dashboard-hosts-list.controller.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/src/dashboard/hosts/dashboard-hosts-list.controller.js b/awx/ui/client/src/dashboard/hosts/dashboard-hosts-list.controller.js index bbc57dc275..9009efe609 100644 --- a/awx/ui/client/src/dashboard/hosts/dashboard-hosts-list.controller.js +++ b/awx/ui/client/src/dashboard/hosts/dashboard-hosts-list.controller.js @@ -6,8 +6,8 @@ export default ['$scope', '$state', '$stateParams', 'PageRangeSetup', 'GetBasePath', 'DashboardHostsList', - 'generateList', 'PaginateInit', 'SetStatus', 'DashboardHostService', 'hosts', '$rootScope', - function($scope, $state, $stateParams, PageRangeSetup, GetBasePath, DashboardHostsList, GenerateList, PaginateInit, SetStatus, DashboardHostService, hosts, $rootScope){ + 'generateList', 'PaginateInit', 'SetStatus', 'DashboardHostService', 'hosts', '$rootScope', 'SearchInit', + function($scope, $state, $stateParams, PageRangeSetup, GetBasePath, DashboardHostsList, GenerateList, PaginateInit, SetStatus, DashboardHostService, hosts, $rootScope, SearchInit){ var setJobStatus = function(){ _.forEach($scope.hosts, function(value){ SetStatus({ @@ -59,6 +59,12 @@ export default $scope.hosts = hosts.results; setJobStatus(); generator.inject(list, {mode: 'edit', scope: $scope}); + SearchInit({ + scope: $scope, + set: 'hosts', + list: list, + url: defaultUrl + }); PaginateInit({ scope: $scope, list: list, @@ -77,6 +83,7 @@ export default $scope.rowBeingEdited = $state.params.id; $scope.listBeingEdited = "hosts"; } + $scope.search(list.iterator); }; init(); }]; From 95393a6dd80c7e1ea80c99a964bb2d47db81b49e Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Mon, 18 Jul 2016 16:51:05 -0400 Subject: [PATCH 17/52] Maintain job schedule search query params after adding/removing search tags --- awx/ui/client/src/controllers/Jobs.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/src/controllers/Jobs.js b/awx/ui/client/src/controllers/Jobs.js index 27cbd6f8f5..0ea637c118 100644 --- a/awx/ui/client/src/controllers/Jobs.js +++ b/awx/ui/client/src/controllers/Jobs.js @@ -20,7 +20,8 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $statePa var jobs_scope, scheduled_scope, choicesCount = 0, listCount = 0, - api_complete = false; + api_complete = false, + scheduledJobsList = _.cloneDeep(ScheduledJobsList); $scope.jobsSelected = true; @@ -73,13 +74,14 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $statePa scheduled_scope = $scope.$new(true); + scheduledJobsList.basePath = GetBasePath('schedules') + '?next_run__isnull=false'; LoadSchedulesScope({ parent_scope: $scope, scope: scheduled_scope, - list: ScheduledJobsList, + list: scheduledJobsList, id: 'scheduled-jobs-tab', searchSize: 'col-lg-4 col-md-4 col-sm-4 col-xs-12', - url: GetBasePath('schedules') + '?next_run__isnull=false' + url: scheduledJobsList.basePath }); $scope.refreshJobs = function() { From d6bb405ebd46261c3184ae1e9ebec835a86a4dfd Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Thu, 21 Jul 2016 11:30:33 -0400 Subject: [PATCH 18/52] renaming dir --- awx/ui/client/lib/{ngToast => ngToast2}/.bower.json | 0 awx/ui/client/lib/{ngToast => ngToast2}/README.md | 0 awx/ui/client/lib/{ngToast => ngToast2}/bower.json | 0 .../client/lib/{ngToast => ngToast2}/dist/ngToast-animations.css | 0 .../lib/{ngToast => ngToast2}/dist/ngToast-animations.min.css | 0 awx/ui/client/lib/{ngToast => ngToast2}/dist/ngToast.css | 0 awx/ui/client/lib/{ngToast => ngToast2}/dist/ngToast.js | 0 awx/ui/client/lib/{ngToast => ngToast2}/dist/ngToast.min.css | 0 awx/ui/client/lib/{ngToast => ngToast2}/dist/ngToast.min.js | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename awx/ui/client/lib/{ngToast => ngToast2}/.bower.json (100%) rename awx/ui/client/lib/{ngToast => ngToast2}/README.md (100%) rename awx/ui/client/lib/{ngToast => ngToast2}/bower.json (100%) rename awx/ui/client/lib/{ngToast => ngToast2}/dist/ngToast-animations.css (100%) rename awx/ui/client/lib/{ngToast => ngToast2}/dist/ngToast-animations.min.css (100%) rename awx/ui/client/lib/{ngToast => ngToast2}/dist/ngToast.css (100%) rename awx/ui/client/lib/{ngToast => ngToast2}/dist/ngToast.js (100%) rename awx/ui/client/lib/{ngToast => ngToast2}/dist/ngToast.min.css (100%) rename awx/ui/client/lib/{ngToast => ngToast2}/dist/ngToast.min.js (100%) diff --git a/awx/ui/client/lib/ngToast/.bower.json b/awx/ui/client/lib/ngToast2/.bower.json similarity index 100% rename from awx/ui/client/lib/ngToast/.bower.json rename to awx/ui/client/lib/ngToast2/.bower.json diff --git a/awx/ui/client/lib/ngToast/README.md b/awx/ui/client/lib/ngToast2/README.md similarity index 100% rename from awx/ui/client/lib/ngToast/README.md rename to awx/ui/client/lib/ngToast2/README.md diff --git a/awx/ui/client/lib/ngToast/bower.json b/awx/ui/client/lib/ngToast2/bower.json similarity index 100% rename from awx/ui/client/lib/ngToast/bower.json rename to awx/ui/client/lib/ngToast2/bower.json diff --git a/awx/ui/client/lib/ngToast/dist/ngToast-animations.css b/awx/ui/client/lib/ngToast2/dist/ngToast-animations.css similarity index 100% rename from awx/ui/client/lib/ngToast/dist/ngToast-animations.css rename to awx/ui/client/lib/ngToast2/dist/ngToast-animations.css diff --git a/awx/ui/client/lib/ngToast/dist/ngToast-animations.min.css b/awx/ui/client/lib/ngToast2/dist/ngToast-animations.min.css similarity index 100% rename from awx/ui/client/lib/ngToast/dist/ngToast-animations.min.css rename to awx/ui/client/lib/ngToast2/dist/ngToast-animations.min.css diff --git a/awx/ui/client/lib/ngToast/dist/ngToast.css b/awx/ui/client/lib/ngToast2/dist/ngToast.css similarity index 100% rename from awx/ui/client/lib/ngToast/dist/ngToast.css rename to awx/ui/client/lib/ngToast2/dist/ngToast.css diff --git a/awx/ui/client/lib/ngToast/dist/ngToast.js b/awx/ui/client/lib/ngToast2/dist/ngToast.js similarity index 100% rename from awx/ui/client/lib/ngToast/dist/ngToast.js rename to awx/ui/client/lib/ngToast2/dist/ngToast.js diff --git a/awx/ui/client/lib/ngToast/dist/ngToast.min.css b/awx/ui/client/lib/ngToast2/dist/ngToast.min.css similarity index 100% rename from awx/ui/client/lib/ngToast/dist/ngToast.min.css rename to awx/ui/client/lib/ngToast2/dist/ngToast.min.css diff --git a/awx/ui/client/lib/ngToast/dist/ngToast.min.js b/awx/ui/client/lib/ngToast2/dist/ngToast.min.js similarity index 100% rename from awx/ui/client/lib/ngToast/dist/ngToast.min.js rename to awx/ui/client/lib/ngToast2/dist/ngToast.min.js From f7bfeed0cae8309f3cd4569b2acad54d3885eaba Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Thu, 21 Jul 2016 11:31:11 -0400 Subject: [PATCH 19/52] renaming dir again --- awx/ui/client/lib/{ngToast2 => ngtoast}/.bower.json | 0 awx/ui/client/lib/{ngToast2 => ngtoast}/README.md | 0 awx/ui/client/lib/{ngToast2 => ngtoast}/bower.json | 0 .../client/lib/{ngToast2 => ngtoast}/dist/ngToast-animations.css | 0 .../lib/{ngToast2 => ngtoast}/dist/ngToast-animations.min.css | 0 awx/ui/client/lib/{ngToast2 => ngtoast}/dist/ngToast.css | 0 awx/ui/client/lib/{ngToast2 => ngtoast}/dist/ngToast.js | 0 awx/ui/client/lib/{ngToast2 => ngtoast}/dist/ngToast.min.css | 0 awx/ui/client/lib/{ngToast2 => ngtoast}/dist/ngToast.min.js | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename awx/ui/client/lib/{ngToast2 => ngtoast}/.bower.json (100%) rename awx/ui/client/lib/{ngToast2 => ngtoast}/README.md (100%) rename awx/ui/client/lib/{ngToast2 => ngtoast}/bower.json (100%) rename awx/ui/client/lib/{ngToast2 => ngtoast}/dist/ngToast-animations.css (100%) rename awx/ui/client/lib/{ngToast2 => ngtoast}/dist/ngToast-animations.min.css (100%) rename awx/ui/client/lib/{ngToast2 => ngtoast}/dist/ngToast.css (100%) rename awx/ui/client/lib/{ngToast2 => ngtoast}/dist/ngToast.js (100%) rename awx/ui/client/lib/{ngToast2 => ngtoast}/dist/ngToast.min.css (100%) rename awx/ui/client/lib/{ngToast2 => ngtoast}/dist/ngToast.min.js (100%) diff --git a/awx/ui/client/lib/ngToast2/.bower.json b/awx/ui/client/lib/ngtoast/.bower.json similarity index 100% rename from awx/ui/client/lib/ngToast2/.bower.json rename to awx/ui/client/lib/ngtoast/.bower.json diff --git a/awx/ui/client/lib/ngToast2/README.md b/awx/ui/client/lib/ngtoast/README.md similarity index 100% rename from awx/ui/client/lib/ngToast2/README.md rename to awx/ui/client/lib/ngtoast/README.md diff --git a/awx/ui/client/lib/ngToast2/bower.json b/awx/ui/client/lib/ngtoast/bower.json similarity index 100% rename from awx/ui/client/lib/ngToast2/bower.json rename to awx/ui/client/lib/ngtoast/bower.json diff --git a/awx/ui/client/lib/ngToast2/dist/ngToast-animations.css b/awx/ui/client/lib/ngtoast/dist/ngToast-animations.css similarity index 100% rename from awx/ui/client/lib/ngToast2/dist/ngToast-animations.css rename to awx/ui/client/lib/ngtoast/dist/ngToast-animations.css diff --git a/awx/ui/client/lib/ngToast2/dist/ngToast-animations.min.css b/awx/ui/client/lib/ngtoast/dist/ngToast-animations.min.css similarity index 100% rename from awx/ui/client/lib/ngToast2/dist/ngToast-animations.min.css rename to awx/ui/client/lib/ngtoast/dist/ngToast-animations.min.css diff --git a/awx/ui/client/lib/ngToast2/dist/ngToast.css b/awx/ui/client/lib/ngtoast/dist/ngToast.css similarity index 100% rename from awx/ui/client/lib/ngToast2/dist/ngToast.css rename to awx/ui/client/lib/ngtoast/dist/ngToast.css diff --git a/awx/ui/client/lib/ngToast2/dist/ngToast.js b/awx/ui/client/lib/ngtoast/dist/ngToast.js similarity index 100% rename from awx/ui/client/lib/ngToast2/dist/ngToast.js rename to awx/ui/client/lib/ngtoast/dist/ngToast.js diff --git a/awx/ui/client/lib/ngToast2/dist/ngToast.min.css b/awx/ui/client/lib/ngtoast/dist/ngToast.min.css similarity index 100% rename from awx/ui/client/lib/ngToast2/dist/ngToast.min.css rename to awx/ui/client/lib/ngtoast/dist/ngToast.min.css diff --git a/awx/ui/client/lib/ngToast2/dist/ngToast.min.js b/awx/ui/client/lib/ngtoast/dist/ngToast.min.js similarity index 100% rename from awx/ui/client/lib/ngToast2/dist/ngToast.min.js rename to awx/ui/client/lib/ngtoast/dist/ngToast.min.js From efff0d68b505f700541fcfdfdd639dd28efea270 Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Thu, 21 Jul 2016 11:03:50 -0400 Subject: [PATCH 20/52] Show new jobs in UI Jobs tab --- awx/ui/client/src/controllers/Jobs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/src/controllers/Jobs.js b/awx/ui/client/src/controllers/Jobs.js index 0ea637c118..3a7cfd50f5 100644 --- a/awx/ui/client/src/controllers/Jobs.js +++ b/awx/ui/client/src/controllers/Jobs.js @@ -67,7 +67,7 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $statePa scope: jobs_scope, list: AllJobsList, id: 'active-jobs', - url: GetBasePath('unified_jobs') + '?status__in=pending,waiting,running,completed,failed,successful,error,canceled&order_by=-finished', + url: GetBasePath('unified_jobs') + '?status__in=pending,waiting,running,completed,failed,successful,error,canceled,new&order_by=-finished', searchParams: search_params, spinner: false }); From fbed0ac03baeeeec2020568601c26166dd4e5b13 Mon Sep 17 00:00:00 2001 From: Ken Hoes Date: Thu, 21 Jul 2016 11:37:16 -0400 Subject: [PATCH 21/52] Deleting label passes current page number for pagination --- .../client/src/job-templates/labels/labelsList.directive.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/src/job-templates/labels/labelsList.directive.js b/awx/ui/client/src/job-templates/labels/labelsList.directive.js index ee5c1469d8..212bd8bb64 100644 --- a/awx/ui/client/src/job-templates/labels/labelsList.directive.js +++ b/awx/ui/client/src/job-templates/labels/labelsList.directive.js @@ -63,13 +63,13 @@ export default Rest.setUrl(url); Rest.post({"disassociate": true, "id": labelId}) .success(function () { - scope.search("job_template"); + scope.search("job_template", scope.$parent.job_template_page); Wait('stop'); }) .error(function (data, status) { Wait('stop'); ProcessErrors(scope, data, status, null, { hdr: 'Error!', - msg: 'Could not disacssociate label from JT. Call to ' + url + ' failed. DELETE returned status: ' + status }); + msg: 'Could not disassociate label from JT. Call to ' + url + ' failed. DELETE returned status: ' + status }); }); }; @@ -93,6 +93,7 @@ export default scope.count = null; } }); + } }; } From 265e334dd32615214bc64d18cdcdca7e0115ee56 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Thu, 21 Jul 2016 16:20:55 -0400 Subject: [PATCH 22/52] Remove tooltips if state changes while hovering over a tool tipped element --- awx/ui/client/src/shared/directives.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/shared/directives.js b/awx/ui/client/src/shared/directives.js index 52cbe156b9..89f23a4846 100644 --- a/awx/ui/client/src/shared/directives.js +++ b/awx/ui/client/src/shared/directives.js @@ -477,7 +477,8 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'JobsHelper']) return { link: function(scope, element, attrs) { var delay = (attrs.delay !== undefined && attrs.delay !== null) ? attrs.delay : ($AnsibleConfig) ? $AnsibleConfig.tooltip_delay : {show: 500, hide: 100}, - placement; + placement, + stateChangeWatcher; if (attrs.awTipPlacement) { placement = attrs.awTipPlacement; } @@ -493,6 +494,22 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'JobsHelper']) template = ''; } + // This block helps clean up tooltips that may get orphaned by a click event + $(element).on('mouseenter', function() { + if(stateChangeWatcher) { + // Un-bind - we don't want a bunch of listeners firing + stateChangeWatcher(); + } + stateChangeWatcher = scope.$on('$stateChangeStart', function() { + // Go ahead and force the tooltip setTimeout to expire (if it hasn't already fired) + $(element).tooltip('hide'); + // Clean up any existing tooltips including this one + $('.tooltip').each(function() { + $(this).remove(); + }); + }); + }); + $(element).on('hidden.bs.tooltip', function( ) { // TB3RC1 is leaving behind tooltip
elements. This will remove them // after a tooltip fades away. If not, they lay overtop of other elements and From c910efdfa01fb9410d7e57f7fb481507c3bc7c14 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 22 Jul 2016 08:36:20 -0400 Subject: [PATCH 23/52] Updated inventories permissions basepath --- awx/ui/client/src/forms/Inventories.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/src/forms/Inventories.js b/awx/ui/client/src/forms/Inventories.js index dd9fd44e51..6467bf28d3 100644 --- a/awx/ui/client/src/forms/Inventories.js +++ b/awx/ui/client/src/forms/Inventories.js @@ -81,7 +81,7 @@ export default permissions: { awToolTip: 'Please save before assigning permissions', dataPlacement: 'top', - basePath: 'projects/:id/access_list/', + basePath: 'inventories/:id/access_list/', type: 'collection', title: 'Permissions', iterator: 'permission', From 180ec67d3338a0f63a6f48ca8fa0d5111de93b7f Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 22 Jul 2016 08:54:50 -0400 Subject: [PATCH 24/52] Added tooltip to group schedule action button --- awx/ui/client/src/helpers/Groups.js | 4 +++- .../src/inventories/manage/groups/groups-list.controller.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/helpers/Groups.js b/awx/ui/client/src/helpers/Groups.js index fb8ff47f40..a1b0f44041 100644 --- a/awx/ui/client/src/helpers/Groups.js +++ b/awx/ui/client/src/helpers/Groups.js @@ -165,6 +165,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name has_inventory_sources = params.has_inventory_sources, launch_class = '', launch_tip = 'Start sync process', + schedule_tip = 'Schedule future inventory syncs', stat, stat_class, status_tip; stat = status; @@ -225,7 +226,8 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name "tooltip": status_tip, "status": stat, "launch_class": launch_class, - "launch_tip": launch_tip + "launch_tip": launch_tip, + "schedule_tip": schedule_tip }; }; } diff --git a/awx/ui/client/src/inventories/manage/groups/groups-list.controller.js b/awx/ui/client/src/inventories/manage/groups/groups-list.controller.js index 9fe6d9809a..ca56eeddd4 100644 --- a/awx/ui/client/src/inventories/manage/groups/groups-list.controller.js +++ b/awx/ui/client/src/inventories/manage/groups/groups-list.controller.js @@ -151,6 +151,7 @@ {status_tooltip: group_status.tooltip}, {launch_tooltip: group_status.launch_tip}, {launch_class: group_status.launch_class}, + {group_schedule_tooltip: group_status.schedule_tip}, {hosts_status_tip: hosts_status.tooltip}, {hosts_status_class: hosts_status.class}, {source: group.summary_fields.inventory_source ? group.summary_fields.inventory_source.source : null}, From fde13c6a46bbdf67be3c43460722dc2f303d6535 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 22 Jul 2016 09:55:14 -0400 Subject: [PATCH 25/52] Prevent the page from reloading when an alert modal is open but not focused and the user hits enter --- awx/ui/client/src/shared/Utilities.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/awx/ui/client/src/shared/Utilities.js b/awx/ui/client/src/shared/Utilities.js index f7ccaf0be4..bdb7ddf03c 100644 --- a/awx/ui/client/src/shared/Utilities.js +++ b/awx/ui/client/src/shared/Utilities.js @@ -134,6 +134,7 @@ angular.module('Utilities', ['RestServices', 'Utilities', 'sanitizeFilter']) }); $(document).bind('keydown', function (e) { if (e.keyCode === 27 || e.keyCode === 13) { + e.preventDefault(); $('#alert-modal2').modal('hide'); } }); @@ -161,6 +162,7 @@ angular.module('Utilities', ['RestServices', 'Utilities', 'sanitizeFilter']) }); $(document).bind('keydown', function (e) { if (e.keyCode === 27 || e.keyCode === 13) { + e.preventDefault(); $('#alert-modal').modal('hide'); } }); From 6da3ac0cc1399705bb8ae73528c6249d8537b33f Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 22 Jul 2016 11:39:21 -0400 Subject: [PATCH 26/52] Improvements to awlookup directive to prevent making rest calls every time a character is added/removed --- awx/ui/client/src/shared/directives.js | 65 +++++++++++++++----------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/awx/ui/client/src/shared/directives.js b/awx/ui/client/src/shared/directives.js index 89f23a4846..1d724b315a 100644 --- a/awx/ui/client/src/shared/directives.js +++ b/awx/ui/client/src/shared/directives.js @@ -390,46 +390,57 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'JobsHelper']) // lookup Validate lookup value against API // - .directive('awlookup', ['Rest', function(Rest) { + .directive('awlookup', ['Rest', '$timeout', function(Rest, $timeout) { return { require: 'ngModel', link: function(scope, elm, attrs, ctrl) { + + var restTimeout; + ctrl.$parsers.unshift( function(viewValue) { if (viewValue !== '' && viewValue !== null) { var url = elm.attr('data-url'); url = url.replace(/\:value/, encodeURI(viewValue)); scope[elm.attr('data-source')] = null; - Rest.setUrl(url); - Rest.get().then( function(data) { - var results = data.data.results; - if (results.length > 0) { - scope[elm.attr('data-source')] = results[0].id; + if(restTimeout) { + $timeout.cancel(restTimeout); + } + restTimeout = $timeout( function(){ + Rest.setUrl(url); + Rest.get().then( function(data) { + var results = data.data.results; + if (results.length > 0) { + scope[elm.attr('data-source')] = results[0].id; - // For user lookups the API endpoint doesn't - // have a `name` property, so this is `undefined` - // which causes the input to clear after typing - // a valid value O_o - // - // Only assign if there is a value, so that we avoid - // this situation. - // - // TODO: Evaluate if assigning name on the scope is - // even necessary at all. - // - if (!_.isEmpty(results[0].name)) { - scope[elm.attr('name')] = results[0].name; + // For user lookups the API endpoint doesn't + // have a `name` property, so this is `undefined` + // which causes the input to clear after typing + // a valid value O_o + // + // Only assign if there is a value, so that we avoid + // this situation. + // + // TODO: Evaluate if assigning name on the scope is + // even necessary at all. + // + if (!_.isEmpty(results[0].name)) { + scope[elm.attr('name')] = results[0].name; + } + + ctrl.$setValidity('required', true); + ctrl.$setValidity('awlookup', true); + return viewValue; } - ctrl.$setValidity('required', true); - ctrl.$setValidity('awlookup', true); - return viewValue; - } - ctrl.$setValidity('required', true); - ctrl.$setValidity('awlookup', false); - return undefined; - }); + ctrl.$setValidity('awlookup', false); + return undefined; + }); + }, 750); } else { + if(restTimeout) { + $timeout.cancel(restTimeout); + } ctrl.$setValidity('awlookup', true); scope[elm.attr('data-source')] = null; } From 22a96240a32edb1ed6e0a5aa9ad28d7a4f7ac89b Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 22 Jul 2016 14:37:16 -0400 Subject: [PATCH 27/52] fix wrapping of name columns --- awx/ui/client/legacy-styles/ansible-ui.less | 6 ------ awx/ui/client/src/lists/AllJobs.js | 3 --- 2 files changed, 9 deletions(-) diff --git a/awx/ui/client/legacy-styles/ansible-ui.less b/awx/ui/client/legacy-styles/ansible-ui.less index f5b6f42c9a..f201b7352a 100644 --- a/awx/ui/client/legacy-styles/ansible-ui.less +++ b/awx/ui/client/legacy-styles/ansible-ui.less @@ -80,12 +80,6 @@ a.red-txt:active { text-overflow: ellipsis; } -.name-column { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - blockquote { font-size: 14px; } diff --git a/awx/ui/client/src/lists/AllJobs.js b/awx/ui/client/src/lists/AllJobs.js index ee28221c1d..cc9c03c752 100644 --- a/awx/ui/client/src/lists/AllJobs.js +++ b/awx/ui/client/src/lists/AllJobs.js @@ -48,9 +48,6 @@ export default columnClass: 'col-lg-2 col-md-3 col-sm-4 col-xs-6', ngClick: "viewJobDetails(all_job)", defaultSearchField: true, - awToolTip: "{{ all_job.name | sanitize }}", - dataTipWatch: 'all_job.name', - dataPlacement: 'top' }, type: { label: 'Type', From b1b9767a957b1e4508758bff8ba466808d575395 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 22 Jul 2016 15:44:19 -0400 Subject: [PATCH 28/52] Made type and name not searchable on the job templates completed jobs list --- awx/ui/client/src/lists/CompletedJobs.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/src/lists/CompletedJobs.js b/awx/ui/client/src/lists/CompletedJobs.js index ca0a24e454..23e4f325a8 100644 --- a/awx/ui/client/src/lists/CompletedJobs.js +++ b/awx/ui/client/src/lists/CompletedJobs.js @@ -35,6 +35,7 @@ export default ngClick:"viewJobDetails(completed_job)", searchable: true, searchType: 'select', + defaultSearchField: true, nosort: true, searchOptions: [ { label: "Success", value: "successful" }, @@ -54,8 +55,8 @@ export default name: { label: 'Name', columnClass: 'col-lg-4 col-md-4 col-sm-4 col-xs-6', + searchable: false, ngClick: "viewJobDetails(completed_job)", - defaultSearchField: true, awToolTip: "{{ completed_job.name | sanitize }}", dataPlacement: 'top' }, @@ -64,7 +65,7 @@ export default ngBind: 'completed_job.type_label', link: false, columnClass: "col-lg-2 col-md-2 hidden-sm hidden-xs", - searchable: true, + searchable: false, searchType: 'select', searchOptions: [] // populated via GetChoices() in controller }, From abd606e2c85a0c2419eef788706a71569e1285a8 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 22 Jul 2016 16:32:11 -0400 Subject: [PATCH 29/52] fixed word wrapping --- awx/ui/client/legacy-styles/lists.less | 1 + awx/ui/client/src/dashboard/lists/dashboard-list.block.less | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/legacy-styles/lists.less b/awx/ui/client/legacy-styles/lists.less index 6282ab340e..b92b2b7b88 100644 --- a/awx/ui/client/legacy-styles/lists.less +++ b/awx/ui/client/legacy-styles/lists.less @@ -78,6 +78,7 @@ table, tbody { padding-left: 15px; padding-right: 15px; border-top:0px!important; + word-wrap: break-word; } .List-tableCell.description-column { diff --git a/awx/ui/client/src/dashboard/lists/dashboard-list.block.less b/awx/ui/client/src/dashboard/lists/dashboard-list.block.less index 589f6c292d..102188034d 100644 --- a/awx/ui/client/src/dashboard/lists/dashboard-list.block.less +++ b/awx/ui/client/src/dashboard/lists/dashboard-list.block.less @@ -101,10 +101,8 @@ .DashboardList-nameCell { padding-left: 15px; - text-overflow: ellipsis; - overflow:hidden; - white-space: nowrap; width: 100%; + word-wrap: break-word; } .DashboardList-nameContainer { From f28e0fdc455a9e59a506227e09b0c953b77e828a Mon Sep 17 00:00:00 2001 From: Ken Hoes Date: Mon, 25 Jul 2016 10:16:59 -0400 Subject: [PATCH 30/52] Removed bottom border radius from open select2 dropdown --- awx/ui/client/legacy-styles/forms.less | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/awx/ui/client/legacy-styles/forms.less b/awx/ui/client/legacy-styles/forms.less index efe89119c2..82e768e09b 100644 --- a/awx/ui/client/legacy-styles/forms.less +++ b/awx/ui/client/legacy-styles/forms.less @@ -356,6 +356,11 @@ border-color: transparent transparent @field-dropdown-icon transparent!important; } +.select2-container--default.select2-container--open.select2-container--below .select2-selection--single { + border-bottom-left-radius: 0 !important; + border-bottom-right-radius: 0 !important; +} + .select2-dropdown{ border:1px solid @field-border; From a801ee7d525950e5c9cbcdb395950571019c9acd Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Thu, 14 Jul 2016 11:16:16 -0400 Subject: [PATCH 31/52] ensure system admin/auditor can see orphan inventory scripts --- awx/api/serializers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/awx/api/serializers.py b/awx/api/serializers.py index 1487fe17e3..679d23aeee 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -1283,7 +1283,9 @@ class CustomInventoryScriptSerializer(BaseSerializer): if obj is None: return ret request = self.context.get('request', None) - if request.user not in obj.admin_role: + if request.user not in obj.admin_role and \ + not request.user.is_superuser and \ + not request.user.is_system_auditor: ret['script'] = None return ret From 2d2b4263740f9214926de1f8937aeb2a1a12ff2a Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Thu, 14 Jul 2016 16:11:29 -0400 Subject: [PATCH 32/52] add read_role to organization select_related --- awx/api/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/api/views.py b/awx/api/views.py index 64ea980f66..cd9f96364f 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -653,7 +653,7 @@ class OrganizationList(OrganizationCountsMixin, ListCreateAPIView): def get_queryset(self): qs = Organization.accessible_objects(self.request.user, 'read_role') - qs = qs.select_related('admin_role', 'auditor_role', 'member_role') + qs = qs.select_related('admin_role', 'auditor_role', 'member_role', 'read_role') return qs def create(self, request, *args, **kwargs): From 48b31079af0ffa09a476a4372f312b285bcb4eaa Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 15 Jul 2016 10:35:15 -0400 Subject: [PATCH 33/52] Fixed bug where hitting enter in a password field in the job launch/survey maker modal would toggle the show/hide. --- .../job-submission/job-submission.partial.html | 16 ++++++++-------- .../shared/question-definition.form.js | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/awx/ui/client/src/job-submission/job-submission.partial.html b/awx/ui/client/src/job-submission/job-submission.partial.html index 95ca9df877..c6723ec347 100644 --- a/awx/ui/client/src/job-submission/job-submission.partial.html +++ b/awx/ui/client/src/job-submission/job-submission.partial.html @@ -54,9 +54,9 @@
- + - +
Please enter a password.
@@ -67,9 +67,9 @@
- + - +
Please enter a password.
@@ -80,9 +80,9 @@
- + - +
Please enter a password.
@@ -93,9 +93,9 @@
- + - +
Please enter a password.
diff --git a/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js b/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js index 32b1c1dd9a..56a3903f69 100644 --- a/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js +++ b/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js @@ -280,7 +280,7 @@ export default '
'+ '
'+ ''+ - ''+ + ''+ ''+ ''+ '
'+ From 633b27b66b9e2e79f4a60e926d9edad30fdca22f Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Fri, 15 Jul 2016 10:32:52 -0400 Subject: [PATCH 34/52] add test for CustomInventoryScript serializer --- awx/main/tests/unit/api/test_serializers.py | 48 ++++++++++++++++++++- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/awx/main/tests/unit/api/test_serializers.py b/awx/main/tests/unit/api/test_serializers.py index a8fb25d005..2496ba9a2d 100644 --- a/awx/main/tests/unit/api/test_serializers.py +++ b/awx/main/tests/unit/api/test_serializers.py @@ -1,14 +1,31 @@ # Python import pytest import mock +from mock import PropertyMock import json # AWX -from awx.api.serializers import JobTemplateSerializer, JobSerializer, JobOptionsSerializer -from awx.main.models import Label, Job +from awx.api.serializers import ( + JobTemplateSerializer, + JobSerializer, + JobOptionsSerializer, + CustomInventoryScriptSerializer, +) +from awx.main.models import ( + Label, + Job, + CustomInventoryScript, + User, +) #DRF +from rest_framework.request import Request from rest_framework import serializers +from rest_framework.test import ( + APIRequestFactory, + force_authenticate, +) + def mock_JT_resource_data(): return ({}, []) @@ -189,3 +206,30 @@ class TestJobTemplateSerializerValidation(object): for ev in self.bad_extra_vars: with pytest.raises(serializers.ValidationError): serializer.validate_extra_vars(ev) + +class TestCustomInventoryScriptSerializer(object): + + @pytest.mark.parametrize("superuser,sysaudit,admin_role,value", + ((True, False, False, '#!/python'), + (False, True, False, '#!/python'), + (False, False, True, '#!/python'), + (False, False, False, None))) + def test_to_representation_orphan(self, superuser, sysaudit, admin_role, value): + with mock.patch.object(CustomInventoryScriptSerializer, 'get_summary_fields', return_value={}): + User.add_to_class('is_system_auditor', sysaudit) + user = User(username="root", is_superuser=superuser) + roles = [user] if admin_role else [] + + with mock.patch('awx.main.models.CustomInventoryScript.admin_role', new_callable=PropertyMock, return_value=roles): + cis = CustomInventoryScript(pk=1, script='#!/python') + serializer = CustomInventoryScriptSerializer() + + factory = APIRequestFactory() + wsgi_request = factory.post("/inventory_script/1", {'id':1}, format="json") + force_authenticate(wsgi_request, user) + + request = Request(wsgi_request) + serializer.context['request'] = request + + representation = serializer.to_representation(cis) + assert representation['script'] == value From 4af8c98427deec78fd8dc78140c3a52e6b63efff Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 15 Jul 2016 10:45:36 -0400 Subject: [PATCH 35/52] Password enter show/hide fix --- awx/ui/client/src/shared/form-generator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index 09132fd22c..ac90c89b7b 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -922,7 +922,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat html += "'>\n"; // TODO: make it so that the button won't show up if the mode is edit, hasShowInputButton !== true, and there are no contents in the field. html += "\n"; - html += " +
From 95f461afb38be10e5754660e820b6e4f37886d24 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Mon, 18 Jul 2016 10:55:18 -0400 Subject: [PATCH 44/52] Fixed password show/hide on enter for survey maker password type previews --- .../survey-maker/render/survey-question.partial.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/src/job-templates/survey-maker/render/survey-question.partial.html b/awx/ui/client/src/job-templates/survey-maker/render/survey-question.partial.html index 72e772bd62..0777b94c90 100644 --- a/awx/ui/client/src/job-templates/survey-maker/render/survey-question.partial.html +++ b/awx/ui/client/src/job-templates/survey-maker/render/survey-question.partial.html @@ -17,7 +17,7 @@
- +
From bfd037e00b36f0d3bfb5b473c5f112ff2237f2b6 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Mon, 18 Jul 2016 12:27:53 -0400 Subject: [PATCH 45/52] Switch base class for StateConflict This fixes the output format for the 409 exception return --- awx/main/access.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/awx/main/access.py b/awx/main/access.py index d3f8e50990..5b2ee91851 100644 --- a/awx/main/access.py +++ b/awx/main/access.py @@ -12,7 +12,7 @@ from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType # Django REST Framework -from rest_framework.exceptions import ParseError, PermissionDenied, APIException +from rest_framework.exceptions import ParseError, PermissionDenied, ValidationError # AWX from awx.main.utils import * # noqa @@ -57,9 +57,8 @@ access_registry = { # ... } -class StateConflict(APIException): +class StateConflict(ValidationError): status_code = 409 - default_detail = 'Object state is not correct' def register_access(model_class, access_class): access_classes = access_registry.setdefault(model_class, []) From 136e1894f5821c9dc3f502ebf28e797ec7121b12 Mon Sep 17 00:00:00 2001 From: Leigh Johnson Date: Mon, 18 Jul 2016 13:34:53 -0400 Subject: [PATCH 46/52] fix missing URI encoding in event summary serch, kickback on #2980 (#3050) --- .../src/job-detail/host-summary/host-summary.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/src/job-detail/host-summary/host-summary.controller.js b/awx/ui/client/src/job-detail/host-summary/host-summary.controller.js index 34763c838e..d5c826ac35 100644 --- a/awx/ui/client/src/job-detail/host-summary/host-summary.controller.js +++ b/awx/ui/client/src/job-detail/host-summary/host-summary.controller.js @@ -104,7 +104,7 @@ Wait('start'); JobDetailService.getJobHostSummaries($stateParams.id, { page_size: page_size, - host_name__icontains: $scope.searchTerm, + host_name__icontains: encodeURIComponent($scope.searchTerm), }).success(function(res){ $scope.hosts = res.results; $scope.next = res.next; From 97b4a800c12e29692af80a21907b79fbe7e7b6e9 Mon Sep 17 00:00:00 2001 From: Leigh Johnson Date: Mon, 18 Jul 2016 15:34:59 -0400 Subject: [PATCH 47/52] remove aws ask at runtime prompt from cred form config, resolves #3055 (#3058) --- awx/ui/client/src/forms/Credentials.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/awx/ui/client/src/forms/Credentials.js b/awx/ui/client/src/forms/Credentials.js index f23852cebc..fe61186cce 100644 --- a/awx/ui/client/src/forms/Credentials.js +++ b/awx/ui/client/src/forms/Credentials.js @@ -107,11 +107,6 @@ export default init: false }, autocomplete: false, - subCheckbox: { - variable: 'secret_key_ask', - text: 'Ask at runtime?', - ngChange: 'ask(\'secret_key\', \'undefined\')' - }, clear: false, hasShowInputButton: true, apiField: 'password', From d5674672f52dacf0dbaacd67967567843987d32a Mon Sep 17 00:00:00 2001 From: Ken Hoes Date: Tue, 26 Jul 2016 09:12:50 -0400 Subject: [PATCH 48/52] Continuing audit work --- awx/ui/client/legacy-styles/ansible-ui.less | 6 +++--- awx/ui/client/legacy-styles/lists.less | 1 + .../survey-maker/shared/question-definition.form.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/awx/ui/client/legacy-styles/ansible-ui.less b/awx/ui/client/legacy-styles/ansible-ui.less index f201b7352a..8fbe6187f3 100644 --- a/awx/ui/client/legacy-styles/ansible-ui.less +++ b/awx/ui/client/legacy-styles/ansible-ui.less @@ -144,13 +144,13 @@ a:focus { cursor: not-allowed; } -/* Bring primary (blue) buttons in line with link colors */ +/* Bring primary (green) buttons in line with link colors */ .btn-primary { - background-color: @default-link; + background-color: @default-succ; } .btn-primary:hover { - background-color: @default-link-hov; + background-color: @default-succ-hov; } /* List Actions column */ diff --git a/awx/ui/client/legacy-styles/lists.less b/awx/ui/client/legacy-styles/lists.less index b92b2b7b88..cd486376f9 100644 --- a/awx/ui/client/legacy-styles/lists.less +++ b/awx/ui/client/legacy-styles/lists.less @@ -384,6 +384,7 @@ table, tbody { .List-action--showTooltipOnDisabled { display: inline-block; + cursor: not-allowed; } .List-action--showTooltipOnDisabled .btn[disabled] { diff --git a/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js b/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js index 56a3903f69..685476432a 100644 --- a/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js +++ b/awx/ui/client/src/job-templates/survey-maker/shared/question-definition.form.js @@ -314,7 +314,7 @@ export default ngClick: 'submitQuestion($event)', ngDisabled: true, 'class': 'btn btn-sm Form-saveButton', - label: '{{editQuestionIndex === null ? "ADD" : "UPDATE"}}' + label: '{{editQuestionIndex === null ? "+ ADD" : "UPDATE"}}' } } From 44b2f8f1fbca5506062c4efe2e57dfd380fa3696 Mon Sep 17 00:00:00 2001 From: Ken Hoes Date: Tue, 26 Jul 2016 14:19:46 -0400 Subject: [PATCH 49/52] Fixed display of non-breaking names --- awx/ui/client/legacy-styles/forms.less | 4 +++- awx/ui/client/src/bread-crumb/bread-crumb.block.less | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/legacy-styles/forms.less b/awx/ui/client/legacy-styles/forms.less index 82e768e09b..9fa16dc0fb 100644 --- a/awx/ui/client/legacy-styles/forms.less +++ b/awx/ui/client/legacy-styles/forms.less @@ -44,9 +44,11 @@ color: @list-header-txt; font-size: 14px; font-weight: bold; - white-space: nowrap; padding-bottom: 25px; min-height: 45px; + word-break: break-all; + max-width: 90%; + word-wrap: break-word; } .Form-secondaryTitle{ diff --git a/awx/ui/client/src/bread-crumb/bread-crumb.block.less b/awx/ui/client/src/bread-crumb/bread-crumb.block.less index 08abee34a7..ac8e0792c9 100644 --- a/awx/ui/client/src/bread-crumb/bread-crumb.block.less +++ b/awx/ui/client/src/bread-crumb/bread-crumb.block.less @@ -66,6 +66,12 @@ display: inline-block; color: @default-interface-txt; text-transform: uppercase; + max-width: 200px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + display: inline-block; + vertical-align: bottom; } .BreadCrumb-item + .BreadCrumb-item:before { From 978fec2a4a0d795f57fdb4d92d4488b56887203d Mon Sep 17 00:00:00 2001 From: Ken Hoes Date: Thu, 28 Jul 2016 10:16:23 -0400 Subject: [PATCH 50/52] Breadcrumb appears correctly on first run --- awx/ui/client/src/standard-out/standard-out.controller.js | 1 + 1 file changed, 1 insertion(+) diff --git a/awx/ui/client/src/standard-out/standard-out.controller.js b/awx/ui/client/src/standard-out/standard-out.controller.js index f43d6c4ea5..acdd5815a2 100644 --- a/awx/ui/client/src/standard-out/standard-out.controller.js +++ b/awx/ui/client/src/standard-out/standard-out.controller.js @@ -74,6 +74,7 @@ export function JobStdoutController ($rootScope, $scope, $state, $stateParams, $scope.limit = data.limit; $scope.verbosity = data.verbosity; $scope.job_tags = data.job_tags; + $scope.job.module_name = data.module_name; if (data.extra_vars) { $scope.variables = ParseVariableString(data.extra_vars); } From 91fa76920268d706081efb614b29e5eb89b06f0b Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Thu, 28 Jul 2016 10:26:15 -0400 Subject: [PATCH 51/52] Fixed adhoc relaunch logic to match normal adhoc launch logic --- awx/ui/client/src/helpers/Adhoc.js | 38 +++++++++++-------- .../manage/adhoc/adhoc.controller.js | 2 +- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/awx/ui/client/src/helpers/Adhoc.js b/awx/ui/client/src/helpers/Adhoc.js index 6754a60611..04ff4b2189 100644 --- a/awx/ui/client/src/helpers/Adhoc.js +++ b/awx/ui/client/src/helpers/Adhoc.js @@ -55,9 +55,9 @@ export default // Submit request to run an adhoc comamand .factory('AdhocRun', ['$location','$stateParams', 'LaunchJob', 'PromptForPasswords', 'Rest', 'GetBasePath', 'Alert', 'ProcessErrors', - 'Wait', 'Empty', 'CreateLaunchDialog', + 'Wait', 'Empty', 'CreateLaunchDialog', '$state', function ($location, $stateParams, LaunchJob, PromptForPasswords, - Rest, GetBasePath, Alert, ProcessErrors, Wait, Empty, CreateLaunchDialog) { + Rest, GetBasePath, Alert, ProcessErrors, Wait, Empty, CreateLaunchDialog, $state) { return function (params) { var id = params.project_id, scope = params.scope.$new(), @@ -87,25 +87,31 @@ export default }); }); - if (scope.removeAdhocLaunchFinished) { - scope.removeAdhocLaunchFinished(); - } - scope.removeAdhocLaunchFinished = scope.$on('AdhocLaunchFinished', - function(e, data) { - $location.path('/ad_hoc_commands/' + data.id); - }); - if (scope.removeStartAdhocRun) { scope.removeStartAdhocRun(); } scope.removeStartAdhocRun = scope.$on('StartAdhocRun', function() { - LaunchJob({ - scope: scope, - url: url, - callback: 'AdhocLaunchFinished' // send to the adhoc - // standard out page - }); + var password, + postData={}; + for (password in scope.passwords) { + postData[scope.passwords[password]] = scope[ + scope.passwords[password] + ]; + } + // Re-launch the adhoc job + Rest.setUrl(url); + Rest.post(postData) + .success(function (data) { + Wait('stop'); + $state.go('adHocJobStdout', {id: data.id}); + }) + .error(function (data, status) { + ProcessErrors(scope, data, status, { + hdr: 'Error!', + msg: 'Failed to launch adhoc command. POST ' + + 'returned status: ' + status }); + }); }); // start routine only if passwords need to be prompted diff --git a/awx/ui/client/src/inventories/manage/adhoc/adhoc.controller.js b/awx/ui/client/src/inventories/manage/adhoc/adhoc.controller.js index 7f67d81936..0281a9b0f2 100644 --- a/awx/ui/client/src/inventories/manage/adhoc/adhoc.controller.js +++ b/awx/ui/client/src/inventories/manage/adhoc/adhoc.controller.js @@ -242,7 +242,7 @@ function adhocController($q, $scope, $location, $stateParams, Rest.post(data) .success(function (data) { Wait('stop'); - $location.path("/ad_hoc_commands/" + data.id); + $state.go('adHocJobStdout', {id: data.id}); }) .error(function (data, status) { ProcessErrors($scope, data, status, adhocForm, { From 3f7ff74e286ebb14336c48a7d77b4b93523fa078 Mon Sep 17 00:00:00 2001 From: Ken Hoes Date: Fri, 29 Jul 2016 10:19:51 -0400 Subject: [PATCH 52/52] Returning btn-primary to blue --- awx/ui/client/legacy-styles/ansible-ui.less | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/legacy-styles/ansible-ui.less b/awx/ui/client/legacy-styles/ansible-ui.less index 8fbe6187f3..f201b7352a 100644 --- a/awx/ui/client/legacy-styles/ansible-ui.less +++ b/awx/ui/client/legacy-styles/ansible-ui.less @@ -144,13 +144,13 @@ a:focus { cursor: not-allowed; } -/* Bring primary (green) buttons in line with link colors */ +/* Bring primary (blue) buttons in line with link colors */ .btn-primary { - background-color: @default-succ; + background-color: @default-link; } .btn-primary:hover { - background-color: @default-succ-hov; + background-color: @default-link-hov; } /* List Actions column */