From ca72c3024f5624b8ea60ec59ecc9abf51d0b364c Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Thu, 6 Jul 2017 13:54:16 -0400 Subject: [PATCH] Removed project status check --- .../sources/add/sources-add.controller.js | 31 ------------------- .../sources/edit/sources-edit.controller.js | 31 ++----------------- 2 files changed, 2 insertions(+), 60 deletions(-) diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/sources/add/sources-add.controller.js b/awx/ui/client/src/inventories-hosts/inventories/related/sources/add/sources-add.controller.js index e8e8e41f09..198e5cbd6b 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/sources/add/sources-add.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/sources/add/sources-add.controller.js @@ -47,36 +47,6 @@ export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition', } }; - // Detect and alert user to potential SCM status issues - var checkSCMStatus = function () { - if (!Empty($scope.project)) { - Rest.setUrl(GetBasePath('projects') + $scope.project + '/'); - Rest.get() - .success(function (data) { - var msg; - switch (data.status) { - case 'failed': - msg = "
The Project selected has a status of \"failed\". You must run a successful update before you can select an inventory file."; - break; - case 'never updated': - msg = "
The Project selected has a status of \"never updated\". You must run a successful update before you can select an inventory file."; - break; - case 'missing': - msg = '
The selected project has a status of \"missing\". Please check the server and make sure ' + - ' the directory exists and file permissions are set correctly.
'; - break; - } - if (msg) { - Alert('Warning', msg, 'alert-info alert-info--noTextTransform', null, null, null, null, true); - } - }) - .error(function (data, status) { - ProcessErrors($scope, data, status, form, { hdr: 'Error!', - msg: 'Failed to get project ' + $scope.project + '. GET returned status: ' + status }); - }); - } - }; - // Register a watcher on project_name if ($scope.getInventoryFilesUnregister) { $scope.getInventoryFilesUnregister(); @@ -84,7 +54,6 @@ export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition', $scope.getInventoryFilesUnregister = $scope.$watch('project', function (newValue, oldValue) { if (newValue !== oldValue) { getInventoryFiles(newValue); - checkSCMStatus(); } }); diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/sources/edit/sources-edit.controller.js b/awx/ui/client/src/inventories-hosts/inventories/related/sources/edit/sources-edit.controller.js index f4a68679ed..8075977ccf 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/sources/edit/sources-edit.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/sources/edit/sources-edit.controller.js @@ -8,12 +8,12 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString', 'rbacUiControlService', 'ToJSON', 'ParseTypeChange', 'GroupsService', 'GetChoices', 'GetBasePath', 'CreateSelect2', 'GetSourceTypeOptions', 'inventorySourceData', 'SourcesService', 'inventoryData', 'inventorySourcesOptions', 'Empty', - 'Wait', 'Rest', 'Alert', 'ProcessErrors', + 'Wait', 'Rest', 'Alert', function($state, $stateParams, $scope, ParseVariableString, rbacUiControlService, ToJSON,ParseTypeChange, GroupsService, GetChoices, GetBasePath, CreateSelect2, GetSourceTypeOptions, inventorySourceData, SourcesService, inventoryData, inventorySourcesOptions, Empty, - Wait, Rest, Alert, ProcessErrors) { + Wait, Rest, Alert) { function init() { $scope.projectBasePath = GetBasePath('projects'); @@ -136,33 +136,6 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString', Wait('stop'); }); } - - if (!Empty($scope.project)) { - Rest.setUrl(GetBasePath('projects') + $scope.project + '/'); - Rest.get() - .success(function (data) { - var msg; - switch (data.status) { - case 'failed': - msg = "
The Project selected has a status of \"failed\". You must run a successful update before you can select an inventory file."; - break; - case 'never updated': - msg = "
The Project selected has a status of \"never updated\". You must run a successful update before you can select an inventory file."; - break; - case 'missing': - msg = '
The selected project has a status of \"missing\". Please check the server and make sure ' + - ' the directory exists and file permissions are set correctly.
'; - break; - } - if (msg) { - Alert('Warning', msg, 'alert-info alert-info--noTextTransform', null, null, null, null, true); - } - }) - .error(function (data, status) { - ProcessErrors($scope, data, status, null, { hdr: 'Error!', - msg: 'Failed to get project ' + $scope.project + '. GET returned status: ' + status }); - }); - } } function initSourceSelect() {