mirror of https://github.com/status-im/consul.git
ui: Change partitions to expect `[]` from the API (#11791)
This commit is contained in:
parent
0913644141
commit
4400d7c071
|
@ -0,0 +1,3 @@
|
||||||
|
```release-note:bugfix
|
||||||
|
ui: Change partitions to expect [] from the listing API
|
||||||
|
```
|
|
@ -11,7 +11,7 @@ export default class PartitionSerializer extends Serializer {
|
||||||
respond((headers, body) => {
|
respond((headers, body) => {
|
||||||
return cb(
|
return cb(
|
||||||
headers,
|
headers,
|
||||||
body.Partitions.map(item => {
|
body.map(item => {
|
||||||
item.Partition = '*';
|
item.Partition = '*';
|
||||||
item.Namespace = '*';
|
item.Namespace = '*';
|
||||||
return item;
|
return item;
|
||||||
|
|
|
@ -1,30 +1,28 @@
|
||||||
{
|
[
|
||||||
"Partitions": [
|
{
|
||||||
{
|
"Name": "default",
|
||||||
"Name": "default",
|
"Description": "Builtin Default Partition"
|
||||||
"Description": "Builtin Default Partition"
|
}
|
||||||
}
|
|
||||||
${range(
|
${range(
|
||||||
env(
|
env(
|
||||||
'CONSUL_PARTITION_COUNT',
|
'CONSUL_PARTITION_COUNT',
|
||||||
Math.floor(
|
Math.floor(
|
||||||
(
|
(
|
||||||
Math.random() * env('CONSUL_PARTITION_MAX', 10)
|
Math.random() * env('CONSUL_PARTITION_MAX', 10)
|
||||||
) + parseInt(env('CONSUL_PARTITION_MIN', 1))
|
) + parseInt(env('CONSUL_PARTITION_MIN', 1))
|
||||||
)
|
)
|
||||||
) - 1
|
) - 1
|
||||||
).map(i => `
|
).map(i => `
|
||||||
${i === 0 ? `
|
${i === 0 ? `
|
||||||
,
|
,
|
||||||
` : ``}
|
` : ``}
|
||||||
{
|
{
|
||||||
"Name": "${fake.hacker.noun()}-partition-${i}",
|
"Name": "${fake.hacker.noun()}-partition-${i}",
|
||||||
${fake.random.boolean() ? `
|
${fake.random.boolean() ? `
|
||||||
"Description": "${fake.lorem.sentence()}",
|
"Description": "${fake.lorem.sentence()}",
|
||||||
` : ``}
|
` : ``}
|
||||||
"CreateIndex": 12,
|
"CreateIndex": 12,
|
||||||
"ModifyIndex": 16
|
"ModifyIndex": 16
|
||||||
}
|
}
|
||||||
`)}
|
`)}
|
||||||
]
|
]
|
||||||
}
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ module('Integration | Serializer | partition', function(hooks) {
|
||||||
url: `/v1/partitions?dc=${dc}`,
|
url: `/v1/partitions?dc=${dc}`,
|
||||||
};
|
};
|
||||||
return get(request.url).then(function(payload) {
|
return get(request.url).then(function(payload) {
|
||||||
const expected = payload.Partitions.map(item =>
|
const expected = payload.map(item =>
|
||||||
Object.assign({}, item, {
|
Object.assign({}, item, {
|
||||||
Datacenter: dc,
|
Datacenter: dc,
|
||||||
Namespace: '*',
|
Namespace: '*',
|
||||||
|
|
Loading…
Reference in New Issue