ui: Add merge-central-config to relevant HTTP requests (#14604)

This commit is contained in:
John Cowen 2022-09-20 10:33:19 +01:00 committed by GitHub
parent 1d7c82c017
commit 8b0c09d15c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 10 deletions

3
.changelog/14604.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:feature
ui: Added support for central config merging
```

View File

@ -6,7 +6,7 @@ export default class ProxyAdapter extends Adapter {
throw new Error('You must specify an id');
}
return request`
GET /v1/catalog/connect/${id}?${{ dc }}
GET /v1/catalog/connect/${id}?${{ dc, ['merge-central-config']: null }}
X-Request-ID: ${uri}
X-Range: ${id}

View File

@ -21,7 +21,7 @@ export default class ServiceInstanceAdapter extends Adapter {
}
return request`
GET /v1/health/service/${id}?${{ dc }}
GET /v1/health/service/${id}?${{ dc, ['merge-central-config']: null }}
X-Request-ID: ${uri}
X-Range: ${id}

View File

@ -33,7 +33,7 @@ export default class ServiceAdapter extends Adapter {
throw new Error('You must specify an id');
}
return request`
GET /v1/health/service/${id}?${{ dc }}
GET /v1/health/service/${id}?${{ dc, ['merge-central-config']: null }}
X-Request-ID: ${uri}
${{
@ -42,5 +42,5 @@ export default class ServiceAdapter extends Adapter {
index,
}}
`;
}
}
}

View File

@ -46,13 +46,13 @@ Feature: dc / services / instances / navigation
Then the url should be /dc-1/services/service-0/instances
Then I see 3 instance models
When I click instance on the instances component
Then a GET request was made to "/v1/catalog/connect/service-0?dc=dc-1&ns=@namespace"
Then a GET request was made to "/v1/health/service/service-0-proxy?dc=dc-1&ns=@namespace"
Then a GET request was made to "/v1/catalog/connect/service-0?dc=dc-1&merge-central-config&ns=@namespace"
Then a GET request was made to "/v1/health/service/service-0-proxy?dc=dc-1&merge-central-config&ns=@namespace"
Then the url should be /dc-1/services/service-0/instances/node-0/service-a/health-checks
And I click "[data-test-back]"
Then the url should be /dc-1/services/service-0/topology
And I click instances on the tabs
When I click instance on the instances component
Then a GET request was made to "/v1/catalog/connect/service-0?dc=dc-1&ns=@namespace"
Then a GET request was made to "/v1/health/service/service-0-proxy?dc=dc-1&ns=@namespace"
Then a GET request was made to "/v1/catalog/connect/service-0?dc=dc-1&merge-central-config&ns=@namespace"
Then a GET request was made to "/v1/health/service/service-0-proxy?dc=dc-1&merge-central-config&ns=@namespace"
Then the url should be /dc-1/services/service-0/instances/node-0/service-a/health-checks

View File

@ -14,7 +14,7 @@ module('Integration | Adapter | service-instance', function (hooks) {
const adapter = this.owner.lookup('adapter:service-instance');
const client = this.owner.lookup('service:client/http');
const request = client.requestParams.bind(client);
const expected = `GET /v1/health/service/${id}?dc=${dc}${
const expected = `GET /v1/health/service/${id}?dc=${dc}&merge-central-config${
shouldHaveNspace(nspace) ? `&ns=${nspace}` : ``
}`;
let actual = adapter.requestForQueryRecord(request, {

View File

@ -42,7 +42,7 @@ module('Integration | Adapter | service', function (hooks) {
const adapter = this.owner.lookup('adapter:service');
const client = this.owner.lookup('service:client/http');
const request = client.requestParams.bind(client);
const expected = `GET /v1/health/service/${id}?dc=${dc}${
const expected = `GET /v1/health/service/${id}?dc=${dc}&merge-central-config${
shouldHaveNspace(nspace) ? `&ns=${nspace}` : ``
}`;
let actual = adapter.requestForQueryRecord(request, {