From bbb4ee1c05e122dcfafaab90d53285bf4c1ecf07 Mon Sep 17 00:00:00 2001 From: Mirjam Aulbach Date: Thu, 17 Aug 2023 13:44:48 +0200 Subject: [PATCH] feat(coral): Remove feature flags for topic overview, edit and promote (#1636) * Remove feature flag for topic-overview Signed-off-by: Mirjam Aulbach * Remove feature flag for promote-topic. Signed-off-by: Mirjam Aulbach * Remove feature flag for edit-topic Signed-off-by: Mirjam Aulbach --------- Signed-off-by: Mirjam Aulbach --- .../browse/components/TopicTable.test.tsx | 46 ------------------- .../topics/browse/components/TopicTable.tsx | 13 ------ coral/src/app/router.tsx | 18 +++----- coral/src/services/feature-flags/types.ts | 3 -- coral/vite.config.ts | 9 ---- 5 files changed, 6 insertions(+), 83 deletions(-) diff --git a/coral/src/app/features/topics/browse/components/TopicTable.test.tsx b/coral/src/app/features/topics/browse/components/TopicTable.test.tsx index cb90a8b811..34b9248f3f 100644 --- a/coral/src/app/features/topics/browse/components/TopicTable.test.tsx +++ b/coral/src/app/features/topics/browse/components/TopicTable.test.tsx @@ -10,11 +10,6 @@ const mockedTopics = mockedTopicNames.map((name, index) => createMockTopic({ topicName: name, topicId: index }) ); -const isFeatureFlagActiveMock = jest.fn(); -jest.mock("src/services/feature-flags/utils", () => ({ - isFeatureFlagActive: () => isFeatureFlagActiveMock(), -})); - const tableRowHeader = ["Topic", "Environments", "Team"]; describe("TopicTable.tsx", () => { @@ -33,7 +28,6 @@ describe("TopicTable.tsx", () => { describe("shows all topics as a table", () => { beforeAll(() => { mockIntersectionObserver(); - isFeatureFlagActiveMock.mockResolvedValue(true); customRender( { }); }); - describe("renders link to angular app if feature-flag is not enabled", () => { - beforeAll(() => { - mockIntersectionObserver(); - isFeatureFlagActiveMock.mockReturnValue(false); - customRender( - , - { memoryRouter: true } - ); - }); - - afterAll(() => { - cleanup(); - jest.resetAllMocks(); - }); - - mockedTopics.forEach((topic) => { - it(`renders the topic name "${topic.topicName}" as a link to the detail view as row header`, () => { - const table = screen.getByRole("table", { - name: "Topics overview, page 1 of 10", - }); - const rowHeader = within(table).getByRole("cell", { - name: topic.topicName, - }); - const link = within(rowHeader).getByRole("link", { - name: topic.topicName, - }); - - expect(rowHeader).toBeVisible(); - expect(link).toBeVisible(); - expect(link).toHaveAttribute( - "href", - `http://localhost/topicOverview?topicname=${topic.topicName}` - ); - }); - }); - }); - describe("enables user to keyboard navigate from topic name to topic name", () => { beforeEach(() => { mockIntersectionObserver(); diff --git a/coral/src/app/features/topics/browse/components/TopicTable.tsx b/coral/src/app/features/topics/browse/components/TopicTable.tsx index 595d986a0f..d093802122 100644 --- a/coral/src/app/features/topics/browse/components/TopicTable.tsx +++ b/coral/src/app/features/topics/browse/components/TopicTable.tsx @@ -8,10 +8,7 @@ import { } from "@aivenio/aquarium"; import link from "@aivenio/aquarium/dist/src/icons/link"; import { Link } from "react-router-dom"; -import { createTopicOverviewLink } from "src/app/features/topics/browse/utils/create-topic-overview-link"; import { Topic } from "src/domain/topic"; -import useFeatureFlag from "src/services/feature-flags/hook/useFeatureFlag"; -import { FeatureFlag } from "src/services/feature-flags/types"; import { EnvironmentInfo } from "src/domain/environment/environment-types"; type TopicListProps = { @@ -29,22 +26,12 @@ interface TopicsTableRow { function TopicTable(props: TopicListProps) { const { topics, ariaLabel } = props; - const topicDetailsEnabled = useFeatureFlag( - FeatureFlag.FEATURE_FLAG_TOPIC_OVERVIEW - ); const columns: Array> = [ { type: "custom", headerName: "Topic", UNSAFE_render: ({ topicName, envId }: TopicsTableRow) => { - if (!topicDetailsEnabled) { - return ( - - {topicName} - - ); - } return ( {topicName} diff --git a/coral/src/app/router.tsx b/coral/src/app/router.tsx index 9f4d0c9181..d914054fab 100644 --- a/coral/src/app/router.tsx +++ b/coral/src/app/router.tsx @@ -63,11 +63,9 @@ const routes: Array = [ path: Routes.TOPICS, element: , }, - createRouteBehindFeatureFlag({ + { path: Routes.TOPIC_OVERVIEW, element: , - featureFlag: FeatureFlag.FEATURE_FLAG_TOPIC_OVERVIEW, - redirectRouteWithoutFeatureFlag: Routes.TOPICS, children: [ { path: TOPIC_OVERVIEW_TAB_ID_INTO_PATH[ @@ -113,7 +111,7 @@ const routes: Array = [ id: TopicOverviewTabEnum.SETTINGS, }, ], - }), + }, { path: Routes.CONNECTORS, element: , @@ -237,18 +235,14 @@ const routes: Array = [ path: Routes.TOPIC_SCHEMA_REQUEST, element: , }, - createRouteBehindFeatureFlag({ + { path: Routes.TOPIC_PROMOTION_REQUEST, element: , - featureFlag: FeatureFlag.FEATURE_FLAG_PROMOTE_TOPIC, - redirectRouteWithoutFeatureFlag: Routes.TOPICS, - }), - createRouteBehindFeatureFlag({ + }, + { path: Routes.TOPIC_EDIT_REQUEST, element: , - featureFlag: FeatureFlag.FEATURE_FLAG_EDIT_TOPIC, - redirectRouteWithoutFeatureFlag: Routes.TOPICS, - }), + }, createRouteBehindFeatureFlag({ path: Routes.CONNECTOR_EDIT_REQUEST, element: , diff --git a/coral/src/services/feature-flags/types.ts b/coral/src/services/feature-flags/types.ts index 111a6d38d2..fd827d607a 100644 --- a/coral/src/services/feature-flags/types.ts +++ b/coral/src/services/feature-flags/types.ts @@ -1,8 +1,5 @@ enum FeatureFlag { - FEATURE_FLAG_TOPIC_OVERVIEW = "FEATURE_FLAG_TOPIC_OVERVIEW", FEATURE_FLAG_CONNECTOR_OVERVIEW = "FEATURE_FLAG_CONNECTOR_OVERVIEW", - FEATURE_FLAG_PROMOTE_TOPIC = "FEATURE_FLAG_PROMOTE_TOPIC", - FEATURE_FLAG_EDIT_TOPIC = "FEATURE_FLAG_EDIT_TOPIC", FEATURE_FLAG_EDIT_CONNECTOR = "FEATURE_FLAG_EDIT_CONNECTOR", } diff --git a/coral/vite.config.ts b/coral/vite.config.ts index aee1cebb65..da177e210f 100644 --- a/coral/vite.config.ts +++ b/coral/vite.config.ts @@ -137,9 +137,6 @@ export default defineConfig(({ mode }) => { "process.env": { ROUTER_BASENAME: getRouterBasename(environment), API_BASE_URL: getApiBaseUrl(environment), - FEATURE_FLAG_TOPIC_OVERVIEW: ["development", "remote-api", "local-api"] - .includes(mode) - .toString(), FEATURE_FLAG_CONNECTOR_OVERVIEW: [ "development", "remote-api", @@ -147,12 +144,6 @@ export default defineConfig(({ mode }) => { ] .includes(mode) .toString(), - FEATURE_FLAG_PROMOTE_TOPIC: ["development", "remote-api", "local-api"] - .includes(mode) - .toString(), - FEATURE_FLAG_EDIT_TOPIC: ["development", "remote-api", "local-api"] - .includes(mode) - .toString(), FEATURE_FLAG_EDIT_CONNECTOR: ["development", "remote-api", "local-api"] .includes(mode) .toString(),