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