From 8161da105486f5ada72d2d267f3688c876f794c4 Mon Sep 17 00:00:00 2001 From: Germain Date: Wed, 1 Feb 2023 09:50:15 +0000 Subject: [PATCH] Remove threads beta feedback button (#10038) --- src/components/structures/ThreadPanel.tsx | 45 +------------------ src/i18n/strings/en_EN.json | 2 - .../structures/ThreadPanel-test.tsx | 41 +---------------- 3 files changed, 3 insertions(+), 85 deletions(-) diff --git a/src/components/structures/ThreadPanel.tsx b/src/components/structures/ThreadPanel.tsx index 57bb7cdaf0..ef97bd71c8 100644 --- a/src/components/structures/ThreadPanel.tsx +++ b/src/components/structures/ThreadPanel.tsx @@ -1,5 +1,5 @@ /* -Copyright 2021 - 2022 The Matrix.org Foundation C.I.C. +Copyright 2021 - 2023 The Matrix.org Foundation C.I.C. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -32,16 +32,9 @@ import { Layout } from "../../settings/enums/Layout"; import { RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; import Measured from "../views/elements/Measured"; import PosthogTrackers from "../../PosthogTrackers"; -import AccessibleButton, { ButtonEvent } from "../views/elements/AccessibleButton"; -import { BetaPill } from "../views/beta/BetaCard"; -import Modal from "../../Modal"; -import BetaFeedbackDialog from "../views/dialogs/BetaFeedbackDialog"; -import { Action } from "../../dispatcher/actions"; -import { UserTab } from "../views/dialogs/UserTab"; -import dis from "../../dispatcher/dispatcher"; +import { ButtonEvent } from "../views/elements/AccessibleButton"; import Spinner from "../views/elements/Spinner"; import Heading from "../views/typography/Heading"; -import { shouldShowFeedback } from "../../utils/Feedback"; interface IProps { roomId: string; @@ -231,14 +224,6 @@ const ThreadPanel: React.FC = ({ roomId, onClose, permalinkCreator }) => } }, [timelineSet, timelinePanel]); - const openFeedback = shouldShowFeedback() - ? () => { - Modal.createDialog(BetaFeedbackDialog, { - featureId: "feature_threadenabled", - }); - } - : null; - return ( = ({ roomId, onClose, permalinkCreator }) => empty={!hasThreads} /> } - footer={ - <> - { - dis.dispatch({ - action: Action.ViewUserSettings, - initialTabId: UserTab.Labs, - }); - }} - /> - {openFeedback && - _t( - "Give feedback", - {}, - { - a: (sub) => ( - - {sub} - - ), - }, - )} - - } className="mx_ThreadPanel" onClose={onClose} withoutScrollContainer={true} diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 908eae0535..168d371905 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -3449,8 +3449,6 @@ "Threads help keep your conversations on-topic and easy to track.": "Threads help keep your conversations on-topic and easy to track.", "Tip: Use ā€œ%(replyInThread)sā€ when hovering over a message.": "Tip: Use ā€œ%(replyInThread)sā€ when hovering over a message.", "Keep discussions organised with threads": "Keep discussions organised with threads", - "Threads are a beta feature": "Threads are a beta feature", - "Give feedback": "Give feedback", "Thread": "Thread", "Tried to load a specific point in this room's timeline, but you do not have permission to view the message in question.": "Tried to load a specific point in this room's timeline, but you do not have permission to view the message in question.", "Tried to load a specific point in this room's timeline, but was unable to find it.": "Tried to load a specific point in this room's timeline, but was unable to find it.", diff --git a/test/components/structures/ThreadPanel-test.tsx b/test/components/structures/ThreadPanel-test.tsx index 20c6cf0397..1225490bd7 100644 --- a/test/components/structures/ThreadPanel-test.tsx +++ b/test/components/structures/ThreadPanel-test.tsx @@ -26,53 +26,14 @@ import MatrixClientContext from "../../../src/contexts/MatrixClientContext"; import RoomContext from "../../../src/contexts/RoomContext"; import { _t } from "../../../src/languageHandler"; import { MatrixClientPeg } from "../../../src/MatrixClientPeg"; -import { shouldShowFeedback } from "../../../src/utils/Feedback"; import { RoomPermalinkCreator } from "../../../src/utils/permalinks/Permalinks"; import ResizeNotifier from "../../../src/utils/ResizeNotifier"; -import { createTestClient, getRoomContext, mkStubRoom, mockPlatformPeg, stubClient } from "../../test-utils"; +import { getRoomContext, mockPlatformPeg, stubClient } from "../../test-utils"; import { mkThread } from "../../test-utils/threads"; jest.mock("../../../src/utils/Feedback"); describe("ThreadPanel", () => { - describe("Feedback prompt", () => { - const cli = createTestClient(); - const room = mkStubRoom("!room:server", "room", cli); - mocked(cli.getRoom).mockReturnValue(room); - - it("should show feedback prompt if feedback is enabled", () => { - mocked(shouldShowFeedback).mockReturnValue(true); - - render( - - - , - ); - expect(screen.queryByText("Give feedback")).toBeTruthy(); - }); - - it("should hide feedback prompt if feedback is disabled", () => { - mocked(shouldShowFeedback).mockReturnValue(false); - - render( - - - , - ); - expect(screen.queryByText("Give feedback")).toBeFalsy(); - }); - }); - describe("Header", () => { it("expect that All filter for ThreadPanelHeader properly renders Show: All threads", () => { const { asFragment } = render(