diff --git a/res/css/views/rooms/_RoomUpgradeWarningBar.scss b/res/css/views/rooms/_RoomUpgradeWarningBar.scss index 82785b82d2..fe81d3801a 100644 --- a/res/css/views/rooms/_RoomUpgradeWarningBar.scss +++ b/res/css/views/rooms/_RoomUpgradeWarningBar.scss @@ -16,7 +16,7 @@ limitations under the License. .mx_RoomUpgradeWarningBar { text-align: center; - height: 176px; + height: 235px; background-color: $event-selected-color; align-items: center; flex-direction: column; diff --git a/res/css/views/settings/tabs/_SettingsTab.scss b/res/css/views/settings/tabs/_SettingsTab.scss index 7fd8bceb50..88735f99b2 100644 --- a/res/css/views/settings/tabs/_SettingsTab.scss +++ b/res/css/views/settings/tabs/_SettingsTab.scss @@ -14,6 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +.mx_SettingsTab_warningText { + color: $warning-color; +} + .mx_SettingsTab_heading { font-size: 20px; font-weight: 600; diff --git a/src/SlashCommands.js b/src/SlashCommands.js index 711346c4a7..039ccb928f 100644 --- a/src/SlashCommands.js +++ b/src/SlashCommands.js @@ -28,6 +28,7 @@ import {MATRIXTO_URL_PATTERN} from "./linkify-matrix"; import * as querystring from "querystring"; import MultiInviter from './utils/MultiInviter'; import { linkifyAndSanitizeHtml } from './HtmlUtils'; +import QuestionDialog from "./components/views/dialogs/QuestionDialog"; class Command { constructor({name, args='', description, runFn, hideCompletionAfterSpace=false}) { @@ -105,7 +106,72 @@ export const CommandMap = { description: _td('Upgrades a room to a new version'), runFn: function(roomId, args) { if (args) { - return success(MatrixClientPeg.get().upgradeRoom(roomId, args)); + const room = MatrixClientPeg.get().getRoom(roomId); + Modal.createTrackedDialog('Slash Commands', 'upgrade room confirmation', + QuestionDialog, { + title: _t('Room upgrade confirmation'), + description: ( +
{_t("Upgrading a room can be destructive and isn't always necessary.")}
++ {_t( + "Room upgrades are usually recommended when a room version is considered " + + "unstable. Unstable room versions might have bugs, missing features, or " + + "security vulnerabilities.", + {}, { + "i": (sub) => {sub}, + }, + )} +
+
+ {_t(
+ "Room upgrades usually only affect server-side processing of the " +
+ "room. If you're having problems with your Riot client, please file an issue " +
+ "with
+ {_t( + "Warning: Upgrading a room will not automatically migrate room " + + "members to the new version of the room. We'll post a link to the new room " + + "in the old version of the room - room members will have to click this link to " + + "join the new room.", + {}, { + "b": (sub) => {sub}, + "i": (sub) => {sub}, + }, + )} +
+
+ {_t(
+ "Please confirm that you'd like to go forward with upgrading this room " +
+ "from {room ? room.getVersion() : "1"}
,
+ newVersion: () => {args}
,
+ },
+ )}
+
{this.props.room.getVersion()}
,
+ "i": (sub) => {sub},
+ },
+ )}
+ + {_t( + "Upgrading this room will shut down the current instance of the room and create " + + "an upgraded room with the same name.", + )} +
++ {_t( + "Warning: Upgrading a room will not automatically migrate room members " + + "to the new version of the room. We'll post a link to the new room in the old " + + "version of the room - room members will have to click this link to join the new room.", + {}, { + "b": (sub) => {sub}, + "i": (sub) => {sub}, + }, + )} +
-
+ {_t( + "Warning: Upgrading a room will not automatically migrate room members " + + "to the new version of the room. We'll post a link to the new room in the old " + + "version of the room - room members will have to click this link to join the new room.", + {}, { + "b": (sub) => {sub}, + "i": (sub) => {sub}, + }, + )} +
+