diff --git a/.changelog/14604.txt b/.changelog/14604.txt new file mode 100644 index 0000000000..e35d479518 --- /dev/null +++ b/.changelog/14604.txt @@ -0,0 +1,3 @@ +```release-note:feature +ui: Added support for central config merging +``` diff --git a/ui/packages/consul-ui/app/adapters/proxy.js b/ui/packages/consul-ui/app/adapters/proxy.js index 42eec4eb23..3da99214a8 100644 --- a/ui/packages/consul-ui/app/adapters/proxy.js +++ b/ui/packages/consul-ui/app/adapters/proxy.js @@ -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} diff --git a/ui/packages/consul-ui/app/adapters/service-instance.js b/ui/packages/consul-ui/app/adapters/service-instance.js index 093d1f7912..6b5a3181a3 100644 --- a/ui/packages/consul-ui/app/adapters/service-instance.js +++ b/ui/packages/consul-ui/app/adapters/service-instance.js @@ -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} diff --git a/ui/packages/consul-ui/app/adapters/service.js b/ui/packages/consul-ui/app/adapters/service.js index ea69f0927e..30af669234 100644 --- a/ui/packages/consul-ui/app/adapters/service.js +++ b/ui/packages/consul-ui/app/adapters/service.js @@ -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, }} `; - } + } } diff --git a/ui/packages/consul-ui/tests/acceptance/dc/services/instances/navigation.feature b/ui/packages/consul-ui/tests/acceptance/dc/services/instances/navigation.feature index 6aa63c7bc4..9ea1aa1bfb 100644 --- a/ui/packages/consul-ui/tests/acceptance/dc/services/instances/navigation.feature +++ b/ui/packages/consul-ui/tests/acceptance/dc/services/instances/navigation.feature @@ -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 diff --git a/ui/packages/consul-ui/tests/integration/adapters/service-instance-test.js b/ui/packages/consul-ui/tests/integration/adapters/service-instance-test.js index 5a9a9caa72..3e48573ecf 100644 --- a/ui/packages/consul-ui/tests/integration/adapters/service-instance-test.js +++ b/ui/packages/consul-ui/tests/integration/adapters/service-instance-test.js @@ -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, { diff --git a/ui/packages/consul-ui/tests/integration/adapters/service-test.js b/ui/packages/consul-ui/tests/integration/adapters/service-test.js index 559f67f4de..e32893e833 100644 --- a/ui/packages/consul-ui/tests/integration/adapters/service-test.js +++ b/ui/packages/consul-ui/tests/integration/adapters/service-test.js @@ -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, {