Convert to using EventType enum

pull/21833/head
Travis Ralston 2021-04-08 19:18:30 -06:00
parent 6e6a26f86a
commit 28d12016b7
1 changed files with 18 additions and 17 deletions

View File

@ -1,5 +1,5 @@
/* /*
Copyright 2019 New Vector Ltd Copyright 2019, 2021 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -22,17 +22,18 @@ import * as sdk from "../../../../..";
import AccessibleButton from "../../../elements/AccessibleButton"; import AccessibleButton from "../../../elements/AccessibleButton";
import Modal from "../../../../../Modal"; import Modal from "../../../../../Modal";
import {replaceableComponent} from "../../../../../utils/replaceableComponent"; import {replaceableComponent} from "../../../../../utils/replaceableComponent";
import {EventType} from "matrix-js-sdk/src/@types/event";
const plEventsToLabels = { const plEventsToLabels = {
// These will be translated for us later. // These will be translated for us later.
"m.room.avatar": _td("Change room avatar"), [EventType.RoomAvatar]: _td("Change room avatar"),
"m.room.name": _td("Change room name"), [EventType.RoomName]: _td("Change room name"),
"m.room.canonical_alias": _td("Change main address for the room"), [EventType.RoomCanonicalAlias]: _td("Change main address for the room"),
"m.room.history_visibility": _td("Change history visibility"), [EventType.RoomHistoryVisibility]: _td("Change history visibility"),
"m.room.power_levels": _td("Change permissions"), [EventType.RoomPowerLevels]: _td("Change permissions"),
"m.room.topic": _td("Change topic"), [EventType.RoomTopic]: _td("Change topic"),
"m.room.tombstone": _td("Upgrade the room"), [EventType.RoomTombstone]: _td("Upgrade the room"),
"m.room.encryption": _td("Enable room encryption"), [EventType.RoomEncryption]: _td("Enable room encryption"),
// TODO: Enable support for m.widget event type (https://github.com/vector-im/element-web/issues/13111) // TODO: Enable support for m.widget event type (https://github.com/vector-im/element-web/issues/13111)
"im.vector.modular.widgets": _td("Modify widgets"), "im.vector.modular.widgets": _td("Modify widgets"),
@ -40,14 +41,14 @@ const plEventsToLabels = {
const plEventsToShow = { const plEventsToShow = {
// If an event is listed here, it will be shown in the PL settings. Defaults will be calculated. // If an event is listed here, it will be shown in the PL settings. Defaults will be calculated.
"m.room.avatar": {isState: true}, [EventType.RoomAvatar]: {isState: true},
"m.room.name": {isState: true}, [EventType.RoomName]: {isState: true},
"m.room.canonical_alias": {isState: true}, [EventType.RoomCanonicalAlias]: {isState: true},
"m.room.history_visibility": {isState: true}, [EventType.RoomHistoryVisibility]: {isState: true},
"m.room.power_levels": {isState: true}, [EventType.RoomPowerLevels]: {isState: true},
"m.room.topic": {isState: true}, [EventType.RoomTopic]: {isState: true},
"m.room.tombstone": {isState: true}, [EventType.RoomTombstone]: {isState: true},
"m.room.encryption": {isState: true}, [EventType.RoomEncryption]: {isState: true},
// TODO: Enable support for m.widget event type (https://github.com/vector-im/element-web/issues/13111) // TODO: Enable support for m.widget event type (https://github.com/vector-im/element-web/issues/13111)
"im.vector.modular.widgets": {isState: true}, "im.vector.modular.widgets": {isState: true},