diff --git a/awx/ui/static/js/app.js b/awx/ui/static/js/app.js
index 9dece6bb7c..e6453d0613 100644
--- a/awx/ui/static/js/app.js
+++ b/awx/ui/static/js/app.js
@@ -163,14 +163,14 @@ angular.module('Tower', [
controller: 'JobTemplatesEdit'
}).
- when('/job_templates/add/survey', {
+ when('/job_templates/:template_id/survey/add', {
templateUrl: urlPrefix + 'partials/survey_maker.html',
controller: 'SurveyMakerAdd'
}).
- when('/job_templates/:template_id/survey', {
+ when('/job_templates/:template_id/survey/edit', {
templateUrl: urlPrefix + 'partials/survey_maker.html',
- controller: 'SurveyMakerAdd'
+ controller: 'SurveyMakerEdit'
}).
when('/job_templates/:id/schedules', {
diff --git a/awx/ui/static/js/controllers/JobTemplates.js b/awx/ui/static/js/controllers/JobTemplates.js
index a0f5a77aa3..c41c593e86 100644
--- a/awx/ui/static/js/controllers/JobTemplates.js
+++ b/awx/ui/static/js/controllers/JobTemplates.js
@@ -337,8 +337,8 @@ function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $routePa
};
//navigate to the survey maker
- $scope.navigateToSurvey = function() {
- $location.path($location.path() + '/survey');
+ $scope.addSurvey = function() {
+ $location.path($location.path() + '/survey/add');
};
}
@@ -591,6 +591,33 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
Wait('start');
+ if ($scope.removeEnableSurvey) {
+ $scope.removeEnableSurvey();
+ }
+ $scope.removeEnableSurvey = $scope.$on('EnableSurvey', function(fld) {
+ $('#job_templates_survey_enabled_chbox').attr('checked', $scope[fld]);
+ Rest.setUrl(defaultUrl + id+ '/survey_spec/');
+ Rest.get()
+ .success(function (data) {
+ if(!data || !data.name){
+ $('#job_templates_delete_survey_btn').hide();
+ $('#job_templates_edit_survey_btn').hide();
+ $('#job_templates_create_survey_btn').show();
+ }
+ else {
+ $('#job_templates_delete_survey_btn').show();
+ $('#job_templates_edit_survey_btn').show();
+ $('#job_templates_create_survey_btn').hide();
+ }
+ })
+ .error(function (data, status) {
+ ProcessErrors($scope, data, status, form, {
+ hdr: 'Error!',
+ msg: 'Failed to retrieve job template: ' + $routeParams.template_id + '. GET status: ' + status
+ });
+ });
+ });
+
if ($scope.removeLoadJobs) {
$scope.rmoveLoadJobs();
}
@@ -615,6 +642,9 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
}
} else {
$scope[fld] = data[fld];
+ if(fld ==='survey_enabled' && $scope[fld]===true){
+ $scope.$emit('EnableSurvey', fld);
+ }
}
master[fld] = $scope[fld];
}
@@ -819,8 +849,34 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
};
//navigate to the survey maker
- $scope.navigateToSurvey = function() {
- $location.path($location.path() + '/survey');
+ $scope.addSurvey = function() {
+ $location.path($location.path() + '/survey/add');
+ };
+
+ //navigate to the survey maker
+ $scope.editSurvey = function() {
+ $location.path($location.path() + '/survey/edit');
+ };
+
+ //delete a survey by posting a blank survey
+ $scope.deleteSurvey = function() {
+ // $location.path($location.path() + '/survey/add');
+ Wait('start');
+ var url = defaultUrl+ id + '/survey_spec/';
+
+ Rest.setUrl(url);
+ Rest.post({})
+ .success(function () {
+ Wait('stop');
+ $('#job_templates_delete_survey_btn').hide();
+ $('#job_templates_edit_survey_btn').hide();
+ $('#job_templates_create_survey_btn').show();
+
+ })
+ .error(function (data, status) {
+ ProcessErrors($scope, data, status, form, { hdr: 'Error!',
+ msg: 'Failed to add new survey. Post returned status: ' + status });
+ });
};
// Related set: Delete button
diff --git a/awx/ui/static/js/controllers/SurveyMaker.js b/awx/ui/static/js/controllers/SurveyMaker.js
index d625ba4fdb..62d3ae65d4 100644
--- a/awx/ui/static/js/controllers/SurveyMaker.js
+++ b/awx/ui/static/js/controllers/SurveyMaker.js
@@ -23,28 +23,34 @@ function SurveyMakerAdd($scope, $rootScope, $compile, $location, $log, $routePar
// Inject dynamic view
var generator = GenerateForm,
form = SurveyMakerForm,
- base = $location.path().replace(/^\//, '').split('/')[0];
+ base = $location.path().replace(/^\//, '').split('/')[0],
+ id = $location.path().replace(/^\//, '').split('/')[1];
$scope.survey_questions=[];
$scope.answer_types=[
{name: 'Text' , type: 'text'},
- {name: 'Textarea', type: 'text'},
- {name: 'Multiple Choice (single select)', type: 'mc'},
- {name: 'Multiple Choice (multiple select)', type: 'mc'},
+ {name: 'Textarea', type: 'textarea'},
+ {name: 'Multiple Choice (single select)', type: 'multiplechoice'},
+ {name: 'Multiple Choice (multiple select)', type: 'multiselect'},
{name: 'JSON', type: 'json'},
- {name: 'Integer', type: 'number'},
+ {name: 'Integer', type: 'integer'},
{name: 'Float', type: 'number'}
];
generator.inject(form, { mode: 'add', related: false, scope: $scope});
generator.reset();
-
// LoadBreadCrumbs();
+ // LoadBreadCrumbs({
+ // path: '/job_templates/' + id + '/survey',
+ // title: 'jared rocks', // $scope.job_id + ' - ', //+ data.summary_fields.job_template.name,
+ // altPath: '/job_templates/' + id + '/survey',
+ // });
$scope.addQuestion = function(){
- GenerateForm.inject(SurveyQuestionForm, {mode:'add', id:'new_question', scope:$scope, breadCrumbs: false});
+
+ GenerateForm.inject(SurveyQuestionForm, {mode:'modal', id:'new_question', scope:$scope, breadCrumbs: false});
};
$scope.addQuestion();
@@ -84,49 +90,54 @@ function SurveyMakerAdd($scope, $rootScope, $compile, $location, $log, $routePar
// "border-radius": "4px"
// });
// });
- $scope.finalizeQuestion= function(data){
- var html = '
';
- // angular.forEach(data, function(value, key) {
- // html+='
'+data.question_text;
- // });
- html+='
'+data.question_text;
- html+='
'+data.question_description;
- html+='
'+data.response_variable_name;
- html+='
'+data.answer_type;
- html+='
'+data.answer_option_text;
- html+='
'+data.answer_option_number;
- html+='
'+data.answer_option_multiple_choice;
- html+='
'+data.default_answer;
- html+='
'+data.is_required;
+ $scope.finalizeQuestion= function(data, labels){
+ var key,
+ html = '
';
+
+ for (key in data) {
+ html+='
'+data[key]+'
\n';
+ }
+
html+='
';
$('#finalized_questions').before(html);
$('#add_question_btn').show();
$('#add_question_btn').removeAttr('disabled');
- $('#add_question_btn').on("click" , function(){
+ $('#survey_maker_save_btn').removeAttr('disabled');
+ };
+
+ $('#add_question_btn').on("click" , function(){
$scope.addQuestion();
$('#add_question_btn').attr('disabled', 'disabled');
});
- };
+
$scope.submitQuestion = function(){
var form = SurveyQuestionForm,
- data = {}, labels={}, fld;
+ data = {},
+ labels={},
+ min= "min",
+ max = "max",
+ fld;
//generator.clearApiErrors();
Wait('start');
try {
for (fld in form.fields) {
if($scope[fld]){
- data[fld] = $scope[fld];
- // labels[fld] = form.fields[fld].label;
+ if(fld === "type"){
+ data[fld] = $scope[fld].type;
+ if($scope[fld].type==="integer" || $scope[fld].type==="float"){
+ data[min] = $('#answer_min').val();
+ data[max] = $('#answer_max').val();
+ labels[min]= "Min";
+ labels[max]= "Max";
+ }
+ }
+ else{
+ data[fld] = $scope[fld];
+ }
+ labels[fld] = form.fields[fld].label;
}
- // if (form.fields[fld].type === 'select' && fld !== 'playbook') {
- // data[fld] = $scope[fld].value;
- // } else {
- // if (fld !== 'variables') {
- // data[fld] = $scope[fld];
- // }
- // }
}
Wait('stop');
$scope.survey_questions.push(data);
@@ -145,22 +156,17 @@ function SurveyMakerAdd($scope, $rootScope, $compile, $location, $log, $routePar
$scope.formSave = function () {
generator.clearApiErrors();
Wait('start');
- var url = GetBasePath(base);
- url += (base !== 'organizations') ? $routeParams.project_id + '/organizations/' : '';
+ var url = GetBasePath(base)+ id + '/survey_spec/';
+
Rest.setUrl(url);
- Rest.post({ name: $scope.name, description: $scope.description })
- .success(function (data) {
+ Rest.post({ name: $scope.survey_name, description: $scope.survey_description, spec:$scope.survey_questions })
+ .success(function () {
Wait('stop');
- if (base === 'organizations') {
- $rootScope.flashMessage = "New organization successfully created!";
- $location.path('/organizations/' + data.id);
- } else {
- ReturnToCaller(1);
- }
+ $location.path("/job_templates/"+id);
})
.error(function (data, status) {
ProcessErrors($scope, data, status, form, { hdr: 'Error!',
- msg: 'Failed to add new organization. Post returned status: ' + status });
+ msg: 'Failed to add new survey. Post returned status: ' + status });
});
};
@@ -175,6 +181,226 @@ SurveyMakerAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath', 'ReturnToCaller', 'Wait', 'SurveyQuestionForm'
];
+function SurveyMakerEdit($scope, $rootScope, $compile, $location, $log, $routeParams, SurveyMakerForm,
+ GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ClearScope, GetBasePath,
+ ReturnToCaller, Wait, SurveyQuestionForm) {
+
+ ClearScope();
+
+ // Inject dynamic view
+ var generator = GenerateForm,
+ form = SurveyMakerForm,
+ base = $location.path().replace(/^\//, '').split('/')[0],
+ id = $location.path().replace(/^\//, '').split('/')[1];
+
+ $scope.survey_questions=[];
+
+ $scope.answer_types=[
+ {name: 'Text' , type: 'text'},
+ {name: 'Textarea', type: 'textarea'},
+ {name: 'Multiple Choice (single select)', type: 'multiplechoice'},
+ {name: 'Multiple Choice (multiple select)', type: 'multiselect'},
+ {name: 'JSON', type: 'json'},
+ {name: 'Integer', type: 'integer'},
+ {name: 'Float', type: 'number'}
+ ];
+
+
+ generator.inject(form, { mode: 'edit', related: false, scope: $scope});
+ generator.reset();
+ // LoadBreadCrumbs();
+ // LoadBreadCrumbs({
+ // path: '/job_templates/' + id + '/survey',
+ // title: 'jared rocks', // $scope.job_id + ' - ', //+ data.summary_fields.job_template.name,
+ // altPath: '/job_templates/' + id + '/survey',
+ // });
+
+ $scope.addQuestion = function(){
+
+ GenerateForm.inject(SurveyQuestionForm, {mode:'add', id:'new_question', scope:$scope, breadCrumbs: false});
+ };
+ // $scope.addQuestion();
+
+// $('#question_shadow').mouseenter(function(){
+// $('#question_shadow').css({
+// "opacity": "1",
+// "border": "1px solid",
+// "border-color": "rgb(204,204,204)",
+// "border-radius": "4px"
+// });
+// $('#question_add_btn').show();
+// });
+
+// $('#question_shadow').mouseleave(function(){
+// $('#question_shadow').css({
+// "opacity": ".4",
+// "border": "1px dashed",
+// "border-color": "rgb(204,204,204)",
+// "border-radius": "4px"
+// });
+// $('#question_add_btn').hide();
+// })
+
+
+ // $('#question_shadow').on("click" , function(){
+ // // var survey_width = $('#survey_maker_question_area').width()-10,
+ // // html = "";
+
+ // // $('#add_question_btn').attr('disabled', 'disabled')
+ // // $('#survey_maker_question_area').append(html);
+ // addQuestion();
+ // $('#question_shadow').hide();
+ // $('#question_shadow').css({
+ // "opacity": ".4",
+ // "border": "1px dashed",
+ // "border-color": "rgb(204,204,204)",
+ // "border-radius": "4px"
+ // });
+ // });
+ $scope.finalizeQuestion= function(data){
+ var key,
+ labels={
+ "type": "Type",
+ "question_name": "Question Text",
+ "question_description": "Question Description",
+ "variable": "Answer Varaible Name",
+ "choices": "Choices",
+ "min": "Min",
+ "max": "Max",
+ "required": "Required",
+ "default": "Default Answer"
+ },
+ html = '
';
+
+ for (key in data) {
+ html+='
'+data[key]+'
\n';
+ }
+
+ html+='
';
+
+ $('#finalized_questions').before(html);
+ $('#add_question_btn').show();
+ $('#add_question_btn').removeAttr('disabled');
+ $('#survey_maker_save_btn').removeAttr('disabled');
+ };
+
+ $('#add_question_btn').on("click" , function(){
+ $scope.addQuestion();
+ $('#add_question_btn').attr('disabled', 'disabled');
+ });
+
+ Wait('start');
+
+ Rest.setUrl(GetBasePath(base)+ id + '/survey_spec/');
+ Rest.get()
+ .success(function (data) {
+ var i;
+ $scope.survey_name = data.name;
+ $scope.survey_description = data.description;
+ $scope.survey_questions = data.spec;
+ for(i=0; i<$scope.survey_questions.length; i++){
+ $scope.finalizeQuestion($scope.survey_questions[i]);
+ }
+ Wait('stop');
+ // LoadBreadCrumbs({ path: '/organizations/' + id, title: data.name });
+ // for (fld in form.fields) {
+ // if (data[fld]) {
+ // $scope[fld] = data[fld];
+ // master[fld] = data[fld];
+ // }
+ // }
+
+ // related = data.related;
+ // for (set in form.related) {
+ // if (related[set]) {
+ // relatedSets[set] = {
+ // url: related[set],
+ // iterator: form.related[set].iterator
+ // };
+ // }
+ // }
+
+ // Initialize related search functions. Doing it here to make sure relatedSets object is populated.
+ // RelatedSearchInit({ scope: $scope, form: form, relatedSets: relatedSets });
+ // RelatedPaginateInit({ scope: $scope, relatedSets: relatedSets });
+ // $scope.$emit('organizationLoaded');
+ })
+ .error(function (data, status) {
+ ProcessErrors($scope, data, status, form, { hdr: 'Error!',
+ msg: 'Failed to retrieve organization: ' + $routeParams.id + '. GET status: ' + status });
+ });
+
+ $scope.submitQuestion = function(){
+ var form = SurveyQuestionForm,
+ data = {},
+ labels={},
+ min= "min",
+ max = "max",
+ fld;
+ //generator.clearApiErrors();
+ Wait('start');
+
+ try {
+ for (fld in form.fields) {
+ if($scope[fld]){
+ if(fld === "type"){
+ data[fld] = $scope[fld].type;
+ if($scope[fld].type==="integer" || $scope[fld].type==="float"){
+ data[min] = $('#answer_min').val();
+ data[max] = $('#answer_max').val();
+ labels[min]= "Min";
+ labels[max]= "Max";
+ }
+ }
+ else{
+ data[fld] = $scope[fld];
+ }
+ labels[fld] = form.fields[fld].label;
+ }
+ }
+ Wait('stop');
+ $scope.survey_questions.push(data);
+ $('#new_question .aw-form-well').remove();
+ // for(fld in form.fields){
+ // $scope[fld] = '';
+ // }
+ $scope.finalizeQuestion(data , labels);
+
+ } catch (err) {
+ Wait('stop');
+ Alert("Error", "Error parsing extra variables. Parser returned: " + err);
+ }
+ };
+ // Save
+ $scope.formSave = function () {
+ generator.clearApiErrors();
+ Wait('start');
+ var url = GetBasePath(base)+ id + '/survey_spec/';
+
+ Rest.setUrl(url);
+ Rest.post({ name: $scope.survey_name, description: $scope.survey_description, spec:$scope.survey_questions })
+ .success(function () {
+ Wait('stop');
+ $location.path("/job_templates/"+id);
+ })
+ .error(function (data, status) {
+ ProcessErrors($scope, data, status, form, { hdr: 'Error!',
+ msg: 'Failed to add new survey. Post returned status: ' + status });
+ });
+ };
+
+ // Cancel
+ $scope.formReset = function () {
+ $rootScope.flashMessage = null;
+ generator.reset();
+ };
+}
+
+SurveyMakerEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'SurveyMakerForm',
+ 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ClearScope', 'GetBasePath', 'ReturnToCaller', 'Wait', 'SurveyQuestionForm'
+];
+
+
// function OrganizationsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, OrganizationForm, GenerateForm, Rest,
// Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, Prompt, ClearScope, GetBasePath, Wait, Stream) {
diff --git a/awx/ui/static/js/forms/JobTemplates.js b/awx/ui/static/js/forms/JobTemplates.js
index e45cf061dc..17e2c1cb84 100644
--- a/awx/ui/static/js/forms/JobTemplates.js
+++ b/awx/ui/static/js/forms/JobTemplates.js
@@ -240,19 +240,51 @@ angular.module('JobTemplateFormDefinition', ['SchedulesListDefinition', 'Complet
dataTitle: 'Prompt for Extra Variables',
dataContainer: "body"
},
- enable_survey: {
+ // survey_enabled: {
+ // type: 'custom',
+ // column: 2,
+ // control: '
'
+ // },
+ survey_enabled: {
+ label: 'Enable Survey',
+ type: 'checkbox',
+ addRequired: false,
+ editRequird: false,
+ trueValue: 'true',
+ falseValue: 'false',
+ column: 2,
+ awPopOver: "
If checked, user will be prompted at job launch with a series of questions related to the job.
",
+ dataPlacement: 'right',
+ dataTitle: 'Enable Survey',
+ dataContainer: "body"
+ },
+ create_survey: {
type: 'custom',
column: 2,
- control: '
'
+ control: '
'+
+ '
'+
+ '
'
+ // label: 'Create Survey',
+ // type: 'text',
+ // addRequired: false,
+ // editRequired: false,
+ // // readonly: true,
+ // // ngShow: "survey_enabled",
+ // column: 2,
+ // awPopOver: "survey_help",
+ // awPopOverWatch: "survey_help",
+ // dataPlacement: 'right',
+ // dataTitle: 'Provisioning Callback URL',
+ // dataContainer: "body"
},
allow_callbacks: {
label: 'Allow Provisioning Callbacks',
diff --git a/awx/ui/static/js/forms/SurveyMaker.js b/awx/ui/static/js/forms/SurveyMaker.js
index a9af2e0967..2eb676d188 100644
--- a/awx/ui/static/js/forms/SurveyMaker.js
+++ b/awx/ui/static/js/forms/SurveyMaker.js
@@ -18,32 +18,33 @@ angular.module('SurveyMakerFormDefinition', [])
editTitle: 'Edit Survey', //Title in edit mode
name: 'survey_maker', //entity or model name in singular form
well: true,
- collapse: true,
- collapseTitle: "Properties",
- collapseMode: 'edit',
- collapseOpen: true,
+ //breadCrumbs:true,
+ // collapse: true,
+ // collapseTitle: "Properties",
+ // collapseMode: 'edit',
+ // collapseOpen: true,
- actions: {
- stream: {
- 'class': "btn-primary btn-xs activity-btn",
- ngClick: "showActivity()",
- awToolTip: "View Activity Stream",
- dataPlacement: "top",
- icon: "icon-comments-alt",
- mode: 'edit',
- iconSize: 'large'
- }
- },
+ // actions: {
+ // stream: {
+ // 'class': "btn-primary btn-xs activity-btn",
+ // ngClick: "showActivity()",
+ // awToolTip: "View Activity Stream",
+ // dataPlacement: "top",
+ // icon: "icon-comments-alt",
+ // mode: 'edit',
+ // iconSize: 'large'
+ // }
+ // },
fields: {
- name: {
+ survey_name: {
label: 'Survey Name',
type: 'text',
addRequired: true,
editRequired: true,
capitalize: false
},
- description: {
+ survey_description: {
label: 'Survey Description',
type: 'text',
addRequired: false,
diff --git a/awx/ui/static/js/forms/SurveyQuestion.js b/awx/ui/static/js/forms/SurveyQuestion.js
index ba2644543b..8d467f0f83 100644
--- a/awx/ui/static/js/forms/SurveyQuestion.js
+++ b/awx/ui/static/js/forms/SurveyQuestion.js
@@ -15,7 +15,7 @@ angular.module('SurveyQuestionFormDefinition', [])
.value('SurveyQuestionForm', {
addTitle: 'Add Question',
- editTitle: '{{ inventory_name }}',
+ editTitle: '{{ survey_name }}',
name: 'question_unique',
well: true,
twoColumns: true,
@@ -33,13 +33,13 @@ angular.module('SurveyQuestionFormDefinition', [])
// },
fields: {
- question_text: {
+ question_name: {
realName: 'question_text',
label: 'Question Text',
type: 'text',
addRequired: true,
editRequired: true,
- capitalize: true,
+ capitalize: false,
column: 1
},
question_description: {
@@ -51,7 +51,7 @@ angular.module('SurveyQuestionFormDefinition', [])
editRequired: false,
column: 2
},
- response_variable_name: {
+ variable: {
label: 'Answer Variable Name',
type: 'text',
addRequired: true,
@@ -65,7 +65,7 @@ angular.module('SurveyQuestionFormDefinition', [])
// init: "true"
// }
},
- answer_type: {
+ type: {
realName: 'answer_type',
label: 'Answer Type',
type: 'select',
@@ -75,23 +75,23 @@ angular.module('SurveyQuestionFormDefinition', [])
column: 1
},
- answer_options_text: {
- realName: 'answer_options',
- label: 'Answer Options',
- type: 'text',
- addRequired: true,
- editRequired: true,
- ngHide: 'answer_type.type!=="text" ',
- column: 1
- },
- answer_options_multiple_choice: {
+ // answer_options_text: {
+ // realName: 'answer_options',
+ // label: 'Answer Options',
+ // type: 'text',
+ // addRequired: true,
+ // editRequired: true,
+ // ngHide: 'answer_type.type!=="text" ',
+ // column: 1
+ // },
+ choices: {
realName: 'answer_options',
label: 'Multiple Choice Options',
type: 'textarea',
rows: 3,
addRequired: true,
editRequired: true,
- ngShow: 'answer_type.type==="mc" ',
+ ngShow: 'type.type==="multipleselect" || type.type==="multiplechoice" ',
awPopOver: '
Type an option on each line.
'+
'
For example the following input:
Apple
\n Banana
\n Cherry
would be displayed as:
\n'+
'
- Apple
- Banana
- Cherry
',
@@ -107,26 +107,26 @@ angular.module('SurveyQuestionFormDefinition', [])
control: '',
- ngShow: 'answer_type.type==="number" ',
+ ngShow: 'type.type==="integer" || type.type==="float" ',
addRequired: true,
editRequired: true,
column: 1
},
- answer_options_json: {
- realName: 'answer_options',
- label: 'Answer Options',
- type: 'textarea',
- rows: 3,
- ngShow: 'answer_type.type==="json" ',
- addRequired: true,
- editRequired: true,
- awPopOver: 'Insert some good JSON!
',
- dataTitle: 'Answer Options',
- dataPlacement: 'right',
- dataContainer: "body",
- column: 1
- },
- default_answer: {
+ // answer_options_json: {
+ // realName: 'answer_options',
+ // label: 'Answer Options',
+ // type: 'textarea',
+ // rows: 3,
+ // ngShow: 'type.type==="json" ',
+ // addRequired: true,
+ // editRequired: true,
+ // awPopOver: 'Insert some good JSON!
',
+ // dataTitle: 'Answer Options',
+ // dataPlacement: 'right',
+ // dataContainer: "body",
+ // column: 1
+ // },
+ default: {
realName: 'default_answer',
label: 'Default Answer',
type: 'text',
@@ -134,12 +134,19 @@ angular.module('SurveyQuestionFormDefinition', [])
editRequired: false,
column: 1
},
- is_required: {
- label: 'Answer required or optional',
- type: 'custom',
- column: 2,
- control: ''+
- '',
+ required: {
+ realName: 'default_answer',
+ label: 'Required',
+ type: 'checkbox',
+ // checked: true,
+ addRequired: false,
+ editRequired: false,
+ column: 2
+ // label: 'Answer required or optional',
+ // type: 'custom',
+ // column: 2,
+ // control: ''+
+ // '',
}
// answer_options: {
diff --git a/awx/ui/static/js/helpers/JobSubmission.js b/awx/ui/static/js/helpers/JobSubmission.js
index b531733001..51311ef2ea 100644
--- a/awx/ui/static/js/helpers/JobSubmission.js
+++ b/awx/ui/static/js/helpers/JobSubmission.js
@@ -405,8 +405,10 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi
// url = GetBasePath('jobs');
// }
// url += id + '/';
+
url = GetBasePath('job_templates')+ id + '/launch/';
+
if (scope.removePostTheJob) {
scope.removePostTheJob();
}