mirror of
https://github.com/ansible/awx.git
synced 2026-01-23 15:38:06 -03: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:
parent
b191f6cfc3
commit
f6a960d8f4
@ -92,6 +92,7 @@ function resolveResource (
|
||||
|
||||
if (job_event_search) { // eslint-disable-line camelcase
|
||||
const query = qs.encodeQuerysetObject(qs.decodeArr(job_event_search));
|
||||
|
||||
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
|
||||
encodeQuerysetObject(params) {
|
||||
console.log(params);
|
||||
return _.reduce(params, (obj, value, key) => {
|
||||
const encodedTerms = this.encodeTerms(value, key);
|
||||
console.log(encodedTerms);
|
||||
for (let encodedIndex in encodedTerms) {
|
||||
const [encodedKey, encodedValue] = encodedTerms[encodedIndex];
|
||||
obj[encodedKey] = obj[encodedKey] || [];
|
||||
obj[encodedKey].push(encodedValue);
|
||||
}
|
||||
console.log(obj);
|
||||
const encodedKey = this.replaceDefaultFlags(key);
|
||||
const values = Array.isArray(value) ? value : [value];
|
||||
|
||||
obj[encodedKey] = values
|
||||
.map(value => this.replaceDefaultFlags(value))
|
||||
.map(value => this.replaceEncodedTokens(value))
|
||||
.join(',');
|
||||
|
||||
return obj;
|
||||
}, {});
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user