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

Commit

Permalink
Expose PL control for pinned events when lab enabled (#7278)
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed Dec 6, 2021
1 parent baa17e4 commit ca6feaa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import ErrorDialog from '../../../dialogs/ErrorDialog';
import PowerSelector from "../../../elements/PowerSelector";

import { logger } from "matrix-js-sdk/src/logger";
import SettingsStore from "../../../../../settings/SettingsStore";

interface IEventShowOpts {
isState?: boolean;
Expand All @@ -54,6 +55,7 @@ const plEventsToShow: Record<string, IEventShowOpts> = {
[EventType.RoomTombstone]: { isState: true, hideForSpace: true },
[EventType.RoomEncryption]: { isState: true, hideForSpace: true },
[EventType.RoomServerAcl]: { isState: true, hideForSpace: true },
[EventType.RoomPinnedEvents]: { isState: true, hideForSpace: true },

// TODO: Enable support for m.widget event type (https://github.com/vector-im/element-web/issues/13111)
"im.vector.modular.widgets": { isState: true, hideForSpace: true },
Expand Down Expand Up @@ -237,6 +239,10 @@ export default class RolesRoomSettingsTab extends React.Component<IProps> {
"im.vector.modular.widgets": isSpaceRoom ? null : _td("Modify widgets"),
};

if (SettingsStore.getValue("feature_pinning")) {
plEventsToLabels[EventType.RoomPinnedEvents] = _td("Manage pinned events");
}

const powerLevelDescriptors: Record<string, IPowerLevelDescriptor> = {
"users_default": {
desc: _t('Default role'),
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 @@ -1532,6 +1532,7 @@
"Enable room encryption": "Enable room encryption",
"Change server ACLs": "Change server ACLs",
"Modify widgets": "Modify widgets",
"Manage pinned events": "Manage pinned events",
"Default role": "Default role",
"Send messages": "Send messages",
"Invite users": "Invite users",
Expand Down

0 comments on commit ca6feaa

Please sign in to comment.