chor: remove temporary CONSUL_HCP_LINK_ENABLED env flag (#20552)

This commit is contained in:
Valeriia Ruban 2024-02-09 09:42:25 -08:00 committed by GitHub
parent 24e15cc24e
commit 6708e88ec9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 1 additions and 33 deletions

View File

@ -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() {

View File

@ -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');
});
});

View File

@ -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) {