Removed project status check

This commit is contained in:
Michael Abashian
2017-07-06 13:54:16 -04:00
parent 9213eec681
commit ca72c3024f
2 changed files with 2 additions and 60 deletions

View File

@@ -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 = "<div>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 = "<div>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 = '<div>The selected project has a status of \"missing\". Please check the server and make sure ' +
' the directory exists and file permissions are set correctly.</div>';
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 // Register a watcher on project_name
if ($scope.getInventoryFilesUnregister) { if ($scope.getInventoryFilesUnregister) {
$scope.getInventoryFilesUnregister(); $scope.getInventoryFilesUnregister();
@@ -84,7 +54,6 @@ export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition',
$scope.getInventoryFilesUnregister = $scope.$watch('project', function (newValue, oldValue) { $scope.getInventoryFilesUnregister = $scope.$watch('project', function (newValue, oldValue) {
if (newValue !== oldValue) { if (newValue !== oldValue) {
getInventoryFiles(newValue); getInventoryFiles(newValue);
checkSCMStatus();
} }
}); });

View File

@@ -8,12 +8,12 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
'rbacUiControlService', 'ToJSON', 'ParseTypeChange', 'GroupsService', 'rbacUiControlService', 'ToJSON', 'ParseTypeChange', 'GroupsService',
'GetChoices', 'GetBasePath', 'CreateSelect2', 'GetSourceTypeOptions', 'GetChoices', 'GetBasePath', 'CreateSelect2', 'GetSourceTypeOptions',
'inventorySourceData', 'SourcesService', 'inventoryData', 'inventorySourcesOptions', 'Empty', 'inventorySourceData', 'SourcesService', 'inventoryData', 'inventorySourcesOptions', 'Empty',
'Wait', 'Rest', 'Alert', 'ProcessErrors', 'Wait', 'Rest', 'Alert',
function($state, $stateParams, $scope, ParseVariableString, function($state, $stateParams, $scope, ParseVariableString,
rbacUiControlService, ToJSON,ParseTypeChange, GroupsService, rbacUiControlService, ToJSON,ParseTypeChange, GroupsService,
GetChoices, GetBasePath, CreateSelect2, GetSourceTypeOptions, GetChoices, GetBasePath, CreateSelect2, GetSourceTypeOptions,
inventorySourceData, SourcesService, inventoryData, inventorySourcesOptions, Empty, inventorySourceData, SourcesService, inventoryData, inventorySourcesOptions, Empty,
Wait, Rest, Alert, ProcessErrors) { Wait, Rest, Alert) {
function init() { function init() {
$scope.projectBasePath = GetBasePath('projects'); $scope.projectBasePath = GetBasePath('projects');
@@ -136,33 +136,6 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
Wait('stop'); 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 = "<div>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 = "<div>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 = '<div>The selected project has a status of \"missing\". Please check the server and make sure ' +
' the directory exists and file permissions are set correctly.</div>';
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() { function initSourceSelect() {