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
This commit is contained in:
Kerry 2023-03-16 09:54:12 +13:00 committed by GitHub
parent 31a959efe9
commit 2344eaab1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 33 additions and 32 deletions

View file

@ -88,8 +88,6 @@ describe("Poll history", () => {
cy.startHomeserver("default").then((data) => { cy.startHomeserver("default").then((data) => {
homeserver = data; homeserver = data;
cy.enableLabsFeature("feature_poll_history");
cy.initTestUser(homeserver, "Tom"); cy.initTestUser(homeserver, "Tom");
}); });
}); });

View file

@ -164,16 +164,14 @@ export default class RoomSettingsDialog extends React.Component<IProps, IState>
); );
} }
if (SettingsStore.getValue("feature_poll_history")) { tabs.push(
tabs.push( new Tab(
new Tab( ROOM_POLL_HISTORY_TAB,
ROOM_POLL_HISTORY_TAB, _td("Polls history"),
_td("Polls history"), "mx_RoomSettingsDialog_pollsIcon",
"mx_RoomSettingsDialog_pollsIcon", <PollHistoryTab roomId={this.props.roomId} onFinished={() => this.props.onFinished(true)} />,
<PollHistoryTab roomId={this.props.roomId} onFinished={() => this.props.onFinished(true)} />, ),
), );
);
}
if (SettingsStore.getValue(UIFeature.AdvancedSettings)) { if (SettingsStore.getValue(UIFeature.AdvancedSettings)) {
tabs.push( tabs.push(

View file

@ -327,8 +327,6 @@ const RoomSummaryCard: React.FC<IProps> = ({ room, permalinkCreator, onClose })
const pinningEnabled = useFeatureEnabled("feature_pinning"); const pinningEnabled = useFeatureEnabled("feature_pinning");
const pinCount = usePinnedEvents(pinningEnabled ? room : undefined)?.length; const pinCount = usePinnedEvents(pinningEnabled ? room : undefined)?.length;
const isPollHistoryEnabled = useFeatureEnabled("feature_poll_history");
return ( return (
<BaseCard header={header} className="mx_RoomSummaryCard" onClose={onClose}> <BaseCard header={header} className="mx_RoomSummaryCard" onClose={onClose}>
<Group title={_t("About")} className="mx_RoomSummaryCard_aboutGroup"> <Group title={_t("About")} className="mx_RoomSummaryCard_aboutGroup">
@ -341,7 +339,7 @@ const RoomSummaryCard: React.FC<IProps> = ({ room, permalinkCreator, onClose })
{_t("Files")} {_t("Files")}
</Button> </Button>
)} )}
{!isVideoRoom && isPollHistoryEnabled && ( {!isVideoRoom && (
<Button className="mx_RoomSummaryCard_icon_poll" onClick={onRoomPollHistoryClick}> <Button className="mx_RoomSummaryCard_icon_poll" onClick={onRoomPollHistoryClick}>
{_t("Polls history")} {_t("Polls history")}
</Button> </Button>

View file

@ -960,8 +960,6 @@
"Use new room breadcrumbs": "Use new room breadcrumbs", "Use new room breadcrumbs": "Use new room breadcrumbs",
"Right panel stays open": "Right panel stays open", "Right panel stays open": "Right panel stays open",
"Defaults to room member list.": "Defaults to room member list.", "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)", "Jump to date (adds /jumptodate and jump to date headers)": "Jump to date (adds /jumptodate and jump to date headers)",
"Requires your server to support MSC3030": "Requires your server to support MSC3030", "Requires your server to support MSC3030": "Requires your server to support MSC3030",
"Send read receipts": "Send read receipts", "Send read receipts": "Send read receipts",
@ -2236,6 +2234,7 @@
"Not encrypted": "Not encrypted", "Not encrypted": "Not encrypted",
"About": "About", "About": "About",
"Files": "Files", "Files": "Files",
"Polls history": "Polls history",
"Pinned": "Pinned", "Pinned": "Pinned",
"Export chat": "Export chat", "Export chat": "Export chat",
"Share room": "Share room", "Share room": "Share room",

View file

@ -363,14 +363,6 @@ export const SETTINGS: { [setting: string]: ISetting } = {
description: _td("Defaults to room member list."), description: _td("Defaults to room member list."),
default: false, 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": { "feature_jump_to_date": {
isFeature: true, isFeature: true,
labsGroup: LabGroup.Messaging, labsGroup: LabGroup.Messaging,

View file

@ -89,10 +89,6 @@ describe("<RoomSettingsDialog />", () => {
describe("poll history", () => { describe("poll history", () => {
beforeEach(() => { beforeEach(() => {
jest.spyOn(SettingsStore, "getValue").mockImplementation(
(settingName) => settingName === "feature_poll_history",
);
mockClient.getOrCreateFilter.mockResolvedValue("filterId"); mockClient.getOrCreateFilter.mockResolvedValue("filterId");
}); });
it("renders poll history tab", () => { it("renders poll history tab", () => {

View file

@ -62,6 +62,21 @@ NodeList [
Notifications Notifications
</span> </span>
</div>, </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>,
] ]
`; `;

View file

@ -134,15 +134,13 @@ describe("<RoomSummaryCard />", () => {
}); });
describe("poll history", () => { describe("poll history", () => {
it("renders poll history option when feature is enabled", () => { it("renders poll history option", () => {
featureEnabledSpy.mockImplementation((feature) => feature === "feature_poll_history");
const { getByText } = getComponent(); const { getByText } = getComponent();
expect(getByText("Polls history")).toBeInTheDocument(); expect(getByText("Polls history")).toBeInTheDocument();
}); });
it("opens poll history dialog on button click", () => { it("opens poll history dialog on button click", () => {
featureEnabledSpy.mockImplementation((feature) => feature === "feature_poll_history");
const { getByText } = getComponent(); const { getByText } = getComponent();
fireEvent.click(getByText("Polls history")); fireEvent.click(getByText("Polls history"));

View file

@ -83,6 +83,13 @@ exports[`<RoomSummaryCard /> renders the room summary 1`] = `
> >
Files Files
</div> </div>
<div
class="mx_AccessibleButton mx_BaseCard_Button mx_RoomSummaryCard_Button mx_RoomSummaryCard_icon_poll"
role="button"
tabindex="0"
>
Polls history
</div>
<div <div
class="mx_AccessibleButton mx_BaseCard_Button mx_RoomSummaryCard_Button mx_RoomSummaryCard_icon_export" class="mx_AccessibleButton mx_BaseCard_Button mx_RoomSummaryCard_Button mx_RoomSummaryCard_icon_export"
role="button" role="button"