Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 2344eaa

Browse files
author
Kerry
authored
Poll history - remove active development labs flag (#10357)
* add poll history tab to room settings * test poll history in room settings * remove posthog tracking for poll his * remove labs flag for poll history * i18n
1 parent 31a959e commit 2344eaa

File tree

9 files changed

+33
-32
lines changed

9 files changed

+33
-32
lines changed

cypress/e2e/polls/pollHistory.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ describe("Poll history", () => {
8888
cy.startHomeserver("default").then((data) => {
8989
homeserver = data;
9090

91-
cy.enableLabsFeature("feature_poll_history");
92-
9391
cy.initTestUser(homeserver, "Tom");
9492
});
9593
});

src/components/views/dialogs/RoomSettingsDialog.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,14 @@ export default class RoomSettingsDialog extends React.Component<IProps, IState>
164164
);
165165
}
166166

167-
if (SettingsStore.getValue("feature_poll_history")) {
168-
tabs.push(
169-
new Tab(
170-
ROOM_POLL_HISTORY_TAB,
171-
_td("Polls history"),
172-
"mx_RoomSettingsDialog_pollsIcon",
173-
<PollHistoryTab roomId={this.props.roomId} onFinished={() => this.props.onFinished(true)} />,
174-
),
175-
);
176-
}
167+
tabs.push(
168+
new Tab(
169+
ROOM_POLL_HISTORY_TAB,
170+
_td("Polls history"),
171+
"mx_RoomSettingsDialog_pollsIcon",
172+
<PollHistoryTab roomId={this.props.roomId} onFinished={() => this.props.onFinished(true)} />,
173+
),
174+
);
177175

178176
if (SettingsStore.getValue(UIFeature.AdvancedSettings)) {
179177
tabs.push(

src/components/views/right_panel/RoomSummaryCard.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,6 @@ const RoomSummaryCard: React.FC<IProps> = ({ room, permalinkCreator, onClose })
327327
const pinningEnabled = useFeatureEnabled("feature_pinning");
328328
const pinCount = usePinnedEvents(pinningEnabled ? room : undefined)?.length;
329329

330-
const isPollHistoryEnabled = useFeatureEnabled("feature_poll_history");
331-
332330
return (
333331
<BaseCard header={header} className="mx_RoomSummaryCard" onClose={onClose}>
334332
<Group title={_t("About")} className="mx_RoomSummaryCard_aboutGroup">
@@ -341,7 +339,7 @@ const RoomSummaryCard: React.FC<IProps> = ({ room, permalinkCreator, onClose })
341339
{_t("Files")}
342340
</Button>
343341
)}
344-
{!isVideoRoom && isPollHistoryEnabled && (
342+
{!isVideoRoom && (
345343
<Button className="mx_RoomSummaryCard_icon_poll" onClick={onRoomPollHistoryClick}>
346344
{_t("Polls history")}
347345
</Button>

src/i18n/strings/en_EN.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,8 +960,6 @@
960960
"Use new room breadcrumbs": "Use new room breadcrumbs",
961961
"Right panel stays open": "Right panel stays open",
962962
"Defaults to room member list.": "Defaults to room member list.",
963-
"Polls history": "Polls history",
964-
"View a list of polls in a room. (Under active development)": "View a list of polls in a room. (Under active development)",
965963
"Jump to date (adds /jumptodate and jump to date headers)": "Jump to date (adds /jumptodate and jump to date headers)",
966964
"Requires your server to support MSC3030": "Requires your server to support MSC3030",
967965
"Send read receipts": "Send read receipts",
@@ -2236,6 +2234,7 @@
22362234
"Not encrypted": "Not encrypted",
22372235
"About": "About",
22382236
"Files": "Files",
2237+
"Polls history": "Polls history",
22392238
"Pinned": "Pinned",
22402239
"Export chat": "Export chat",
22412240
"Share room": "Share room",

src/settings/Settings.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -363,14 +363,6 @@ export const SETTINGS: { [setting: string]: ISetting } = {
363363
description: _td("Defaults to room member list."),
364364
default: false,
365365
},
366-
"feature_poll_history": {
367-
isFeature: true,
368-
labsGroup: LabGroup.Rooms,
369-
supportedLevels: LEVELS_FEATURE,
370-
displayName: _td("Polls history"),
371-
description: _td("View a list of polls in a room. (Under active development)"),
372-
default: false,
373-
},
374366
"feature_jump_to_date": {
375367
isFeature: true,
376368
labsGroup: LabGroup.Messaging,

test/components/views/dialogs/RoomSettingsDialog-test.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,6 @@ describe("<RoomSettingsDialog />", () => {
8989

9090
describe("poll history", () => {
9191
beforeEach(() => {
92-
jest.spyOn(SettingsStore, "getValue").mockImplementation(
93-
(settingName) => settingName === "feature_poll_history",
94-
);
95-
9692
mockClient.getOrCreateFilter.mockResolvedValue("filterId");
9793
});
9894
it("renders poll history tab", () => {

test/components/views/dialogs/__snapshots__/RoomSettingsDialog-test.tsx.snap

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,21 @@ NodeList [
6262
Notifications
6363
</span>
6464
</div>,
65+
<div
66+
class="mx_AccessibleButton mx_TabbedView_tabLabel "
67+
data-testid="settings-tab-ROOM_POLL_HISTORY_TAB"
68+
role="button"
69+
tabindex="0"
70+
>
71+
<span
72+
class="mx_TabbedView_maskedIcon mx_RoomSettingsDialog_pollsIcon"
73+
/>
74+
<span
75+
class="mx_TabbedView_tabLabel_text"
76+
>
77+
Polls history
78+
</span>
79+
</div>,
6580
]
6681
`;
6782

test/components/views/right_panel/RoomSummaryCard-test.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,13 @@ describe("<RoomSummaryCard />", () => {
134134
});
135135

136136
describe("poll history", () => {
137-
it("renders poll history option when feature is enabled", () => {
138-
featureEnabledSpy.mockImplementation((feature) => feature === "feature_poll_history");
137+
it("renders poll history option", () => {
139138
const { getByText } = getComponent();
140139

141140
expect(getByText("Polls history")).toBeInTheDocument();
142141
});
143142

144143
it("opens poll history dialog on button click", () => {
145-
featureEnabledSpy.mockImplementation((feature) => feature === "feature_poll_history");
146144
const { getByText } = getComponent();
147145

148146
fireEvent.click(getByText("Polls history"));

test/components/views/right_panel/__snapshots__/RoomSummaryCard-test.tsx.snap

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ exports[`<RoomSummaryCard /> renders the room summary 1`] = `
8383
>
8484
Files
8585
</div>
86+
<div
87+
class="mx_AccessibleButton mx_BaseCard_Button mx_RoomSummaryCard_Button mx_RoomSummaryCard_icon_poll"
88+
role="button"
89+
tabindex="0"
90+
>
91+
Polls history
92+
</div>
8693
<div
8794
class="mx_AccessibleButton mx_BaseCard_Button mx_RoomSummaryCard_Button mx_RoomSummaryCard_icon_export"
8895
role="button"

0 commit comments

Comments
 (0)