mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 15:21:13 +03:00
fix blank search filters on /#/portal & extend search/filter module to accept config line searchSize
. Resolves #1527
This commit is contained in:
parent
6150addc2e
commit
83e976037c
@ -11,15 +11,13 @@ export default
|
|||||||
|
|
||||||
name: 'job_templates',
|
name: 'job_templates',
|
||||||
iterator: 'job_template',
|
iterator: 'job_template',
|
||||||
// selectTitle: 'Add Job Template',
|
|
||||||
editTitle: 'Job Templates',
|
editTitle: 'Job Templates',
|
||||||
listTitle: 'Job Templates',
|
listTitle: 'Job Templates',
|
||||||
// selectInstructions: "Click on a row to select it, and click Finished when done. Use the <i class=\"icon-plus\"></i> " +
|
|
||||||
// "button to create a new job template.",
|
|
||||||
index: false,
|
index: false,
|
||||||
hover: true,
|
hover: true,
|
||||||
well: true,
|
well: true,
|
||||||
|
searchSize: 'col-lg-8 col-md-8 col-sm-12 col-xs-12',
|
||||||
|
|
||||||
fields: {
|
fields: {
|
||||||
name: {
|
name: {
|
||||||
key: true,
|
key: true,
|
||||||
|
@ -16,6 +16,7 @@ export default
|
|||||||
hover: true,
|
hover: true,
|
||||||
well: true,
|
well: true,
|
||||||
listTitle: 'Jobs',
|
listTitle: 'Jobs',
|
||||||
|
searchSize: 'col-lg-8 col-md-8 col-sm-12 col-xs-12',
|
||||||
|
|
||||||
fields: {
|
fields: {
|
||||||
status: {
|
status: {
|
||||||
@ -27,23 +28,9 @@ export default
|
|||||||
searchable: true,
|
searchable: true,
|
||||||
nosort: true,
|
nosort: true,
|
||||||
searchType: 'select',
|
searchType: 'select',
|
||||||
searchOptions: [
|
searchOptions: [],
|
||||||
{ name: "Success", value: "successful" },
|
searchLabel: 'Status'
|
||||||
{ name: "Error", value: "error" },
|
|
||||||
{ name: "Failed", value: "failed" },
|
|
||||||
{ name: "Canceled", value: "canceled" }
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
/*
|
|
||||||
id: {
|
|
||||||
label: 'ID',
|
|
||||||
key: true,
|
|
||||||
noLink: true, //undocumented: 'key' above will automatically made the fields a link, but 'noLink' will override this setting
|
|
||||||
desc: true,
|
|
||||||
searchType: 'int',
|
|
||||||
columnClass: 'col-xs-2 List-staticColumnAdjacent',
|
|
||||||
},
|
|
||||||
*/
|
|
||||||
name: {
|
name: {
|
||||||
key: true,
|
key: true,
|
||||||
label: 'Name',
|
label: 'Name',
|
||||||
|
@ -21,7 +21,6 @@ export function PortalModeJobsController($scope, $state, $rootScope, GetBasePath
|
|||||||
id: 'portal-jobs',
|
id: 'portal-jobs',
|
||||||
mode: 'edit',
|
mode: 'edit',
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
searchSize: 'col-md-10 col-xs-12'
|
|
||||||
});
|
});
|
||||||
|
|
||||||
SearchInit({
|
SearchInit({
|
||||||
@ -54,6 +53,7 @@ export function PortalModeJobsController($scope, $state, $rootScope, GetBasePath
|
|||||||
};
|
};
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
console.log($scope)
|
||||||
}
|
}
|
||||||
|
|
||||||
PortalModeJobsController.$inject = ['$scope', '$state', '$rootScope', 'GetBasePath', 'generateList', 'PortalJobsList', 'SearchInit',
|
PortalModeJobsController.$inject = ['$scope', '$state', '$rootScope', 'GetBasePath', 'generateList', 'PortalJobsList', 'SearchInit',
|
||||||
|
@ -2,7 +2,8 @@ export default ['$scope', 'Refresh', 'tagSearchService',
|
|||||||
function($scope, Refresh, tagSearchService) {
|
function($scope, Refresh, tagSearchService) {
|
||||||
// JSONify passed field elements that can be searched
|
// JSONify passed field elements that can be searched
|
||||||
$scope.list = JSON.parse($scope.list);
|
$scope.list = JSON.parse($scope.list);
|
||||||
|
// Access config lines from list spec
|
||||||
|
$scope.listConfig = $scope.$parent.list;
|
||||||
// Grab options for the left-dropdown of the searchbar
|
// Grab options for the left-dropdown of the searchbar
|
||||||
tagSearchService.getSearchTypes($scope.list, $scope.endpoint)
|
tagSearchService.getSearchTypes($scope.list, $scope.endpoint)
|
||||||
.then(function(searchTypes) {
|
.then(function(searchTypes) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<div class="TagSearch row">
|
<div class="TagSearch row">
|
||||||
<div class="col-lg-4 col-md-8 col-sm-12 col-xs-12">
|
<div ng-class="listConfig.searchSize || 'col-lg-4 col-md-8 col-sm-12 col-xs-12'">
|
||||||
<div class="TagSearch-bar">
|
<div class="TagSearch-bar">
|
||||||
<div class="TagSearch-typeDropdown"
|
<div class="TagSearch-typeDropdown"
|
||||||
ng-click="toggleTypeDropdown()"
|
ng-click="toggleTypeDropdown()"
|
||||||
|
Loading…
Reference in New Issue
Block a user