From 81ead8c85d6452d7dd821b749d6e90070e4bdf26 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Mon, 16 Feb 2015 12:11:11 -0500 Subject: [PATCH 01/16] Changed labels for filters on portal mode changed the labels to make things more aligned to the semantics of the actual filter. --- awx/ui/static/js/widgets/PortalJobs.js | 8 ++++---- awx/ui/static/partials/portal.html | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/awx/ui/static/js/widgets/PortalJobs.js b/awx/ui/static/js/widgets/PortalJobs.js index 4a4c66d7f7..ffd8005aba 100644 --- a/awx/ui/static/js/widgets/PortalJobs.js +++ b/awx/ui/static/js/widgets/PortalJobs.js @@ -45,7 +45,7 @@ angular.module('PortalJobsWidget', ['RestServices', 'Utilities']) PortalJobsList.fields.type.searchOptions = scope.type_choices; } user = scope.$parent.current_user.id; - url = (filter === "Team" ) ? GetBasePath('jobs') : GetBasePath('jobs')+'?created_by='+user ; + url = (filter === "All Jobs" ) ? GetBasePath('jobs') : GetBasePath('jobs')+'?created_by='+user ; LoadJobsScope({ parent_scope: scope, scope: jobs_scope, @@ -77,7 +77,7 @@ angular.module('PortalJobsWidget', ['RestServices', 'Utilities']) $("#active-jobs").empty(); $("#active-jobs-search-container").empty(); user = scope.$parent.current_user.id; - url = (filter === "Team" ) ? GetBasePath('jobs') : GetBasePath('jobs')+'?created_by='+user ; + url = (filter === "All Jobs" ) ? GetBasePath('jobs') : GetBasePath('jobs')+'?created_by='+user ; LoadJobsScope({ parent_scope: scope, scope: jobs_scope, @@ -96,8 +96,8 @@ angular.module('PortalJobsWidget', ['RestServices', 'Utilities']) html += "
\n"; html += "
" ; html += "
" ; - html += " " ; - html += "" ; + html += "" ; + html += "" ; html += "
" ; html += "
" ; html += "\n"; //row diff --git a/awx/ui/static/partials/portal.html b/awx/ui/static/partials/portal.html index 5c94a97337..604d36bacf 100644 --- a/awx/ui/static/partials/portal.html +++ b/awx/ui/static/partials/portal.html @@ -16,7 +16,7 @@
- My Jobs + Jobs
From e849dff3862c2c568c7179c6618aaf33730905e6 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Mon, 16 Feb 2015 12:13:40 -0500 Subject: [PATCH 02/16] Changed wording on survey error message Chris Wang found a wording issue with the survey error messages --- awx/ui/static/js/forms/SurveyQuestion.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/ui/static/js/forms/SurveyQuestion.js b/awx/ui/static/js/forms/SurveyQuestion.js index 40f692d474..d7d0fff516 100644 --- a/awx/ui/static/js/forms/SurveyQuestion.js +++ b/awx/ui/static/js/forms/SurveyQuestion.js @@ -211,7 +211,7 @@ export default ''+ '
'+ ''+ - '
Please enter an answer for the choices listed.
' + + '
Please enter an answer from the choices listed.
' + '
The answer is shorter than the minimium length. Please make the answer longer.
' + '
The answer is longer than the maximum length. Please make the answer shorter.
' + '
'+ @@ -227,7 +227,7 @@ export default ''+ '
'+ ''+ - '
Please enter an answer/answers for the choices listed.
' + + '
Please enter an answer/answers from the choices listed.
' + '
'+ '
'+ '
', From 9fbd64805f62573340dfa856ed78193d9cf7618a Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Mon, 16 Feb 2015 13:42:38 -0500 Subject: [PATCH 03/16] Job Detail checks to prevent error messages If the job run completes before the JS can complete running, error messages are output to the js console. Ajusting checks to prevent errors happening. --- awx/ui/static/js/controllers/JobDetail.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/awx/ui/static/js/controllers/JobDetail.js b/awx/ui/static/js/controllers/JobDetail.js index b8e0a9a194..d4c3942a4f 100644 --- a/awx/ui/static/js/controllers/JobDetail.js +++ b/awx/ui/static/js/controllers/JobDetail.js @@ -200,7 +200,7 @@ export function JobDetailController ($location, $rootScope, $scope, $compile, $r scope.removeLoadHostSummaries(); } scope.removeHostSummaries = scope.$on('LoadHostSummaries', function() { - if(scope.job.related){ + if(scope.job){ var url = scope.job.related.job_host_summaries + '?'; url += '&page_size=' + scope.hostSummariesMaxRows + '&order=host_name'; @@ -247,9 +247,11 @@ export function JobDetailController ($location, $rootScope, $scope, $compile, $r if (scope.activeTask) { var play = scope.jobData.plays[scope.activePlay], - task = play.tasks[scope.activeTask], + task, // = play.tasks[scope.activeTask], url; - + if(play){ + task = play.tasks[scope.activeTask]; + } if (play && task) { url = scope.job.related.job_events + '?parent=' + task.id + '&'; url += 'event__startswith=runner&page_size=' + scope.hostResultsMaxRows + '&order=host_name,counter'; From c8682b7820120b66179a190d066a9043afc09457 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Mon, 16 Feb 2015 13:56:25 -0500 Subject: [PATCH 04/16] Take out this stupid sync_ui thing from the 'make server' and 'make servercc' targets --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index 12bd816eaf..51b14223ce 100644 --- a/Makefile +++ b/Makefile @@ -202,8 +202,6 @@ server_noattach: tmux select-pane -U tmux split-window -v 'exec make receiver' tmux split-window -h 'exec make taskmanager' - tmux select-pane -U - tmux split-window -h 'exec make sync_ui' server: server_noattach tmux -2 attach-session -t tower From dda00e98f5eb9d93b1319a3705257e5a71616052 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Tue, 17 Feb 2015 16:05:12 -0500 Subject: [PATCH 05/16] Fixing job submission for textarea if textarea min is set to 0 and the question is optional, then the UI will pass the API and empty string to the job launch endpoint --- awx/ui/static/js/helpers/JobSubmission.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/static/js/helpers/JobSubmission.js b/awx/ui/static/js/helpers/JobSubmission.js index d352f6c4ce..cb0d3b8be6 100644 --- a/awx/ui/static/js/helpers/JobSubmission.js +++ b/awx/ui/static/js/helpers/JobSubmission.js @@ -81,7 +81,7 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential job_launch_data.extra_vars[fld] = scope[fld]; } // for optional text and text-areas, submit a blank string if min length is 0 - if(scope.survey_questions[i].required === false && (scope.survey_questions[i].type === "text" || scope.survey_questions[i].type === "textarea") && scope.survey_questions[i].min === 0 && scope[fld] ===""){ + if(scope.survey_questions[i].required === false && (scope.survey_questions[i].type === "text" || scope.survey_questions[i].type === "textarea") && scope.survey_questions[i].min === 0 && (scope[fld] === "" || scope[fld] === undefined)){ job_launch_data.extra_vars[fld] = ""; } } From 397d107380af372b681d511854515258018d74c3 Mon Sep 17 00:00:00 2001 From: Joe Fiorini Date: Tue, 17 Feb 2015 17:11:03 -0500 Subject: [PATCH 06/16] Include sourcemaps in build --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index dfa5d45237..895910f06e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -17,6 +17,7 @@ recursive-exclude awx/main/tests * recursive-exclude awx/ui/static/lib/ansible * recursive-exclude awx/settings local_settings.py* include awx/ui/static/dist/tower.concat.js +include awx/ui/static/dist/tower.concat.map include awx/ui/static/dist/tower.concat.js.gz include awx/ui/static/js/config.js include tools/scripts/request_tower_configuration.sh From a2121b7288f813ce68e3e6cede9179a890f6f594 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Tue, 17 Feb 2015 17:50:43 -0500 Subject: [PATCH 07/16] More accurate survey errors For the survey question form validation, some errors messages were being thrown for errors that hadn't occured. --- awx/ui/static/js/forms/SurveyQuestion.js | 16 ++++++------ awx/ui/static/lib/ansible/directives.js | 31 +++++++++++++++--------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/awx/ui/static/js/forms/SurveyQuestion.js b/awx/ui/static/js/forms/SurveyQuestion.js index d7d0fff516..fe50a0a236 100644 --- a/awx/ui/static/js/forms/SurveyQuestion.js +++ b/awx/ui/static/js/forms/SurveyQuestion.js @@ -63,8 +63,8 @@ export default 'user_id
host_name
esc or click to close
" '+ 'data-placement="right" data-container="body" data-title="Answer Variable Name" class="help-link" data-original-title="" title="" tabindex="-1"> '+ '
'+ - '
Please enter an answer variable name.
'+ - '
Please remove the illegal character from the survey question variable name.
'+ + '
Please enter an answer variable name.
'+ + '
Please remove the illegal character from the survey question variable name.
'+ '
This question variable is already in use. Please enter a different variable name.
' + '
'+ '
', @@ -106,13 +106,13 @@ export default control:'
'+ '
'+ ''+ - '
The minimum length you entered is not a number. Please enter a number.
'+ + '
The minimum length you entered is not a number. Please enter a number.
'+ '
The minimium length is too high. Please enter a lower number.
'+ '
The minimum length is too low. Please enter a positive number.
'+ '
'+ '
'+ ''+ - '
The maximum length you entered is not a number. Please enter a number.
'+ + '
The maximum length you entered is not a number. Please enter a number.
'+ '
The maximum length is too low. Please enter a number larger than the minimum length you set.
'+ '
'+ '
', @@ -127,13 +127,13 @@ export default control:'
'+ '
'+ ''+ - '
The minimum length you entered is not a number. Please enter a number.
'+ + '
The minimum length you entered is not a number. Please enter a number.
'+ '
The minimium length is too high. Please enter a lower number.
'+ '
The minimum length is too low. Please enter a positive number.
'+ '
'+ '
'+ ''+ - '
The maximum length you entered is not a number. Please enter a number.
'+ + '
The maximum length you entered is not a number. Please enter a number.
'+ '
The maximum length is too low. Please enter a number larger than the minimum length you set.
'+ '
'+ '
', @@ -148,13 +148,13 @@ export default control:'
'+ '
'+ ''+ - '
The minimum length you entered is not a number. Please enter a number.
'+ + '
The minimum length you entered is not a number. Please enter a number.
'+ '
The minimium length is too high. Please enter a lower number.
'+ '
The minimum length is too low. Please enter a positive number.
'+ '
'+ '
'+ ''+ - '
The maximum length you entered is not a number. Please enter a number.
'+ + '
The maximum length you entered is not a number. Please enter a number.
'+ '
The maximum length is too low. Please enter a number larger than the minimum length you set.
'+ '
'+ '
', diff --git a/awx/ui/static/lib/ansible/directives.js b/awx/ui/static/lib/ansible/directives.js index 1ac2599250..cf97f9d8e8 100644 --- a/awx/ui/static/lib/ansible/directives.js +++ b/awx/ui/static/lib/ansible/directives.js @@ -70,7 +70,7 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job require: 'ngModel', scope: { ngModel: '=ngModel' }, template: '
' + - '