mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
Merge pull request #3182 from jlmitch5/fixSearchDefaults
fix search defaults for lists
This commit is contained in:
commit
ea024c7e11
@ -48,6 +48,7 @@ export default
|
||||
columnClass: 'col-lg-2 col-md-3 col-sm-4 col-xs-6',
|
||||
ngClick: "viewJobDetails(all_job)",
|
||||
defaultSearchField: true,
|
||||
searchDefault: true,
|
||||
},
|
||||
type: {
|
||||
label: 'Type',
|
||||
|
||||
@ -22,7 +22,8 @@ export default
|
||||
key: true,
|
||||
label: 'Name',
|
||||
columnClass: 'col-lg-5 col-md-5 col-sm-9 col-xs-8',
|
||||
linkTo: '/#/job_templates/{{job_template.id}}'
|
||||
linkTo: '/#/job_templates/{{job_template.id}}',
|
||||
searchDefault: true
|
||||
},
|
||||
description: {
|
||||
label: 'Description',
|
||||
|
||||
@ -35,7 +35,8 @@ export default
|
||||
label: 'Name',
|
||||
columnClass: 'col-lg-4 col-md-4 col-sm-4 col-xs-6 List-staticColumnAdjacent',
|
||||
defaultSearchField: true,
|
||||
linkTo: '/#/jobs/{{job.id}}'
|
||||
linkTo: '/#/jobs/{{job.id}}',
|
||||
searchDefault: true
|
||||
},
|
||||
finished: {
|
||||
label: 'Finished',
|
||||
|
||||
@ -37,6 +37,7 @@ export default
|
||||
},
|
||||
name: {
|
||||
key: true,
|
||||
searchDefault: true,
|
||||
label: 'Name',
|
||||
columnClass: "col-lg-4 col-md-4 col-sm-5 col-xs-7 List-staticColumnAdjacent",
|
||||
modalColumnClass: 'col-md-8'
|
||||
|
||||
@ -34,6 +34,10 @@ export default ['Rest', '$q', 'GetBasePath', 'Wait', 'ProcessErrors', '$log', fu
|
||||
type = 'text';
|
||||
}
|
||||
|
||||
if (field.searchDefault) {
|
||||
obj.default = true;
|
||||
}
|
||||
|
||||
obj.id = id;
|
||||
obj.value = value;
|
||||
obj.label = label;
|
||||
@ -76,10 +80,13 @@ export default ['Rest', '$q', 'GetBasePath', 'Wait', 'ProcessErrors', '$log', fu
|
||||
passThrough = partitionedOptions[1];
|
||||
|
||||
var joinOptions = function() {
|
||||
return _.sortBy(_
|
||||
var options = _.sortBy(_
|
||||
.flatten([needsRequest, passThrough]), function(opt) {
|
||||
return opt.id;
|
||||
});
|
||||
|
||||
// put default first
|
||||
return _.flatten(_.partition(options, opt => opt.default));
|
||||
};
|
||||
|
||||
if (needsRequest.length) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user