From 16c2ae82b377bcc839b9c5018d01abac89da2545 Mon Sep 17 00:00:00 2001 From: Jeff Daley Date: Thu, 7 Dec 2023 12:42:23 -0500 Subject: [PATCH] Remove `product_colors` flag (#485) --- web/app/components/doc/thumbnail.ts | 4 --- web/app/components/product/avatar.gts | 2 -- web/app/components/project/tile.hbs | 6 +--- web/app/components/project/tile.ts | 10 +----- web/app/services/flags.ts | 4 --- web/mirage/config.ts | 1 - .../components/doc/thumbnail-test.ts | 13 -------- .../components/product/avatar-test.ts | 32 ------------------- .../components/project/tile-test.ts | 11 ------- 9 files changed, 2 insertions(+), 81 deletions(-) diff --git a/web/app/components/doc/thumbnail.ts b/web/app/components/doc/thumbnail.ts index f63369249..d81e546bc 100644 --- a/web/app/components/doc/thumbnail.ts +++ b/web/app/components/doc/thumbnail.ts @@ -38,10 +38,6 @@ export default class DocThumbnailComponent extends Component {{#each @project.products as |product|}}
  • - {{#if this.productColorsAreEnabled}} - - {{else}} - {{product}} - {{/if}} +
  • {{/each}} diff --git a/web/app/components/project/tile.ts b/web/app/components/project/tile.ts index 87686d816..2cb76c0cd 100644 --- a/web/app/components/project/tile.ts +++ b/web/app/components/project/tile.ts @@ -1,6 +1,4 @@ -import { inject as service } from "@ember/service"; import Component from "@glimmer/component"; -import FlagsService from "hermes/services/flags"; import { HermesProject } from "hermes/types/project"; interface ProjectTileComponentSignature { @@ -10,13 +8,7 @@ interface ProjectTileComponentSignature { }; } -export default class ProjectTileComponent extends Component { - @service declare flags: FlagsService; - - protected get productColorsAreEnabled(): boolean { - return this.flags.productColors === true; - } -} +export default class ProjectTileComponent extends Component {} declare module "@glint/environment-ember-loose/registry" { export default interface Registry { diff --git a/web/app/services/flags.ts b/web/app/services/flags.ts index c8c67e93e..7e23dee29 100644 --- a/web/app/services/flags.ts +++ b/web/app/services/flags.ts @@ -7,8 +7,4 @@ export default class FlagsService extends Service { get projects() { return this.configSvc.config.feature_flags?.["projects"]; } - - get productColors() { - return this.configSvc.config.feature_flags?.["product_colors"]; - } } diff --git a/web/mirage/config.ts b/web/mirage/config.ts index c240d45fb..0c8129c38 100644 --- a/web/mirage/config.ts +++ b/web/mirage/config.ts @@ -422,7 +422,6 @@ export default function (mirageConfig) { algolia_internal_index_name: config.algolia.internalIndexName, feature_flags: { projects: true, - product_colors: true, }, google_doc_folders: "", short_link_base_url: TEST_SHORT_LINK_BASE_URL, diff --git a/web/tests/integration/components/doc/thumbnail-test.ts b/web/tests/integration/components/doc/thumbnail-test.ts index def03bd13..8fbdeb394 100644 --- a/web/tests/integration/components/doc/thumbnail-test.ts +++ b/web/tests/integration/components/doc/thumbnail-test.ts @@ -113,19 +113,6 @@ module("Integration | Component | doc/thumbnail", function (hooks) { .dom(PRODUCT_BADGE) .exists("badge is shown for a product with an icon"); - setFeatureFlag(this, "product_colors", false); - - // If product colors were enabled, this would render a badge - this.set("product", "Labs"); - - assert - .dom(PRODUCT_BADGE) - .doesNotExist( - "abbreviation not shown if the productColors flag is disabled", - ); - - setFeatureFlag(this, "product_colors", true); - // Config is not tracked by glimmer, so we force // a re-compute on the "badgeIsShown" getter this.set("product", undefined); diff --git a/web/tests/integration/components/product/avatar-test.ts b/web/tests/integration/components/product/avatar-test.ts index dafa3ecf2..66a4863f2 100644 --- a/web/tests/integration/components/product/avatar-test.ts +++ b/web/tests/integration/components/product/avatar-test.ts @@ -58,8 +58,6 @@ module("Integration | Component | product/avatar", function (hooks) { await setupProductIndex(this); - setFeatureFlag(this, "product_colors", true); - await render(hbs` `); @@ -71,8 +69,6 @@ module("Integration | Component | product/avatar", function (hooks) { }); test("it conditionally shows a product icon", async function (this: ProductAvatarTestContext, assert) { - setFeatureFlag(this, "product_colors", true); - this.server.create("product", { name: "Vault", }); @@ -97,21 +93,6 @@ module("Integration | Component | product/avatar", function (hooks) { assert .dom(ICON) .doesNotExist("it does not render an icon for non-icon products"); - - setFeatureFlag(this, "product_colors", false); - - // Config is not tracked by glimmer, so we force - // a re-compute on the "badgeIsShown" getter - this.set("product", undefined); - this.set("product", "Labs"); - - assert - .dom(ICON) - .hasAttribute( - "data-test-icon", - "folder", - "it renders a folder icon if productColors is disabled", - ); }); test("it conditionally renders a product abbreviation", async function (this: ProductAvatarTestContext, assert) { @@ -127,8 +108,6 @@ module("Integration | Component | product/avatar", function (hooks) { await setupProductIndex(this); - setFeatureFlag(this, "product_colors", true); - await render(hbs` `); @@ -142,15 +121,6 @@ module("Integration | Component | product/avatar", function (hooks) { this.set("product", "Labs"); assert.dom(ABBREVIATION).exists(); - - setFeatureFlag(this, "product_colors", false); - - // Config is not tracked by glimmer, so we force - // a re-compute on the "badgeIsShown" getter - this.set("product", undefined); - this.set("product", "Labs"); - - assert.dom(ABBREVIATION).doesNotExist(); }); test("it renders a fallback icon if the product has no ID nor abbreviation", async function (this: ProductAvatarTestContext, assert) { @@ -193,8 +163,6 @@ module("Integration | Component | product/avatar", function (hooks) { await setupProductIndex(this); - setFeatureFlag(this, "product_colors", true); - await render(hbs` `); diff --git a/web/tests/integration/components/project/tile-test.ts b/web/tests/integration/components/project/tile-test.ts index 892d7614a..3c336a17a 100644 --- a/web/tests/integration/components/project/tile-test.ts +++ b/web/tests/integration/components/project/tile-test.ts @@ -117,17 +117,6 @@ module("Integration | Component | project/tile", function (hooks) { assert.dom(PRODUCT_AVATAR).exists({ count: 2 }); }); - test("it renders products in text if the productColors flag is disabled", async function (this: ProjectTileComponentTestContext, assert) { - setFeatureFlag(this, "product_colors", false); - - await render(hbs` - - `); - - assert.dom(PRODUCT).exists({ count: 1 }); - assert.dom(PRODUCT_AVATAR).doesNotExist(); - }); - test('if the status of a jiraIssue is "Done," the key is rendered with a line through it', async function (this: ProjectTileComponentTestContext, assert) { await render(hbs`