mirror of https://github.com/vector-im/riot-web
Expose power level control for m.space.child (#7120)
parent
2a1a180ece
commit
155157dba1
|
@ -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];
|
||||||
|
|
|
@ -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",
|
||||||
|
|
Loading…
Reference in New Issue