From 3d42fb1237819494a343c343173ae50e0ae7c68d Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Wed, 20 Jun 2018 12:50:38 -0400 Subject: [PATCH] updating reference to custom virtualenv --- .../src/organizations/add/organizations-add.controller.js | 5 +++-- .../src/organizations/edit/organizations-edit.controller.js | 5 +++-- awx/ui/client/src/projects/add/projects-add.controller.js | 3 ++- awx/ui/client/src/projects/edit/projects-edit.controller.js | 3 ++- .../add-job-template/job-template-add.controller.js | 3 ++- .../edit-job-template/job-template-edit.controller.js | 3 ++- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/awx/ui/client/src/organizations/add/organizations-add.controller.js b/awx/ui/client/src/organizations/add/organizations-add.controller.js index 84a5f5dbd7..6acccc4296 100644 --- a/awx/ui/client/src/organizations/add/organizations-add.controller.js +++ b/awx/ui/client/src/organizations/add/organizations-add.controller.js @@ -26,8 +26,9 @@ export default ['$scope', '$rootScope', '$location', '$stateParams', function init(){ // @issue What is this doing, why $scope.$emit("HideOrgListHeader"); - $scope.custom_virtualenvs_visible = ConfigData.custom_virtualenvs.length > 1; - $scope.custom_virtualenvs_options = ConfigData.custom_virtualenvs.filter( + const virtualEnvs = ConfigData.custom_virtualenvs || []; + $scope.custom_virtualenvs_visible = virtualEnvs.length > 1; + $scope.custom_virtualenvs_options = virtualEnvs.filter( v => !/\/ansible\/$/.test(v) ); CreateSelect2({ diff --git a/awx/ui/client/src/organizations/edit/organizations-edit.controller.js b/awx/ui/client/src/organizations/edit/organizations-edit.controller.js index 6fcd6d55db..0ec36af6ec 100644 --- a/awx/ui/client/src/organizations/edit/organizations-edit.controller.js +++ b/awx/ui/client/src/organizations/edit/organizations-edit.controller.js @@ -34,8 +34,9 @@ export default ['$scope', '$location', '$stateParams', 'OrgAdminLookup', $scope.$emit("HideOrgListHeader"); $scope.instance_groups = InstanceGroupsData; - $scope.custom_virtualenvs_visible = ConfigData.custom_virtualenvs.length > 1; - $scope.custom_virtualenvs_options = ConfigData.custom_virtualenvs.filter( + const virtualEnvs = ConfigData.custom_virtualenvs || []; + $scope.custom_virtualenvs_visible = virtualEnvs.length > 1; + $scope.custom_virtualenvs_options = virtualEnvs.filter( v => !/\/ansible\/$/.test(v) ); } diff --git a/awx/ui/client/src/projects/add/projects-add.controller.js b/awx/ui/client/src/projects/add/projects-add.controller.js index a5ccdbdbf2..d790510402 100644 --- a/awx/ui/client/src/projects/add/projects-add.controller.js +++ b/awx/ui/client/src/projects/add/projects-add.controller.js @@ -21,7 +21,8 @@ export default ['$scope', '$location', '$stateParams', 'GenerateForm', function init() { $scope.canEditOrg = true; - $scope.custom_virtualenvs_options = ConfigData.custom_virtualenvs; + const virtualEnvs = ConfigData.custom_virtualenvs || []; + $scope.custom_virtualenvs_options = virtualEnvs; Rest.setUrl(GetBasePath('projects')); Rest.options() diff --git a/awx/ui/client/src/projects/edit/projects-edit.controller.js b/awx/ui/client/src/projects/edit/projects-edit.controller.js index 8f28ac1b79..d614a40d8b 100644 --- a/awx/ui/client/src/projects/edit/projects-edit.controller.js +++ b/awx/ui/client/src/projects/edit/projects-edit.controller.js @@ -25,7 +25,8 @@ export default ['$scope', '$rootScope', '$stateParams', 'ProjectsForm', 'Rest', function init() { $scope.project_local_paths = []; $scope.base_dir = ''; - $scope.custom_virtualenvs_options = ConfigData.custom_virtualenvs; + const virtualEnvs = ConfigData.custom_virtualenvs || []; + $scope.custom_virtualenvs_options = virtualEnvs; } $scope.$watch('project_obj.summary_fields.user_capabilities.edit', function(val) { diff --git a/awx/ui/client/src/templates/job_templates/add-job-template/job-template-add.controller.js b/awx/ui/client/src/templates/job_templates/add-job-template/job-template-add.controller.js index ab79a8cc7a..d25d41e706 100644 --- a/awx/ui/client/src/templates/job_templates/add-job-template/job-template-add.controller.js +++ b/awx/ui/client/src/templates/job_templates/add-job-template/job-template-add.controller.js @@ -89,7 +89,8 @@ } } $scope.job_type = $scope.job_type_options[form.fields.job_type.default]; - $scope.custom_virtualenvs_options = ConfigData.custom_virtualenvs; + const virtualEnvs = ConfigData.custom_virtualenvs || []; + $scope.custom_virtualenvs_options = virtualEnvs; CreateSelect2({ element:'#job_template_job_type', diff --git a/awx/ui/client/src/templates/job_templates/edit-job-template/job-template-edit.controller.js b/awx/ui/client/src/templates/job_templates/edit-job-template/job-template-edit.controller.js index 14809fcf52..d4ce2a57fb 100644 --- a/awx/ui/client/src/templates/job_templates/edit-job-template/job-template-edit.controller.js +++ b/awx/ui/client/src/templates/job_templates/edit-job-template/job-template-edit.controller.js @@ -62,7 +62,8 @@ export default $scope.surveyTooltip = i18n._('Surveys allow users to be prompted at job launch with a series of questions related to the job. This allows for variables to be defined that affect the playbook run at time of launch.'); $scope.job_tag_options = []; $scope.skip_tag_options = []; - $scope.custom_virtualenvs_options = ConfigData.custom_virtualenvs; + const virtualEnvs = ConfigData.custom_virtualenvs || []; + $scope.custom_virtualenvs_options = virtualEnvs; SurveyControllerInit({ scope: $scope,