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

This commit is contained in:
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 {
isState?: boolean;
hideForSpace?: boolean;
hideForRoom?: boolean;
}
interface IPowerLevelDescriptor {
@ -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 },
@ -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"),
@ -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];

View file

@ -1488,6 +1488,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",