From 57e25482650c1f1fc0f360264df8cd88fc14254a Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Mon, 2 Feb 2015 10:23:24 -0500 Subject: [PATCH] Added escaping for Add JT -> create survey the service for the escaping for the html was not included in the JT add function --- awx/ui/static/js/controllers/JobTemplates.js | 10 ++++------ awx/ui/static/js/helpers/Survey.js | 6 +++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/awx/ui/static/js/controllers/JobTemplates.js b/awx/ui/static/js/controllers/JobTemplates.js index 2238c81698..70a82799ae 100644 --- a/awx/ui/static/js/controllers/JobTemplates.js +++ b/awx/ui/static/js/controllers/JobTemplates.js @@ -337,8 +337,7 @@ function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $routePa SurveyControllerInit({ scope: $scope, - parent_scope: $scope, - // iterator: 'schedule' + parent_scope: $scope }); // Update playbook select whenever project value changes @@ -556,7 +555,7 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, InventoryList, CredentialList, ProjectList, LookUpInit, GetBasePath, md5Setup, ParseTypeChange, JobStatusToolTip, FormatDate, Wait, Stream, Empty, Prompt, ParseVariableString, ToJSON, SchedulesControllerInit, JobsControllerInit, JobsListUpdate, - GetChoices, SchedulesListInit, SchedulesList, CallbackHelpInit, PlaybookRun, SurveyControllerInit, $sce){ + GetChoices, SchedulesListInit, SchedulesList, CallbackHelpInit, PlaybookRun, SurveyControllerInit){ ClearScope(); @@ -595,8 +594,7 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP SurveyControllerInit({ scope: $scope, parent_scope: $scope, - id: id, - sce: $sce + id: id }); callback = function() { @@ -1069,5 +1067,5 @@ JobTemplatesEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$l 'ReturnToCaller', 'ClearScope', 'InventoryList', 'CredentialList', 'ProjectList', 'LookUpInit', 'GetBasePath', 'md5Setup', 'ParseTypeChange', 'JobStatusToolTip', 'FormatDate', 'Wait', 'Stream', 'Empty', 'Prompt', 'ParseVariableString', 'ToJSON', 'SchedulesControllerInit', 'JobsControllerInit', 'JobsListUpdate', 'GetChoices', - 'SchedulesListInit', 'SchedulesList', 'CallbackHelpInit', 'PlaybookRun' , 'SurveyControllerInit', '$sce' + 'SchedulesListInit', 'SchedulesList', 'CallbackHelpInit', 'PlaybookRun' , 'SurveyControllerInit' ]; diff --git a/awx/ui/static/js/helpers/Survey.js b/awx/ui/static/js/helpers/Survey.js index 889922ebcc..7f6d8ac9fb 100644 --- a/awx/ui/static/js/helpers/Survey.js +++ b/awx/ui/static/js/helpers/Survey.js @@ -459,9 +459,9 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', }]) .factory('SurveyControllerInit', ['$location', 'DeleteSurvey', 'EditSurvey', 'AddSurvey', 'GenerateForm', 'SurveyQuestionForm', 'Wait', 'Alert', - 'GetBasePath', 'Rest', 'ProcessErrors' , '$compile', 'FinalizeQuestion', 'EditQuestion', + 'GetBasePath', 'Rest', 'ProcessErrors' , '$compile', 'FinalizeQuestion', 'EditQuestion', '$sce', function($location, DeleteSurvey, EditSurvey, AddSurvey, GenerateForm, SurveyQuestionForm, Wait, Alert, - GetBasePath, Rest, ProcessErrors, $compile, FinalizeQuestion, EditQuestion) { + GetBasePath, Rest, ProcessErrors, $compile, FinalizeQuestion, EditQuestion, $sce) { return function(params) { var scope = params.scope, id = params.id, @@ -481,7 +481,7 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', ]; scope.serialize = function(expression){ - return scope.sce.getTrustedHtml(expression); + return $sce.getTrustedHtml(expression); }; scope.deleteSurvey = function() {