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