mirror of
https://github.com/ansible/awx.git
synced 2026-04-11 21:19:22 -02:30
Removed project status check
This commit is contained in:
@@ -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();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user