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

Expose power level control for m.space.child #7120

Merged
merged 1 commit into from
Nov 11, 2021
Merged
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 @@ -33,6 +33,7 @@ import { logger } from "matrix-js-sdk/src/logger";
interface IEventShowOpts {
isState?: boolean;
hideForSpace?: boolean;
hideForRoom?: boolean;
}

interface IPowerLevelDescriptor {
Expand All @@ -46,6 +47,7 @@ const plEventsToShow: Record<string, IEventShowOpts> = {
[EventType.RoomAvatar]: { isState: true },
[EventType.RoomName]: { isState: true },
[EventType.RoomCanonicalAlias]: { isState: true },
[EventType.SpaceChild]: { isState: true, hideForRoom: true },
[EventType.RoomHistoryVisibility]: { isState: true, hideForSpace: true },
[EventType.RoomPowerLevels]: { isState: true },
[EventType.RoomTopic]: { isState: true },
Expand Down Expand Up @@ -223,6 +225,7 @@ export default class RolesRoomSettingsTab extends React.Component<IProps> {
[EventType.RoomCanonicalAlias]: isSpaceRoom
? _td("Change main address for the space")
: _td("Change main address for the room"),
[EventType.SpaceChild]: _td("Manage rooms in this space"),
[EventType.RoomHistoryVisibility]: _td("Change history visibility"),
[EventType.RoomPowerLevels]: _td("Change permissions"),
[EventType.RoomTopic]: isSpaceRoom ? _td("Change description") : _td("Change topic"),
Expand Down Expand Up @@ -413,6 +416,8 @@ export default class RolesRoomSettingsTab extends React.Component<IProps> {
const eventPowerSelectors = Object.keys(eventsLevels).map((eventType, i) => {
if (isSpaceRoom && plEventsToShow[eventType].hideForSpace) {
return null;
} else if (!isSpaceRoom && plEventsToShow[eventType].hideForRoom) {
return null;
}

let label = plEventsToLabels[eventType];
Expand Down
1 change: 1 addition & 0 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1474,6 +1474,7 @@
"Change room name": "Change room name",
"Change main address for the space": "Change main address for the space",
"Change main address for the room": "Change main address for the room",
"Manage rooms in this space": "Manage rooms in this space",
"Change history visibility": "Change history visibility",
"Change permissions": "Change permissions",
"Change description": "Change description",
Expand Down