Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poll history - remove active development labs flag #10357

Merged
merged 8 commits into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cypress/e2e/polls/pollHistory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ describe("Poll history", () => {
cy.startHomeserver("default").then((data) => {
homeserver = data;

cy.enableLabsFeature("feature_poll_history");

cy.initTestUser(homeserver, "Tom");
});
});
Expand Down
18 changes: 8 additions & 10 deletions src/components/views/dialogs/RoomSettingsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,14 @@ export default class RoomSettingsDialog extends React.Component<IProps, IState>
);
}

if (SettingsStore.getValue("feature_poll_history")) {
tabs.push(
new Tab(
ROOM_POLL_HISTORY_TAB,
_td("Polls history"),
"mx_RoomSettingsDialog_pollsIcon",
<PollHistoryTab roomId={this.props.roomId} onFinished={() => this.props.onFinished(true)} />,
),
);
}
tabs.push(
new Tab(
ROOM_POLL_HISTORY_TAB,
_td("Polls history"),
"mx_RoomSettingsDialog_pollsIcon",
<PollHistoryTab roomId={this.props.roomId} onFinished={() => this.props.onFinished(true)} />,
),
);

if (SettingsStore.getValue(UIFeature.AdvancedSettings)) {
tabs.push(
Expand Down
4 changes: 1 addition & 3 deletions src/components/views/right_panel/RoomSummaryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,6 @@ const RoomSummaryCard: React.FC<IProps> = ({ room, permalinkCreator, onClose })
const pinningEnabled = useFeatureEnabled("feature_pinning");
const pinCount = usePinnedEvents(pinningEnabled ? room : undefined)?.length;

const isPollHistoryEnabled = useFeatureEnabled("feature_poll_history");

return (
<BaseCard header={header} className="mx_RoomSummaryCard" onClose={onClose}>
<Group title={_t("About")} className="mx_RoomSummaryCard_aboutGroup">
Expand All @@ -341,7 +339,7 @@ const RoomSummaryCard: React.FC<IProps> = ({ room, permalinkCreator, onClose })
{_t("Files")}
</Button>
)}
{!isVideoRoom && isPollHistoryEnabled && (
{!isVideoRoom && (
<Button className="mx_RoomSummaryCard_icon_poll" onClick={onRoomPollHistoryClick}>
{_t("Polls history")}
</Button>
Expand Down
3 changes: 1 addition & 2 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -958,8 +958,6 @@
"Use new room breadcrumbs": "Use new room breadcrumbs",
"Right panel stays open": "Right panel stays open",
"Defaults to room member list.": "Defaults to room member list.",
"Polls history": "Polls history",
"View a list of polls in a room. (Under active development)": "View a list of polls in a room. (Under active development)",
"Jump to date (adds /jumptodate and jump to date headers)": "Jump to date (adds /jumptodate and jump to date headers)",
"Send read receipts": "Send read receipts",
"Sliding Sync mode": "Sliding Sync mode",
Expand Down Expand Up @@ -2232,6 +2230,7 @@
"Not encrypted": "Not encrypted",
"About": "About",
"Files": "Files",
"Polls history": "Polls history",
"Pinned": "Pinned",
"Export chat": "Export chat",
"Share room": "Share room",
Expand Down
8 changes: 0 additions & 8 deletions src/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -359,14 +359,6 @@ export const SETTINGS: { [setting: string]: ISetting } = {
description: _td("Defaults to room member list."),
default: false,
},
"feature_poll_history": {
isFeature: true,
labsGroup: LabGroup.Rooms,
supportedLevels: LEVELS_FEATURE,
displayName: _td("Polls history"),
description: _td("View a list of polls in a room. (Under active development)"),
default: false,
},
"feature_jump_to_date": {
isFeature: true,
labsGroup: LabGroup.Messaging,
Expand Down
4 changes: 0 additions & 4 deletions test/components/views/dialogs/RoomSettingsDialog-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ describe("<RoomSettingsDialog />", () => {

describe("poll history", () => {
beforeEach(() => {
jest.spyOn(SettingsStore, "getValue").mockImplementation(
(settingName) => settingName === "feature_poll_history",
);

mockClient.getOrCreateFilter.mockResolvedValue("filterId");
});
it("renders poll history tab", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,21 @@ NodeList [
Notifications
</span>
</div>,
<div
class="mx_AccessibleButton mx_TabbedView_tabLabel "
data-testid="settings-tab-ROOM_POLL_HISTORY_TAB"
role="button"
tabindex="0"
>
<span
class="mx_TabbedView_maskedIcon mx_RoomSettingsDialog_pollsIcon"
/>
<span
class="mx_TabbedView_tabLabel_text"
>
Polls history
</span>
</div>,
]
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,13 @@ describe("<RoomSummaryCard />", () => {
});

describe("poll history", () => {
it("renders poll history option when feature is enabled", () => {
featureEnabledSpy.mockImplementation((feature) => feature === "feature_poll_history");
it("renders poll history option", () => {
const { getByText } = getComponent();

expect(getByText("Polls history")).toBeInTheDocument();
});

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

fireEvent.click(getByText("Polls history"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ exports[`<RoomSummaryCard /> renders the room summary 1`] = `
>
Files
</div>
<div
class="mx_AccessibleButton mx_BaseCard_Button mx_RoomSummaryCard_Button mx_RoomSummaryCard_icon_poll"
role="button"
tabindex="0"
>
Polls history
</div>
<div
class="mx_AccessibleButton mx_BaseCard_Button mx_RoomSummaryCard_Button mx_RoomSummaryCard_icon_export"
role="button"
Expand Down