From 157a3388a509c02742c084f150a2a4c78fe0145e Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 20 Sep 2019 17:39:46 +0200 Subject: [PATCH 01/10] change name to Field, no_federate to switch also construct room create options in dialog, instead of MatrixChat, as we'll have more to come --- src/components/structures/MatrixChat.js | 5 +- .../views/dialogs/CreateRoomDialog.js | 88 ++++++++++++++----- 2 files changed, 66 insertions(+), 27 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 306ef03fb1..774ef21aff 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -962,11 +962,8 @@ export default createReactClass({ const CreateRoomDialog = sdk.getComponent('dialogs.CreateRoomDialog'); const modal = Modal.createTrackedDialog('Create Room', '', CreateRoomDialog); - const [shouldCreate, name, noFederate] = await modal.finished; + const [shouldCreate, createOpts] = await modal.finished; if (shouldCreate) { - const createOpts = {}; - if (name) createOpts.name = name; - if (noFederate) createOpts.creation_content = {'m.federate': false}; createRoom({createOpts}).done(); } }, diff --git a/src/components/views/dialogs/CreateRoomDialog.js b/src/components/views/dialogs/CreateRoomDialog.js index e1da9f841d..3ae328839e 100644 --- a/src/components/views/dialogs/CreateRoomDialog.js +++ b/src/components/views/dialogs/CreateRoomDialog.js @@ -19,6 +19,7 @@ import createReactClass from 'create-react-class'; import PropTypes from 'prop-types'; import sdk from '../../../index'; import SdkConfig from '../../../SdkConfig'; +import withValidation from '../elements/Validation'; import { _t } from '../../../languageHandler'; export default createReactClass({ @@ -27,47 +28,88 @@ export default createReactClass({ onFinished: PropTypes.func.isRequired, }, - componentWillMount: function() { + getInitialState() { const config = SdkConfig.get(); - // Dialog shows inverse of m.federate (noFederate) strict false check to skip undefined check (default = true) - this.defaultNoFederate = config.default_federate === false; + return { + name: "", + noFederate: config.default_federate === false, + nameIsValid: false, + }; }, - onOk: function() { - this.props.onFinished(true, this.refs.textinput.value, this.refs.checkbox.checked); + _roomCreateOptions() { + const createOpts = {}; + createOpts.name = this.state.name; + if (this.state.noFederate) { + createOpts.creation_content = {'m.federate': false}; + } + return createOpts; + }, + + componentDidMount() { + this._detailsRef.addEventListener("toggle", this.onDetailsToggled); + }, + + componentWillUnmount() { + this._detailsRef.removeEventListener("toggle", this.onDetailsToggled); + }, + + onOk: async function() { + this.props.onFinished(true, this._roomCreateOptions()); }, onCancel: function() { this.props.onFinished(false); }, + onNameChange(ev) { + this.setState({name: ev.target.value}); + }, + + + onDetailsToggled(ev) { + this.setState({detailsOpen: ev.target.open}); + }, + + onNoFederateChange(noFederate) { + this.setState({noFederate}); + }, + + collectDetailsRef(ref) { + this._detailsRef = ref; + }, + + async onNameValidate(fieldState) { + const result = await this._validateRoomName(fieldState); + this.setState({nameIsValid: result.valid}); + return result; + }, + + _validateRoomName: withValidation({ + rules: [ + { + key: "required", + test: async ({ value }) => !!value, + invalid: () => _t("Please enter a name for the room"), + }, + ], + }), + render: function() { const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); const DialogButtons = sdk.getComponent('views.elements.DialogButtons'); + const Field = sdk.getComponent('views.elements.Field'); + const LabelledToggleSwitch = sdk.getComponent('views.elements.LabelledToggleSwitch'); return (
-
- -
-
- -
-
- -
- { _t('Advanced options') } -
- - -
+ this._nameFieldRef = ref} label={ _t('Name') } onChange={this.onNameChange} onValidate={this.onNameValidate} value={this.state.name} className="mx_CreateRoomDialog_name" /> +
+ { this.state.detailsOpen ? _t('Hide advanced') : _t('Show advanced') } +
From 4a7ae3ca8e5570dbc00f68640a300420d9fb72b2 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 20 Sep 2019 17:41:03 +0200 Subject: [PATCH 02/10] add optional topic field --- src/components/views/dialogs/CreateRoomDialog.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/views/dialogs/CreateRoomDialog.js b/src/components/views/dialogs/CreateRoomDialog.js index 3ae328839e..e31d7304ea 100644 --- a/src/components/views/dialogs/CreateRoomDialog.js +++ b/src/components/views/dialogs/CreateRoomDialog.js @@ -32,6 +32,7 @@ export default createReactClass({ const config = SdkConfig.get(); return { name: "", + topic: "", noFederate: config.default_federate === false, nameIsValid: false, }; @@ -40,6 +41,9 @@ export default createReactClass({ _roomCreateOptions() { const createOpts = {}; createOpts.name = this.state.name; + if (this.state.topic) { + createOpts.topic = this.state.topic; + } if (this.state.noFederate) { createOpts.creation_content = {'m.federate': false}; } @@ -66,6 +70,10 @@ export default createReactClass({ this.setState({name: ev.target.value}); }, + onTopicChange(ev) { + this.setState({topic: ev.target.value}); + }, + onDetailsToggled(ev) { this.setState({detailsOpen: ev.target.open}); @@ -107,6 +115,7 @@ export default createReactClass({
this._nameFieldRef = ref} label={ _t('Name') } onChange={this.onNameChange} onValidate={this.onNameValidate} value={this.state.name} className="mx_CreateRoomDialog_name" /> +
{ this.state.detailsOpen ? _t('Hide advanced') : _t('Show advanced') } From 761233c473efef1259e6c8c5c969d4d609877024 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 20 Sep 2019 17:43:14 +0200 Subject: [PATCH 03/10] add public switch --- .../views/dialogs/CreateRoomDialog.js | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/components/views/dialogs/CreateRoomDialog.js b/src/components/views/dialogs/CreateRoomDialog.js index e31d7304ea..10415680a7 100644 --- a/src/components/views/dialogs/CreateRoomDialog.js +++ b/src/components/views/dialogs/CreateRoomDialog.js @@ -31,6 +31,7 @@ export default createReactClass({ getInitialState() { const config = SdkConfig.get(); return { + isPublic: false, name: "", topic: "", noFederate: config.default_federate === false, @@ -41,6 +42,11 @@ export default createReactClass({ _roomCreateOptions() { const createOpts = {}; createOpts.name = this.state.name; + if (this.state.isPublic) { + createOpts.visibility = "public"; + createOpts.preset = "public_chat"; + // to prevent createRoom from enabling guest access + createOpts['initial_state'] = []; if (this.state.topic) { createOpts.topic = this.state.topic; } @@ -74,6 +80,10 @@ export default createReactClass({ this.setState({topic: ev.target.value}); }, + onPublicChange(isPublic) { + this.setState({isPublic}); + }, + onDetailsToggled(ev) { this.setState({detailsOpen: ev.target.open}); @@ -108,14 +118,26 @@ export default createReactClass({ const DialogButtons = sdk.getComponent('views.elements.DialogButtons'); const Field = sdk.getComponent('views.elements.Field'); const LabelledToggleSwitch = sdk.getComponent('views.elements.LabelledToggleSwitch'); + let privateLabel; + let publicLabel; + if (this.state.isPublic) { + publicLabel = (

{_t("Set a room alias to easily share your room with other people.")}

); + } else { + privateLabel = (

{_t("This room is private, and can only be joined by invitation.")}

); + } + + const title = this.state.isPublic ? _t('Create a public room') : _t('Create a private room'); return (
this._nameFieldRef = ref} label={ _t('Name') } onChange={this.onNameChange} onValidate={this.onNameValidate} value={this.state.name} className="mx_CreateRoomDialog_name" /> + + { privateLabel } + { publicLabel }
{ this.state.detailsOpen ? _t('Hide advanced') : _t('Show advanced') } From c5f9ef87baa1362293c66e069d7b0662c66e7ad5 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 20 Sep 2019 17:44:07 +0200 Subject: [PATCH 04/10] fixup: detailsOpen state var --- src/components/views/dialogs/CreateRoomDialog.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/views/dialogs/CreateRoomDialog.js b/src/components/views/dialogs/CreateRoomDialog.js index 10415680a7..b462230c24 100644 --- a/src/components/views/dialogs/CreateRoomDialog.js +++ b/src/components/views/dialogs/CreateRoomDialog.js @@ -34,6 +34,7 @@ export default createReactClass({ isPublic: false, name: "", topic: "", + detailsOpen: false, noFederate: config.default_federate === false, nameIsValid: false, }; From 8a1c1bbec4a1cf192b29f88da195b1a69a46b62e Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 20 Sep 2019 17:45:14 +0200 Subject: [PATCH 05/10] implement RoomAliasField component adding a postfix to Field to show the domain name --- res/css/_components.scss | 1 + res/css/views/elements/_Field.scss | 4 + res/css/views/elements/_RoomAliasField.scss | 56 ++++++++ src/components/views/elements/Field.js | 15 ++- .../views/elements/RoomAliasField.js | 125 ++++++++++++++++++ 5 files changed, 198 insertions(+), 3 deletions(-) create mode 100644 res/css/views/elements/_RoomAliasField.scss create mode 100644 src/components/views/elements/RoomAliasField.js diff --git a/res/css/_components.scss b/res/css/_components.scss index 213d0d714c..40a797dc15 100644 --- a/res/css/_components.scss +++ b/res/css/_components.scss @@ -99,6 +99,7 @@ @import "./views/elements/_ResizeHandle.scss"; @import "./views/elements/_RichText.scss"; @import "./views/elements/_RoleButton.scss"; +@import "./views/elements/_RoomAliasField.scss"; @import "./views/elements/_Spinner.scss"; @import "./views/elements/_SyntaxHighlight.scss"; @import "./views/elements/_TextWithTooltip.scss"; diff --git a/res/css/views/elements/_Field.scss b/res/css/views/elements/_Field.scss index 0e8252e89d..da896f947d 100644 --- a/res/css/views/elements/_Field.scss +++ b/res/css/views/elements/_Field.scss @@ -31,6 +31,10 @@ limitations under the License. border-right: 1px solid $input-border-color; } +.mx_Field_postfix { + border-left: 1px solid $input-border-color; +} + .mx_Field input, .mx_Field select, .mx_Field textarea { diff --git a/res/css/views/elements/_RoomAliasField.scss b/res/css/views/elements/_RoomAliasField.scss new file mode 100644 index 0000000000..0fe53b2766 --- /dev/null +++ b/res/css/views/elements/_RoomAliasField.scss @@ -0,0 +1,56 @@ +/* +Copyright 2019 The Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +.mx_RoomAliasField { + // if parent is a flex container, this allows the + // width to be as wide as needed, and not 100% + flex: 0 1 auto; + display: flex; + align-items: stretch; + min-width: 0; + max-width: 100%; + + input { + width: 150px; + padding-left: 0; + padding-right: 0; + } + + input::placeholder { + color: $greyed-fg-color; + font-weight: normal; + } + + .mx_Field_prefix, .mx_Field_postfix { + color: $greyed-fg-color; + border-left: none; + border-right: none; + font-weight: 600; + padding: 9px 10px; + flex: 0 0 auto; + } + + .mx_Field_postfix { + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + // this allows the domain name to show + // as long as it doesn't make the input shrink + // if it's too big, it shows an ellipsis + // 180: 28 for prefix, 152 for input + max-width: calc(100% - 180px); + } +} diff --git a/src/components/views/elements/Field.js b/src/components/views/elements/Field.js index 08a578b963..0a737d963a 100644 --- a/src/components/views/elements/Field.js +++ b/src/components/views/elements/Field.js @@ -41,6 +41,8 @@ export default class Field extends React.PureComponent { value: PropTypes.string.isRequired, // Optional component to include inside the field before the input. prefix: PropTypes.node, + // Optional component to include inside the field after the input. + postfix: PropTypes.node, // The callback called whenever the contents of the field // changes. Returns an object with `valid` boolean field // and a `feedback` react component field to provide feedback @@ -54,6 +56,8 @@ export default class Field extends React.PureComponent { // If specified alongside tooltipContent, the class name to apply to the // tooltip itself. tooltipClassName: PropTypes.string, + // If specified, an additional class name to apply to the field container + className: PropTypes.string, // All other props pass through to the . }; @@ -143,8 +147,8 @@ export default class Field extends React.PureComponent { render() { const { - element, prefix, onValidate, children, tooltipContent, flagInvalid, - tooltipClassName, ...inputProps} = this.props; + element, prefix, postfix, className, onValidate, children, + tooltipContent, flagInvalid, tooltipClassName, ...inputProps} = this.props; const inputElement = element || "input"; @@ -163,9 +167,13 @@ export default class Field extends React.PureComponent { if (prefix) { prefixContainer = {prefix}; } + let postfixContainer = null; + if (postfix) { + postfixContainer = {postfix}; + } const hasValidationFlag = flagInvalid !== null && flagInvalid !== undefined; - const fieldClasses = classNames("mx_Field", `mx_Field_${inputElement}`, { + const fieldClasses = classNames("mx_Field", `mx_Field_${inputElement}`, className, { // If we have a prefix element, leave the label always at the top left and // don't animate it, as it looks a bit clunky and would add complexity to do // properly. @@ -192,6 +200,7 @@ export default class Field extends React.PureComponent { {prefixContainer} {fieldInput} + {postfixContainer} {fieldTooltip}
; } diff --git a/src/components/views/elements/RoomAliasField.js b/src/components/views/elements/RoomAliasField.js new file mode 100644 index 0000000000..03f4000e59 --- /dev/null +++ b/src/components/views/elements/RoomAliasField.js @@ -0,0 +1,125 @@ +/* +Copyright 2019 New Vector Ltd + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +import { _t } from '../../../languageHandler'; +import React from 'react'; +import PropTypes from 'prop-types'; +import sdk from '../../../index'; +import withValidation from './Validation'; +import MatrixClientPeg from '../../../MatrixClientPeg'; + +export default class RoomAliasField extends React.PureComponent { + static propTypes = { + id: PropTypes.string.isRequired, + domain: PropTypes.string.isRequired, + onChange: PropTypes.func, + }; + + constructor(props) { + super(props); + this.state = {isValid: true}; + } + + _asFullAlias(localpart) { + return `#${localpart}:${this.props.domain}`; + } + + render() { + const Field = sdk.getComponent('views.elements.Field'); + const poundSign = (#); + const aliasPostfix = ":" + this.props.domain; + const domain = ({aliasPostfix}); + const maxlength = 255 - this.props.domain.length - 2; // 2 for # and : + return ( + this._fieldRef = ref} + onValidate={this._onValidate} + placeholder={_t("e.g. my-room")} + onChange={this._onChange} + maxLength={maxlength} /> + ); + } + + _onChange = (ev) => { + if (this.props.onChange) { + this.props.onChange(this._asFullAlias(ev.target.value)); + } + } + + _onValidate = async (fieldState) => { + const result = await this._validationRules(fieldState); + this.setState({isValid: result.valid}); + return result; + }; + + _validationRules = withValidation({ + rules: [ + { + key: "safeLocalpart", + test: async ({ value }) => { + if (!value) { + return true; + } + const fullAlias = this._asFullAlias(value); + // XXX: FIXME https://github.com/matrix-org/matrix-doc/issues/668 + return !value.includes("#") && !value.includes(":") && !value.includes(",") && + encodeURI(fullAlias) === fullAlias; + }, + invalid: () => _t("Some characters not allowed"), + }, { + key: "required", + test: async ({ value, allowEmpty }) => allowEmpty || !!value, + invalid: () => _t("Please provide a room alias"), + }, { + key: "taken", + test: async ({value}) => { + if (!value) { + return true; + } + const client = MatrixClientPeg.get(); + try { + await client.getRoomIdForAlias(this._asFullAlias(value)); + // we got a room id, so the alias is taken + return false; + } catch (err) { + // any server error code will do, + // either it M_NOT_FOUND or the alias is invalid somehow, + // in which case we don't want to show the invalid message + return !!err.errcode; + } + }, + valid: () => _t("This alias is available to use"), + invalid: () => _t("This alias is already in use"), + }, + ], + }); + + get isValid() { + return this.state.isValid; + } + + validate(options) { + return this._fieldRef.validate(options); + } + + focus() { + this._fieldRef.focus(); + } +} From 6ae4b3e966c95b0edc2b8f0d89ab8f2887b7b28a Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 20 Sep 2019 17:46:14 +0200 Subject: [PATCH 06/10] add room alias field to dialog --- .../views/dialogs/CreateRoomDialog.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/components/views/dialogs/CreateRoomDialog.js b/src/components/views/dialogs/CreateRoomDialog.js index b462230c24..501e6b6f80 100644 --- a/src/components/views/dialogs/CreateRoomDialog.js +++ b/src/components/views/dialogs/CreateRoomDialog.js @@ -21,6 +21,7 @@ import sdk from '../../../index'; import SdkConfig from '../../../SdkConfig'; import withValidation from '../elements/Validation'; import { _t } from '../../../languageHandler'; +import MatrixClientPeg from '../../../MatrixClientPeg'; export default createReactClass({ displayName: 'CreateRoomDialog', @@ -34,6 +35,7 @@ export default createReactClass({ isPublic: false, name: "", topic: "", + alias: "", detailsOpen: false, noFederate: config.default_federate === false, nameIsValid: false, @@ -48,6 +50,10 @@ export default createReactClass({ createOpts.preset = "public_chat"; // to prevent createRoom from enabling guest access createOpts['initial_state'] = []; + const {alias} = this.state; + const localPart = alias.substr(1, alias.indexOf(":") - 1); + createOpts['room_alias_name'] = localPart; + } if (this.state.topic) { createOpts.topic = this.state.topic; } @@ -85,6 +91,9 @@ export default createReactClass({ this.setState({isPublic}); }, + onAliasChange(alias) { + this.setState({alias}); + }, onDetailsToggled(ev) { this.setState({detailsOpen: ev.target.open}); @@ -119,10 +128,19 @@ export default createReactClass({ const DialogButtons = sdk.getComponent('views.elements.DialogButtons'); const Field = sdk.getComponent('views.elements.Field'); const LabelledToggleSwitch = sdk.getComponent('views.elements.LabelledToggleSwitch'); + const RoomAliasField = sdk.getComponent('views.elements.RoomAliasField'); + let privateLabel; let publicLabel; + let aliasField; if (this.state.isPublic) { publicLabel = (

{_t("Set a room alias to easily share your room with other people.")}

); + const domain = MatrixClientPeg.get().getDomain(); + aliasField = ( +
+ this._aliasFieldRef = ref} onChange={this.onAliasChange} domain={domain} /> +
+ ); } else { privateLabel = (

{_t("This room is private, and can only be joined by invitation.")}

); } @@ -139,6 +157,7 @@ export default createReactClass({ { privateLabel } { publicLabel } + { aliasField }
{ this.state.detailsOpen ? _t('Hide advanced') : _t('Show advanced') } From 3e0278d41a3893b1540b8d49e5b3a01e52930c85 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 20 Sep 2019 17:46:47 +0200 Subject: [PATCH 07/10] add validation when clicking Ok in dialog --- .../views/dialogs/CreateRoomDialog.js | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/components/views/dialogs/CreateRoomDialog.js b/src/components/views/dialogs/CreateRoomDialog.js index 501e6b6f80..e3070cfef3 100644 --- a/src/components/views/dialogs/CreateRoomDialog.js +++ b/src/components/views/dialogs/CreateRoomDialog.js @@ -72,7 +72,31 @@ export default createReactClass({ }, onOk: async function() { + const activeElement = document.activeElement; + if (activeElement) { + activeElement.blur(); + } + await this._nameFieldRef.validate({allowEmpty: false}); + if (this._aliasFieldRef) { + await this._aliasFieldRef.validate({allowEmpty: false}); + } + // Validation and state updates are async, so we need to wait for them to complete + // first. Queue a `setState` callback and wait for it to resolve. + await new Promise(resolve => this.setState({}, resolve)); + if (this.state.nameIsValid && (!this._aliasFieldRef || this._aliasFieldRef.isValid)) { this.props.onFinished(true, this._roomCreateOptions()); + } else { + let field; + if (!this.state.nameIsValid) { + field = this._nameFieldRef; + } else if (this._aliasFieldRef && !this._aliasFieldRef.isValid) { + field = this._aliasFieldRef; + } + if (field) { + field.focus(); + field.validate({ allowEmpty: false, focused: true }); + } + } }, onCancel: function() { From 6a3723c69e8ccb15fe01445c5c130e1b2627c0b2 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 20 Sep 2019 17:47:02 +0200 Subject: [PATCH 08/10] dialog styling --- res/css/views/dialogs/_CreateRoomDialog.scss | 56 +++++++++++++++++++- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/res/css/views/dialogs/_CreateRoomDialog.scss b/res/css/views/dialogs/_CreateRoomDialog.scss index 05d5bfcebf..d3c41e648f 100644 --- a/res/css/views/dialogs/_CreateRoomDialog.scss +++ b/res/css/views/dialogs/_CreateRoomDialog.scss @@ -14,8 +14,24 @@ See the License for the specific language governing permissions and limitations under the License. */ -.mx_CreateRoomDialog_details_summary { - outline: none; +.mx_CreateRoomDialog_details { + .mx_CreateRoomDialog_details_summary { + outline: none; + list-style: none; + font-weight: 600; + cursor: pointer; + color: $accent-color; + } + + > div { + display: flex; + align-items: start; + margin: 5px 0; + + input[type=checkbox] { + margin-right: 10px; + } + } } .mx_CreateRoomDialog_label { @@ -36,3 +52,39 @@ limitations under the License. background-color: $primary-bg-color; width: 100%; } + +// needed to make the alias field only grow as wide as needed +// as opposed to full width +.mx_CreateRoomDialog_aliasContainer { + display: flex; + // put margin on container so it can collapse with siblings + margin: 10px 0; + + .mx_RoomAliasField { + margin: 0; + } +} + +.mx_CreateRoomDialog { + + &.mx_Dialog_fixedWidth { + width: 450px; + } + + .mx_SettingsFlag { + display: flex; + } + + .mx_SettingsFlag_label { + flex: 1 1 0; + min-width: 0; + font-weight: 600; + } + + .mx_ToggleSwitch { + display: ; + flex: 0 0 auto; + margin-left: 30px; + } +} + From 53b28b9de877a76dd985471efb9ee5e2fb37dbbd Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 20 Sep 2019 17:47:10 +0200 Subject: [PATCH 09/10] i18n --- src/i18n/strings/en_EN.json | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 7ca31a0f94..49302fece1 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1189,6 +1189,12 @@ "Custom level": "Custom level", "Unable to load event that was replied to, it either does not exist or you do not have permission to view it.": "Unable to load event that was replied to, it either does not exist or you do not have permission to view it.", "In reply to ": "In reply to ", + "Room alias": "Room alias", + "e.g. my-room": "e.g. my-room", + "Some characters not allowed": "Some characters not allowed", + "Please provide a room alias": "Please provide a room alias", + "This alias is available to use": "This alias is available to use", + "This alias is already in use": "This alias is already in use", "Room directory": "Room directory", "And %(count)s more...|other": "And %(count)s more...", "ex. @bob:example.com": "ex. @bob:example.com", @@ -1235,11 +1241,18 @@ "Community ID": "Community ID", "example": "example", "Create": "Create", + "Please enter a name for the room": "Please enter a name for the room", + "Set a room alias to easily share your room with other people.": "Set a room alias to easily share your room with other people.", + "This room is private, and can only be joined by invitation.": "This room is private, and can only be joined by invitation.", + "Create a public room": "Create a public room", + "Create a private room": "Create a private room", + "Name": "Name", + "Topic (optional)": "Topic (optional)", + "Make this room public": "Make this room public", + "Hide advanced": "Hide advanced", + "Show advanced": "Show advanced", + "Block users on other matrix homeservers from joining this room (This setting cannot be changed later!)": "Block users on other matrix homeservers from joining this room (This setting cannot be changed later!)", "Create Room": "Create Room", - "Room name (optional)": "Room name (optional)", - "Advanced options": "Advanced options", - "Block users on other matrix homeservers from joining this room": "Block users on other matrix homeservers from joining this room", - "This setting cannot be changed later!": "This setting cannot be changed later!", "Sign out": "Sign out", "To avoid losing your chat history, you must export your room keys before logging out. You will need to go back to the newer version of Riot to do this": "To avoid losing your chat history, you must export your room keys before logging out. You will need to go back to the newer version of Riot to do this", "You've previously used a newer version of Riot on %(host)s. To use this version again with end to end encryption, you will need to sign out and back in again. ": "You've previously used a newer version of Riot on %(host)s. To use this version again with end to end encryption, you will need to sign out and back in again. ", @@ -1496,7 +1509,6 @@ "Doesn't look like a valid phone number": "Doesn't look like a valid phone number", "Use lowercase letters, numbers, dashes and underscores only": "Use lowercase letters, numbers, dashes and underscores only", "Enter username": "Enter username", - "Some characters not allowed": "Some characters not allowed", "Email (optional)": "Email (optional)", "Confirm": "Confirm", "Phone (optional)": "Phone (optional)", @@ -1722,7 +1734,6 @@ "NOT verified": "NOT verified", "Blacklisted": "Blacklisted", "verified": "verified", - "Name": "Name", "Verification": "Verification", "Ed25519 fingerprint": "Ed25519 fingerprint", "User ID": "User ID", From 3c7a0f4c490ee2ad6d320f38860cfda1577bb96c Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 23 Sep 2019 11:18:28 +0200 Subject: [PATCH 10/10] remove invalid css --- res/css/views/dialogs/_CreateRoomDialog.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/res/css/views/dialogs/_CreateRoomDialog.scss b/res/css/views/dialogs/_CreateRoomDialog.scss index d3c41e648f..db59715a77 100644 --- a/res/css/views/dialogs/_CreateRoomDialog.scss +++ b/res/css/views/dialogs/_CreateRoomDialog.scss @@ -82,7 +82,6 @@ limitations under the License. } .mx_ToggleSwitch { - display: ; flex: 0 0 auto; margin-left: 30px; }