mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 15:09:32 -02:30
fixes to tag search ui implementation
This commit is contained in:
@@ -79,6 +79,7 @@ export default
|
||||
|
||||
related: {
|
||||
scan_job_templates: {
|
||||
basePath: 'inventories/:id/scan_job_templates',
|
||||
type: 'collection',
|
||||
title: 'Scan Job Templates',
|
||||
iterator: 'scan_job_template',
|
||||
|
||||
@@ -73,7 +73,7 @@ export default
|
||||
},
|
||||
last_update_failed: {
|
||||
label: 'Update failed?',
|
||||
searchType: 'select',
|
||||
searchType: 'boolean',
|
||||
searchSingleValue: true,
|
||||
searchValue: 'failed',
|
||||
searchOnly: true,
|
||||
|
||||
@@ -9,6 +9,7 @@ export default ['GetBasePath', function(GetBasePath) {
|
||||
.searchable !== false);
|
||||
}).map(function(i) {
|
||||
delete f[i].awToolTip;
|
||||
delete f[i].ngClass;
|
||||
return {[i]: f[i]};
|
||||
}).reduce(function (acc, i) {
|
||||
var key = Object.keys(i);
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
<div class="TagSearch-bar">
|
||||
<div class="TagSearch-typeDropdown"
|
||||
ng-click="toggleTypeDropdown()"
|
||||
ng-class="{'is-open': showTypeDropdown}">
|
||||
<span class="TagSearch-typeDropdownName">
|
||||
{{ currentSearchType.label || "Foo bar"}}
|
||||
ng-class="{'is-open': showTypeDropdown}"
|
||||
ng-cloak>
|
||||
<span class="TagSearch-typeDropdownName" ng-cloak>
|
||||
{{ currentSearchType.label }}
|
||||
</span>
|
||||
<i class="TagSearch-selectDownIcon fa fa-angle-down"></i>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export default ['Rest', '$q', 'GetBasePath', function(Rest, $q, GetBasePath) {
|
||||
export default ['Rest', '$q', 'GetBasePath', 'Wait', 'ProcessErrors', function(Rest, $q, GetBasePath, Wait, ProcessErrors) {
|
||||
var that = this;
|
||||
// parse the field config object to return
|
||||
// one of the searchTypes (for the left dropdown)
|
||||
@@ -18,7 +18,7 @@ export default ['Rest', '$q', 'GetBasePath', function(Rest, $q, GetBasePath) {
|
||||
var type, typeOptions;
|
||||
if (field.searchType === 'select') {
|
||||
type = 'select';
|
||||
typeOptions = [];
|
||||
typeOptions = field.searchOptions || [];
|
||||
} else if (field.searchType === 'boolean') {
|
||||
type = 'select';
|
||||
typeOptions = [{label: "Yes", value: true},
|
||||
@@ -49,6 +49,7 @@ export default ['Rest', '$q', 'GetBasePath', function(Rest, $q, GetBasePath) {
|
||||
// given the fields that are searchable,
|
||||
// return searchTypes in the format the view can use
|
||||
this.getSearchTypes = function(list, basePath) {
|
||||
Wait("start");
|
||||
var defer = $q.defer();
|
||||
|
||||
var options = Object
|
||||
@@ -95,11 +96,17 @@ export default ['Rest', '$q', 'GetBasePath', function(Rest, $q, GetBasePath) {
|
||||
});
|
||||
|
||||
return option;
|
||||
})
|
||||
.error(function (data, status) {
|
||||
ProcessErrors(null, data, status, null, {
|
||||
hdr: 'Error!',
|
||||
msg: 'Getting type options failed'});
|
||||
});
|
||||
|
||||
Wait("stop");
|
||||
defer.resolve(joinOptions());
|
||||
});
|
||||
} else {
|
||||
Wait("stop");
|
||||
defer.resolve(joinOptions());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user