Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ import { topicToHtml } from "../../../HtmlUtils.tsx";
import { useRoomSummaryCardViewModel } from "../../viewmodels/right_panel/RoomSummaryCardViewModel.tsx";
import { useRoomTopicViewModel } from "../../viewmodels/right_panel/RoomSummaryCardTopicViewModel.tsx";
import { useRoomName } from "../../../hooks/useRoomName.ts";
import { useSettingValue } from "../../../hooks/useSettings.ts";
import { UIFeature } from "../../../settings/UIFeature.ts";

interface IProps {
room: Room;
Expand Down Expand Up @@ -133,6 +135,7 @@ const RoomSummaryCardView: React.FC<IProps> = ({
const vm = useRoomSummaryCardViewModel(room, permalinkCreator, onSearchCancel);
// XXX: this name should be part of the view model
const name = useRoomName(room);
const allowChatExport = useSettingValue(UIFeature.AllowChatExport);

// The search field is controlled and onSearchChange is debounced in RoomView,
// so we need to set the value of the input right away
Expand Down Expand Up @@ -288,11 +291,14 @@ const RoomSummaryCardView: React.FC<IProps> = ({
label={_t("right_panel|polls_button")}
onSelect={vm.onRoomPollHistoryClick}
/>
<MenuItem
Icon={ExportArchiveIcon}
label={_t("export_chat|title")}
onSelect={vm.onRoomExportClick}
/>

{allowChatExport && (
<MenuItem
Icon={ExportArchiveIcon}
label={_t("export_chat|title")}
onSelect={vm.onRoomExportClick}
/>
)}
</>
)}

Expand Down
4 changes: 4 additions & 0 deletions apps/web/src/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,10 @@ export const SETTINGS: Settings = {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},
[UIFeature.AllowChatExport]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},

// Electron-specific settings, they are stored by Electron and set/read over an IPC.
// We store them over there are they are necessary to know before the renderer process launches.
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/settings/UIFeature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const enum UIFeature {
TimelineEnableRelativeDates = "UIFeature.timelineEnableRelativeDates",
AllowCreatingPublicRooms = "UIFeature.allowCreatingPublicRooms",
AllowCreatingPublicSpaces = "UIFeature.allowCreatingPublicSpaces",
AllowChatExport = "UIFeature.allowChatExport",
}

export { UIComponent } from "@element-hq/element-web-module-api";
1 change: 1 addition & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ Currently, the following UI feature flags are supported:
- `UIFeature.locationSharing` - Whether or not location sharing menus will be shown.
- `UIFeature.allowCreatingPublicRooms` - Whether or not public rooms can be created.
- `UIFeature.allowCreatingPublicSpaces` - Whether or not public spaces can be created.
- `UIFeature.allowChatExport` - Whether or not chats can be exported.

## Modules

Expand Down
Loading