diff --git a/.changelog/14606.txt b/.changelog/14606.txt new file mode 100644 index 000000000..f4ad4612a --- /dev/null +++ b/.changelog/14606.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Removed Overview page from HCP instalations +``` diff --git a/ui/packages/consul-hcp/vendor/consul-hcp/routes.js b/ui/packages/consul-hcp/vendor/consul-hcp/routes.js index 1b58d87ef..01fd24712 100644 --- a/ui/packages/consul-hcp/vendor/consul-hcp/routes.js +++ b/ui/packages/consul-hcp/vendor/consul-hcp/routes.js @@ -1,8 +1,6 @@ (routes => routes({ dc: { - show: { - license: null, - }, + show: null }, }))( (json, data = (typeof document !== 'undefined' ? document.currentScript.dataset : module.exports)) => { diff --git a/ui/packages/consul-ui/app/abilities/overview.js b/ui/packages/consul-ui/app/abilities/overview.js index eba021772..8c4734ae7 100644 --- a/ui/packages/consul-ui/app/abilities/overview.js +++ b/ui/packages/consul-ui/app/abilities/overview.js @@ -1,9 +1,12 @@ import BaseAbility from './base'; +import { inject as service } from '@ember/service'; export default class OverviewAbility extends BaseAbility { + @service('env') env; + resource = 'operator'; segmented = false; get canAccess() { - return this.canRead; + return !this.env.var('CONSUL_HCP_ENABLED') && this.canRead; } } diff --git a/ui/packages/consul-ui/app/utils/get-environment.js b/ui/packages/consul-ui/app/utils/get-environment.js index f7ec678f0..86e051f21 100644 --- a/ui/packages/consul-ui/app/utils/get-environment.js +++ b/ui/packages/consul-ui/app/utils/get-environment.js @@ -128,6 +128,10 @@ export default function(config = {}, win = window, doc = document) { return typeof operatorConfig.PeeringEnabled === 'undefined' ? false : operatorConfig.PeeringEnabled; + case 'CONSUL_HCP_ENABLED': + return typeof operatorConfig.HCPEnabled === 'undefined' + ? false + : operatorConfig.HCPEnabled; case 'CONSUL_DATACENTER_LOCAL': return operatorConfig.LocalDatacenter; case 'CONSUL_DATACENTER_PRIMARY': @@ -226,6 +230,9 @@ export default function(config = {}, win = window, doc = document) { case 'CONSUL_PEERINGS_ENABLE': prev['CONSUL_PEERINGS_ENABLED'] = !!JSON.parse(String(value).toLowerCase()); break; + case 'CONSUL_HCP_ENABLE': + prev['CONSUL_HCP_ENABLED'] = !!JSON.parse(String(value).toLowerCase()); + break; case 'CONSUL_UI_CONFIG': prev['CONSUL_UI_CONFIG'] = JSON.parse(value); break; @@ -275,6 +282,7 @@ export default function(config = {}, win = window, doc = document) { case 'CONSUL_ACLS_ENABLED': case 'CONSUL_NSPACES_ENABLED': case 'CONSUL_PEERINGS_ENABLED': + case 'CONSUL_HCP_ENABLED': case 'CONSUL_SSO_ENABLED': case 'CONSUL_PARTITIONS_ENABLED': case 'CONSUL_METRICS_PROVIDER':