mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 14:27:42 -02:30
Changes the encodeQuerysetObject function for the job details search widget
With this change, the stdout search will perform a search like search=A,B instead of search=A&search=B
This commit is contained in:
@@ -92,6 +92,7 @@ function resolveResource (
|
|||||||
|
|
||||||
if (job_event_search) { // eslint-disable-line camelcase
|
if (job_event_search) { // eslint-disable-line camelcase
|
||||||
const query = qs.encodeQuerysetObject(qs.decodeArr(job_event_search));
|
const query = qs.encodeQuerysetObject(qs.decodeArr(job_event_search));
|
||||||
|
|
||||||
Object.assign(config.params, query);
|
Object.assign(config.params, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,16 +80,15 @@ function QuerysetService ($q, Rest, ProcessErrors, $rootScope, Wait, DjangoSearc
|
|||||||
},
|
},
|
||||||
// like encodeQueryset, but return an actual unstringified API-consumable http param object
|
// like encodeQueryset, but return an actual unstringified API-consumable http param object
|
||||||
encodeQuerysetObject(params) {
|
encodeQuerysetObject(params) {
|
||||||
console.log(params);
|
|
||||||
return _.reduce(params, (obj, value, key) => {
|
return _.reduce(params, (obj, value, key) => {
|
||||||
const encodedTerms = this.encodeTerms(value, key);
|
const encodedKey = this.replaceDefaultFlags(key);
|
||||||
console.log(encodedTerms);
|
const values = Array.isArray(value) ? value : [value];
|
||||||
for (let encodedIndex in encodedTerms) {
|
|
||||||
const [encodedKey, encodedValue] = encodedTerms[encodedIndex];
|
obj[encodedKey] = values
|
||||||
obj[encodedKey] = obj[encodedKey] || [];
|
.map(value => this.replaceDefaultFlags(value))
|
||||||
obj[encodedKey].push(encodedValue);
|
.map(value => this.replaceEncodedTokens(value))
|
||||||
}
|
.join(',');
|
||||||
console.log(obj);
|
|
||||||
return obj;
|
return obj;
|
||||||
}, {});
|
}, {});
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user