removing some unnecessary files

This commit is contained in:
Jared Tabor 2014-10-15 10:12:13 -04:00
parent 6df573a0e9
commit 2fa230052c
5 changed files with 7 additions and 93 deletions

View File

@ -116,9 +116,8 @@ angular.module('Tower', [
'LoadConfigHelper',
'SocketHelper',
'AboutAnsibleHelpModal',
'SurveyMakerFormDefinition',
'SurveyQuestionFormDefinition',
'SurveyTakerFormDefinition'
])

View File

@ -1,65 +0,0 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
*
* SurveyMaker.js
* Form definition for survey maker model
*
*
*/
/**
* @ngdoc function
* @name forms.function:SurveyMaker
* @description This form is for adding/editing a survey
*/
angular.module('SurveyTakerFormDefinition', [])
.value('SurveyTakerForm', {
// addTitle: 'Add Survey', //Title in add mode
// editTitle: 'Edit Survey', //Title in edit mode
name: 'survey_taker', //entity or model name in singular form
// // well: true,
breadCrumbs: false,
// twoColumns: 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'
// }
// },
fields: {
survey_name: {
type: 'custom',
control: '<div class="row">'+
'<div class="col-sm-12">'+//<label for="survey"><span class="label-text prepend-asterisk">Questions</span></label>'+
'<div id="survey_taker_description"></div>' +
'<div id="survey_maker_question_area"></div><div id="survey_taker_finalized_questions"></div>'+
//'<button style="display:none" type="button" class="btn btn-sm btn-primary" id="add_question_btn" ng-click="addNewQuestion()" aw-tool-tip="Create a new question" data-placement="top" data-original-title="" title="" disabled><i class="fa fa-plus fa-lg"></i> Add Question</button>'+
'<div id="new_question"></div></div></div>'
},
},
buttons: { //for now always generates <button> tags
// save: {
// ngClick: 'formSave()', //$scope.function to call on click, optional
// ngDisabled: true //Disable when $pristine or $invalid, optional
// }
// reset: {
// ngClick: 'formReset()',
// ngDisabled: true //Disabled when $pristine
// }
}
});

View File

@ -523,12 +523,11 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi
}])
.factory('PromptForSurvey', ['$compile', 'Wait', 'Alert', 'CredentialForm', 'CreateLaunchDialog', 'SurveyControllerInit' , 'GetBasePath', 'Rest' , 'Empty',
'SurveyTakerForm', 'GenerateForm', 'ShowSurveyModal', 'ProcessErrors', '$routeParams' ,
'GenerateForm', 'ShowSurveyModal', 'ProcessErrors', '$routeParams' ,
function($compile, Wait, Alert, CredentialForm, CreateLaunchDialog, SurveyControllerInit, GetBasePath, Rest, Empty,
SurveyTakerForm, GenerateForm, ShowSurveyModal, ProcessErrors, $routeParams) {
GenerateForm, ShowSurveyModal, ProcessErrors, $routeParams) {
return function(params) {
var html = params.html || "",
form = SurveyTakerForm,
id= params.id,
url = params.url,
scope = params.scope,
@ -780,7 +779,7 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi
})
.error(function (data, status) {
ProcessErrors(scope, data, status, form, { hdr: 'Error!',
ProcessErrors(scope, data, status, { hdr: 'Error!',
msg: 'Failed to retrieve organization: ' + $routeParams.id + '. GET status: ' + status });
});

View File

@ -85,28 +85,14 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper',
};
}])
.factory('EditSurvey', ['$routeParams','SchedulerInit', 'ShowSurveyModal', 'Wait', 'Rest', 'ProcessErrors', 'GetBasePath', 'GenerateForm', 'SurveyMakerForm',
.factory('EditSurvey', ['$routeParams','SchedulerInit', 'ShowSurveyModal', 'Wait', 'Rest', 'ProcessErrors', 'GetBasePath', 'GenerateForm',
'Empty', 'AddSurvey',
function($routeParams, SchedulerInit, ShowSurveyModal, Wait, Rest, ProcessErrors, GetBasePath, GenerateForm,SurveyMakerForm,
function($routeParams, SchedulerInit, ShowSurveyModal, Wait, Rest, ProcessErrors, GetBasePath, GenerateForm,
Empty, AddSurvey) {
return function(params) {
var scope = params.scope,
id = params.id,
// callback = params.callback,
tempSurv = {},
generator = GenerateForm,
form = SurveyMakerForm,
// 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"
// },
url = GetBasePath('job_templates') + id + '/survey_spec/', i;
if (scope.removeDialogReady) {
@ -121,7 +107,6 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper',
if(scope.mode === 'add'){
tempSurv.survey_name = scope.survey_name;
tempSurv.survey_description = scope.survey_description;
generator.inject(form, { id: 'survey-modal-dialog' , mode: 'edit', related: false, scope: scope, breadCrumbs: false });
ShowSurveyModal({ title: "Edit Survey", scope: scope, callback: 'DialogReady' });
@ -138,7 +123,6 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper',
Rest.get()
.success(function (data) {
if(!Empty(data)){
// generator.inject(form, { id: 'survey-modal-dialog' , mode: 'edit', related: false, scope: scope, breadCrumbs: false });
ShowSurveyModal({ title: "Edit Survey", scope: scope, callback: 'DialogReady' });
scope.survey_name = data.name;
@ -157,7 +141,7 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper',
})
.error(function (data, status) {
ProcessErrors(scope, data, status, form, { hdr: 'Error!',
ProcessErrors(scope, data, status, { hdr: 'Error!',
msg: 'Failed to retrieve organization: ' + $routeParams.id + '. GET status: ' + status });
});
}

View File

@ -1,7 +1,6 @@
<!DOCTYPE html>
<html lang="en" ng-app="Tower">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="utf-8">
<title>Ansible Tower</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@ -103,8 +102,6 @@
<script src="{{ STATIC_URL }}js/forms/LicenseForm.js"></script>
<script src="{{ STATIC_URL }}js/forms/LicenseUpdate.js"></script>
<script src="{{ STATIC_URL }}js/forms/Source.js"></script>
<script src="{{ STATIC_URL }}js/forms/SurveyMaker.js"></script>
<script src="{{ STATIC_URL }}js/forms/SurveyTaker.js"></script>
<script src="{{ STATIC_URL }}js/forms/SurveyQuestion.js"></script>
<script src="{{ STATIC_URL }}js/forms/LogViewerStatus.js"></script>
<script src="{{ STATIC_URL }}js/forms/LogViewerOptions.js"></script>