diff --git a/cypress/utils/room-utils.ts b/cypress/utils/room-utils.ts index 2a06de8c29..73eda5ffac 100644 --- a/cypress/utils/room-utils.ts +++ b/cypress/utils/room-utils.ts @@ -1,15 +1,15 @@ import Chainable = Cypress.Chainable; -import TchapCreateRoom from "../../src/tchap/lib/createTchapRoom"; -import { TchapRoomType } from "../../src/tchap/@types/tchap"; +import TchapCreateRoom from "../../src/lib/createTchapRoom"; +import { TchapRoomType } from "../../src/@types/tchap"; export default class RoomUtils { public static createPublicRoom(roomName: string): Chainable { - return cy.createRoom(TchapCreateRoom.roomCreateOptions(roomName, TchapRoomType.Forum).createOpts); + return cy.createRoom(TchapCreateRoom.roomCreateOptions(roomName, TchapRoomType.Forum, false).createOpts); } public static createPrivateRoom(roomName: string): Chainable { - return cy.createRoom(TchapCreateRoom.roomCreateOptions(roomName, TchapRoomType.Private).createOpts); + return cy.createRoom(TchapCreateRoom.roomCreateOptions(roomName, TchapRoomType.Private, false).createOpts); } public static createPrivateWithExternalRoom(roomName: string): Chainable { - return cy.createRoom(TchapCreateRoom.roomCreateOptions(roomName, TchapRoomType.External).createOpts); + return cy.createRoom(TchapCreateRoom.roomCreateOptions(roomName, TchapRoomType.External, false).createOpts); } public static openRoomAccessSettings(roomName: string): Chainable> { //open room diff --git a/patches/add-tab-to-download-csv-file-of-the-list-of-users-in-a-room/matrix-react-sdk+3.71.1.patch b/patches/add-tab-to-download-csv-file-of-the-list-of-users-in-a-room/matrix-react-sdk+3.71.1.patch new file mode 100644 index 0000000000..7faf289742 --- /dev/null +++ b/patches/add-tab-to-download-csv-file-of-the-list-of-users-in-a-room/matrix-react-sdk+3.71.1.patch @@ -0,0 +1,91 @@ +diff --git a/node_modules/matrix-react-sdk/src/components/views/right_panel/RoomSummaryCard.tsx b/node_modules/matrix-react-sdk/src/components/views/right_panel/RoomSummaryCard.tsx +index a32d8da..45b1307 100644 +--- a/node_modules/matrix-react-sdk/src/components/views/right_panel/RoomSummaryCard.tsx ++++ b/node_modules/matrix-react-sdk/src/components/views/right_panel/RoomSummaryCard.tsx +@@ -17,7 +17,14 @@ limitations under the License. + import React, { useCallback, useContext, useEffect, useMemo, useState } from "react"; + import classNames from "classnames"; + import { Room } from "matrix-js-sdk/src/models/room"; +- ++import { keys } from "lodash"; /* :TCHAP: */ ++ ++// src/components/views/right_panel/RoomSummaryCard.tsx ++// src/components/views/elements/Tooltip.tsx ++import Tooltip, { Alignment } from "../elements/Tooltip"; /* :TCHAP: */ ++import { useTimeoutToggle } from "../../../hooks/useTimeoutToggle"; /* :TCHAP: */ ++import { generateAndDownloadTextFile } from "../../../../../../src/tchap/util/TchapExportFiles"; /* :TCHAP: */ ++import { useRoomContext } from "../../../contexts/RoomContext"; + import MatrixClientContext from "../../../contexts/MatrixClientContext"; + import { useIsEncrypted } from "../../../hooks/useIsEncrypted"; + import BaseCard, { Group } from "./BaseCard"; +@@ -274,6 +281,7 @@ const onRoomSettingsClick = (ev: ButtonEvent): void => { + + const RoomSummaryCard: React.FC = ({ room, permalinkCreator, onClose }) => { + const cli = useContext(MatrixClientContext); ++ const context = useRoomContext(); + + const onShareRoomClick = (): void => { + Modal.createDialog(ShareDialog, { +@@ -287,6 +295,20 @@ const RoomSummaryCard: React.FC = ({ room, permalinkCreator, onClose }) + }); + }; + ++ /* :TCHAP: ++ add a tab to download the list of users in current room ++ so that they can create new rooms with the same users ++ */ ++ const onRoomExportMemberEmailsClick = async (): Promise => { ++ const members = keys(context?.room?.currentState?.members); ++ generateAndDownloadTextFile({ ++ fileName: "members", ++ format: "txt", ++ content: members.join(",") ++ }); ++ } ++ /* end :TCHAP: */ ++ + const onRoomPollHistoryClick = (): void => { + Modal.createDialog(PollHistoryDialog, { + room, +@@ -295,6 +317,7 @@ const RoomSummaryCard: React.FC = ({ room, permalinkCreator, onClose }) + }); + }; + ++ + const isRoomEncrypted = useIsEncrypted(cli, room); + const roomContext = useContext(RoomContext); + const e2eStatus = roomContext.e2eStatus; +@@ -328,6 +351,11 @@ const RoomSummaryCard: React.FC = ({ room, permalinkCreator, onClose }) + const memberCount = useRoomMemberCount(room); + const pinningEnabled = useFeatureEnabled("feature_pinning"); + const pinCount = usePinnedEvents(pinningEnabled ? room : undefined)?.length; ++ /* :TCHAP: add tooltip for export room member list button */ ++ const [exportRoomMembersYooltipVisible, setExportRoomMembersYooltipVisible] = useState(false); ++ const onExportRoomMembersEnter = () => setExportRoomMembersYooltipVisible(true); ++ const onExportRoomMembersLeave = () => setExportRoomMembersYooltipVisible(false); ++ /* end :TCHAP: */ + + return ( + +@@ -357,6 +385,21 @@ const RoomSummaryCard: React.FC = ({ room, permalinkCreator, onClose }) + {_t("Export chat")} + + )} ++ {/* :TCHAP: */ !isVideoRoom && ( ++ ++ ) /* end :TCHAP */} +