mirror of https://github.com/status-im/consul.git
ui: allow searching services by admin-partition (#13650)
This commit is contained in:
parent
ef21100435
commit
65b0faf96b
|
@ -2,4 +2,5 @@ export default {
|
||||||
Name: item => item.Name,
|
Name: item => item.Name,
|
||||||
Tags: item => item.Tags || [],
|
Tags: item => item.Tags || [],
|
||||||
PeerName: item => item.PeerName,
|
PeerName: item => item.PeerName,
|
||||||
|
Partition: item => item.Partition,
|
||||||
};
|
};
|
||||||
|
|
|
@ -60,4 +60,39 @@ module('Unit | Search | Predicate | service', function() {
|
||||||
).search('hit');
|
).search('hit');
|
||||||
assert.equal(actual.length, 0);
|
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
|
readreplica: Read replica
|
||||||
redundancyzone: Redundancy zone
|
redundancyzone: Redundancy zone
|
||||||
peername: Peer
|
peername: Peer
|
||||||
|
partition: Admin Partitions
|
||||||
search:
|
search:
|
||||||
search: Search
|
search: Search
|
||||||
searchproperty: Search Across
|
searchproperty: Search Across
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
kind: 'kind',
|
kind: 'kind',
|
||||||
searchproperty: {
|
searchproperty: {
|
||||||
as: 'searchproperty',
|
as: 'searchproperty',
|
||||||
empty: [['Name', 'Tags', 'PeerName']],
|
empty: [['Partition', 'Name', 'Tags', 'PeerName']],
|
||||||
},
|
},
|
||||||
search: {
|
search: {
|
||||||
as: 'filter',
|
as: 'filter',
|
||||||
|
|
Loading…
Reference in New Issue