mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
Show manual project path when available
This commit is contained in:
@@ -51,20 +51,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'ProjectsForm', 'Rest',
|
|||||||
$scope.projectLoadedRemove();
|
$scope.projectLoadedRemove();
|
||||||
}
|
}
|
||||||
$scope.projectLoadedRemove = $scope.$on('projectLoaded', function() {
|
$scope.projectLoadedRemove = $scope.$on('projectLoaded', function() {
|
||||||
var opts = [];
|
GetProjectPath({ scope: $scope, master: master });
|
||||||
|
|
||||||
if (Authorization.getUserInfo('is_superuser') === true) {
|
|
||||||
GetProjectPath({ scope: $scope, master: master });
|
|
||||||
} else {
|
|
||||||
opts.push({
|
|
||||||
label: $scope.local_path,
|
|
||||||
value: $scope.local_path
|
|
||||||
});
|
|
||||||
$scope.project_local_paths = opts;
|
|
||||||
$scope.local_path = $scope.project_local_paths[0];
|
|
||||||
$scope.base_dir = i18n._('You do not have access to view this property');
|
|
||||||
$scope.$emit('pathsReady');
|
|
||||||
}
|
|
||||||
|
|
||||||
$scope.pathRequired = ($scope.scm_type.value === 'manual') ? true : false;
|
$scope.pathRequired = ($scope.scm_type.value === 'manual') ? true : false;
|
||||||
$scope.scmRequired = ($scope.scm_type.value !== 'manual') ? true : false;
|
$scope.scmRequired = ($scope.scm_type.value !== 'manual') ? true : false;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export default
|
export default
|
||||||
function GetProjectPath(Alert, Rest, GetBasePath, ProcessErrors) {
|
function GetProjectPath(i18n, Rest, GetBasePath, ProcessErrors) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
var scope = params.scope,
|
var scope = params.scope,
|
||||||
master = params.master;
|
master = params.master;
|
||||||
@@ -53,7 +53,7 @@ export default
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
scope.base_dir = data.project_base_dir;
|
scope.base_dir = data.project_base_dir || i18n._('You do not have access to view this property');
|
||||||
master.local_path = scope.local_path;
|
master.local_path = scope.local_path;
|
||||||
master.base_dir = scope.base_dir; // Keep in master object so that it doesn't get
|
master.base_dir = scope.base_dir; // Keep in master object so that it doesn't get
|
||||||
// wiped out on form reset.
|
// wiped out on form reset.
|
||||||
@@ -65,13 +65,13 @@ export default
|
|||||||
})
|
})
|
||||||
.catch(({data, status}) => {
|
.catch(({data, status}) => {
|
||||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||||
msg: 'Failed to access API config. GET status: ' + status });
|
msg: i18n._('Failed to access API config. GET status: ') + status });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
GetProjectPath.$inject =
|
GetProjectPath.$inject =
|
||||||
[ 'Alert',
|
[ 'i18n',
|
||||||
'Rest',
|
'Rest',
|
||||||
'GetBasePath',
|
'GetBasePath',
|
||||||
'ProcessErrors'
|
'ProcessErrors'
|
||||||
|
|||||||
Reference in New Issue
Block a user