Skip to content

Commit

Permalink
ui: Add and use ProxyFor to get the connected with proxy boolean (#…
Browse files Browse the repository at this point in the history
…7820)

* Add and use ProxyFor to get the `connected with proxy` boolean

* Fix up page-navigation test

* Upgrade to @hashicorp/consul-api-double@2.14.7
  • Loading branch information
kaxcode authored and John Cowen committed May 12, 2020
1 parent c4c06c2 commit e2ef864
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
8 changes: 7 additions & 1 deletion ui-v2/app/controllers/dc/services/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ export default Controller.extend(WithEventSource, WithSearching, {
return item.Kind === 'connect-proxy';
})
.forEach(item => {
proxies[item.Name.replace('-proxy', '')] = true;
// Iterating to cover the usecase of a proxy being
// used by more than one service
if (item.ProxyFor) {
item.ProxyFor.forEach(service => {
proxies[service] = true;
});
}
});

return proxies;
Expand Down
1 change: 1 addition & 0 deletions ui-v2/app/models/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default Model.extend({
},
}),
InstanceCount: attr('number'),
ProxyFor: attr(),
Kind: attr('string'),
ExternalSources: attr(),
Meta: attr(),
Expand Down
2 changes: 1 addition & 1 deletion ui-v2/tests/acceptance/page-navigation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Feature: page-navigation
Where:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| Item | Model | URL | Endpoint | Back |
| service | services | /dc-1/services/service-0-terminating-gateway/instances | /v1/discovery-chain/service-0-terminating-gateway?dc=dc-1&ns=@namespace | /dc-1/services |
| service | services | /dc-1/services/service-0/instances | /v1/discovery-chain/service-0?dc=dc-1&ns=@namespace | /dc-1/services |
| node | nodes | /dc-1/nodes/node-0/health-checks | /v1/session/node/node-0?dc=dc-1&ns=@namespace | /dc-1/nodes |
| kv | kvs | /dc-1/kv/0-key-value/edit | /v1/session/info/ee52203d-989f-4f7a-ab5a-2bef004164ca?dc=dc-1&ns=@namespace | /dc-1/kv |
# | acl | acls | /dc-1/acls/anonymous | /v1/acl/info/anonymous?dc=dc-1 | /dc-1/acls |
Expand Down
6 changes: 3 additions & 3 deletions ui-v2/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1211,9 +1211,9 @@
js-yaml "^3.13.1"

"@hashicorp/consul-api-double@^2.6.2":
version "2.14.4"
resolved "https://registry.yarnpkg.com/@hashicorp/consul-api-double/-/consul-api-double-2.14.4.tgz#cc68c500f934d9ac76292797f845e78b9e3c4fcb"
integrity sha512-6GXHlSKr822CPuAz7jWBDZE4KAxKNSFt/2RA0Z7q6HAHu0O3NTd14vZweO30hS1yusyVEI9RLd9OvgMbv5WXhA==
version "2.14.7"
resolved "https://registry.yarnpkg.com/@hashicorp/consul-api-double/-/consul-api-double-2.14.7.tgz#80cd19461a3f3716bf76ba28bcabff842bcd9aef"
integrity sha512-QjpwvrraUswn/hFh+9lIKuA9keCGOkh1yr/cT3I6fDiw4JKLyDLaRN8bF/JNGtgoA/SsQh10L1YI3feZ7M3VKw==

"@hashicorp/ember-cli-api-double@^3.0.2":
version "3.0.2"
Expand Down

0 comments on commit e2ef864

Please sign in to comment.