ui: allow searching services by admin-partition (#13650)
This commit is contained in:
parent
362670f98f
commit
303e7ff2e0
|
@ -2,4 +2,5 @@ export default {
|
|||
Name: item => item.Name,
|
||||
Tags: item => item.Tags || [],
|
||||
PeerName: item => item.PeerName,
|
||||
Partition: item => item.Partition,
|
||||
};
|
||||
|
|
|
@ -60,4 +60,39 @@ module('Unit | Search | Predicate | service', function() {
|
|||
).search('hit');
|
||||
assert.equal(actual.length, 0);
|
||||
});
|
||||
test('items can be found by Partition', function(assert) {
|
||||
const search = new ExactSearch(
|
||||
[
|
||||
{
|
||||
Name: 'name-a',
|
||||
Partition: 'default',
|
||||
},
|
||||
{
|
||||
Name: 'name-b',
|
||||
Partition: 'lorem-ipsum',
|
||||
},
|
||||
],
|
||||
{
|
||||
finders: predicates,
|
||||
}
|
||||
);
|
||||
|
||||
assert.deepEqual(
|
||||
search.search('').map(i => i.Name),
|
||||
['name-a', 'name-b'],
|
||||
'both items included in search'
|
||||
);
|
||||
|
||||
assert.deepEqual(
|
||||
search.search('def').map(i => i.Name),
|
||||
['name-a'],
|
||||
'only item from default partition is included'
|
||||
);
|
||||
|
||||
assert.deepEqual(
|
||||
search.search('tomster').map(i => i.Name),
|
||||
[],
|
||||
'no item included when no Partition matches'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -47,6 +47,7 @@ consul:
|
|||
readreplica: Read replica
|
||||
redundancyzone: Redundancy zone
|
||||
peername: Peer
|
||||
partition: Admin Partitions
|
||||
search:
|
||||
search: Search
|
||||
searchproperty: Search Across
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
kind: 'kind',
|
||||
searchproperty: {
|
||||
as: 'searchproperty',
|
||||
empty: [['Name', 'Tags', 'PeerName']],
|
||||
empty: [['Partition', 'Name', 'Tags', 'PeerName']],
|
||||
},
|
||||
search: {
|
||||
as: 'filter',
|
||||
|
|
Loading…
Reference in New Issue