From 6708e88ec90c166b1063f21d17fe930719bbe985 Mon Sep 17 00:00:00 2001 From: Valeriia Ruban Date: Fri, 9 Feb 2024 09:42:25 -0800 Subject: [PATCH] chor: remove temporary CONSUL_HCP_LINK_ENABLED env flag (#20552) --- .../consul-ui/app/services/hcp-link-status.js | 4 +--- .../tests/acceptance/link-to-hcp-test.js | 22 ------------------- .../components/link-to-hcp-banner-test.js | 8 ------- 3 files changed, 1 insertion(+), 33 deletions(-) diff --git a/ui/packages/consul-ui/app/services/hcp-link-status.js b/ui/packages/consul-ui/app/services/hcp-link-status.js index 47b5de0ec0..eab9764585 100644 --- a/ui/packages/consul-ui/app/services/hcp-link-status.js +++ b/ui/packages/consul-ui/app/services/hcp-link-status.js @@ -9,14 +9,12 @@ import { tracked } from '@glimmer/tracking'; const LOCAL_STORAGE_KEY = 'consul:hideHcpLinkBanner'; export default class HcpLinkStatus extends Service { - @service('env') env; @service abilities; @tracked userDismissedBanner = false; get shouldDisplayBanner() { - const hcpLinkEnabled = this.env.var('CONSUL_HCP_LINK_ENABLED'); - return !this.userDismissedBanner && this.hasPermissionToLink && hcpLinkEnabled; + return !this.userDismissedBanner && this.hasPermissionToLink; } get hasPermissionToLink() { diff --git a/ui/packages/consul-ui/tests/acceptance/link-to-hcp-test.js b/ui/packages/consul-ui/tests/acceptance/link-to-hcp-test.js index 3d43490d00..3253304610 100644 --- a/ui/packages/consul-ui/tests/acceptance/link-to-hcp-test.js +++ b/ui/packages/consul-ui/tests/acceptance/link-to-hcp-test.js @@ -6,7 +6,6 @@ import { module, test } from 'qunit'; import { click, visit } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; -import { EnvStub } from 'consul-ui/services/env'; const bannerSelector = '[data-test-link-to-hcp-banner]'; const linkToHcpSelector = '[data-test-link-to-hcp]'; @@ -16,14 +15,6 @@ module('Acceptance | link to hcp', function (hooks) { hooks.beforeEach(function () { // clear local storage so we don't have any settings window.localStorage.clear(); - this.owner.register( - 'service:env', - class Stub extends EnvStub { - stubEnv = { - CONSUL_HCP_LINK_ENABLED: true, - }; - } - ); }); test('the banner and nav item are initially displayed on services page', async function (assert) { @@ -44,17 +35,4 @@ module('Acceptance | link to hcp', function (hooks) { // link to HCP nav item still there assert.dom(linkToHcpSelector).isVisible('Link to HCP nav item is visible by default'); }); - - test('the banner is not displayed if the env var is not set', async function (assert) { - this.owner.register( - 'service:env', - class Stub extends EnvStub { - stubEnv = {}; - } - ); - // default route is services page so we're good here - await visit('/'); - // Expect the banner to be visible by default - assert.dom(bannerSelector).doesNotExist('Banner is not here'); - }); }); diff --git a/ui/packages/consul-ui/tests/integration/components/link-to-hcp-banner-test.js b/ui/packages/consul-ui/tests/integration/components/link-to-hcp-banner-test.js index e3be9d5309..ac375fb451 100644 --- a/ui/packages/consul-ui/tests/integration/components/link-to-hcp-banner-test.js +++ b/ui/packages/consul-ui/tests/integration/components/link-to-hcp-banner-test.js @@ -27,14 +27,6 @@ module('Integration | Component | link-to-hcp-banner', function (hooks) { hooks.beforeEach(function () { this.owner.register('service:hcp-link-status', HcpLinkStatusStub); - this.owner.register( - 'service:env', - class Stub extends EnvStub { - stubEnv = { - CONSUL_HCP_LINK_ENABLED: true, - }; - } - ); }); test('it renders banner when hcp-link-status says it should', async function (assert) {