1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Various sprint 1 ui fixes

The edit button for the row of the item you are currently editing now stays selected
Projects edit's now refresh correctly
The pagination service now supports queries for users (use username instead of just name)
This commit is contained in:
John Mitchell 2016-01-22 10:12:17 -05:00
parent 6097061f8b
commit e07c2643ee
5 changed files with 29 additions and 9 deletions

View File

@ -246,3 +246,8 @@ table, tbody {
background-color: @list-no-items-bg;
color: @list-no-items-txt;
}
.List-editButton--selected {
background-color: @list-actn-bg-hov !important;
color: @list-actn-icn-hov;
}

View File

@ -112,7 +112,7 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $stateParams,
if ($scope.removeChoicesHere) {
$scope.removeChoicesHere();
}
$scope.removeChoicesHere = $scope.$on('choicesCompleteProject', function () {
$scope.removeChoicesHere = $scope.$on('choicesCompleteProjectList', function () {
var opt;
list.fields.scm_type.searchOptions = $scope.project_scm_type_options;
@ -164,13 +164,13 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $stateParams,
$scope.search(list.iterator);
});
if ($scope.removeChoicesReady) {
$scope.removeChoicesReady();
if ($scope.removeChoicesReadyList) {
$scope.removeChoicesReadyList();
}
$scope.removeChoicesReady = $scope.$on('choicesReadyProject', function () {
$scope.removeChoicesReadyList = $scope.$on('choicesReadyProjectList', function () {
choiceCount++;
if (choiceCount === 2) {
$scope.$emit('choicesCompleteProject');
$scope.$emit('choicesCompleteProjectList');
}
});
@ -180,7 +180,7 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $stateParams,
url: defaultUrl,
field: 'status',
variable: 'project_status_options',
callback: 'choicesReadyProject'
callback: 'choicesReadyProjectList'
});
// Load the list of options for Kind
@ -189,7 +189,7 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $stateParams,
url: defaultUrl,
field: 'scm_type',
variable: 'project_scm_type_options',
callback: 'choicesReadyProject'
callback: 'choicesReadyProjectList'
});
$scope.showActivity = function () {

View File

@ -265,6 +265,11 @@ export function UsersEdit($scope, $rootScope, $compile, $location, $log,
if ($scope.removePostRefresh) {
$scope.removePostRefresh();
}
$scope.removePostRefresh = $scope.$on('PostRefresh', function () {
// Cleanup after a delete
Wait('stop');
$('#prompt-modal').modal('hide');
});
$scope.PermissionAddAllowed = false;

View File

@ -501,6 +501,9 @@ export default ['$location', '$compile', '$rootScope', 'SearchWidget', 'Paginate
innerTable += (field_action === 'delete') ? "List-actionButton--delete" : "";
innerTable += (field_action === 'cancel') ? "cancel red-txt" : "";
innerTable += "\" ";
// debugger;
// rowBeingEdited === '{{ " + list.iterator + ".id }}' && listBeingEdited === '" + list.name + "' ? 'List-tableRow--selected' : ''";
innerTable += (field_action === 'edit') ? "ng-class=\"[rowBeingEdited === '{{ " + list.iterator + ".id }}' && listBeingEdited === '" + list.name + "' ? 'List-editButton--selected' : '']\"" : "";
innerTable += (fAction.awPopOver) ? "aw-pop-over=\"" + fAction.awPopOver + "\" " : "";
innerTable += (fAction.dataPlacement) ? Attr(fAction, 'dataPlacement') : "";
innerTable += (fAction.dataTitle) ? Attr(fAction, 'dataTitle') : "";

View File

@ -10,10 +10,17 @@ export default ['$http', function($http) {
// get the name of the object
return $http.get(url + "?id=" + id)
.then(function (data) {
var name = data.data.results[0].name;
var queryValue, queryType;
if (data.data.results[0].type === "user") {
queryValue = data.data.results[0].username;
queryType = "username";
} else {
queryValue = data.data.results[0].name;
queryType = "name";
}
// get how many results are less than or equal to
// the name
return $http.get(url + "?name__lte=" + name)
return $http.get(url + "?" + queryType + "__lte=" + queryValue)
.then(function (data) {
// divide by the page size to get what
// page the data should be on