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

pull/21833/head
Michael Telatynski 2021-11-11 16:32:30 +00:00 committed by GitHub
parent 2a1a180ece
commit 155157dba1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

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

View File

@ -1488,6 +1488,7 @@
"Change room name": "Change room name", "Change room name": "Change room name",
"Change main address for the space": "Change main address for the space", "Change main address for the space": "Change main address for the space",
"Change main address for the room": "Change main address for the room", "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 history visibility": "Change history visibility",
"Change permissions": "Change permissions", "Change permissions": "Change permissions",
"Change description": "Change description", "Change description": "Change description",