diff --git a/.eslintignore.errorfiles b/.eslintignore.errorfiles index 8d0821207a..0b4266c0b5 100644 --- a/.eslintignore.errorfiles +++ b/.eslintignore.errorfiles @@ -7,11 +7,8 @@ src/component-index.js src/components/structures/BottomLeftMenu.js src/components/structures/CompatibilityPage.js src/components/structures/CreateRoom.js -src/components/structures/HomePage.js -src/components/structures/LeftPanel.js src/components/structures/LoggedInView.js src/components/structures/login/ForgotPassword.js -src/components/structures/LoginBox.js src/components/structures/MessagePanel.js src/components/structures/NotificationPanel.js src/components/structures/RoomDirectory.js @@ -22,22 +19,17 @@ src/components/structures/SearchBox.js src/components/structures/TimelinePanel.js src/components/structures/UploadBar.js src/components/structures/UserSettings.js -src/components/structures/ViewSource.js src/components/views/avatars/BaseAvatar.js src/components/views/avatars/MemberAvatar.js src/components/views/create_room/RoomAlias.js -src/components/views/dialogs/ChangelogDialog.js src/components/views/dialogs/DeactivateAccountDialog.js src/components/views/dialogs/SetPasswordDialog.js src/components/views/dialogs/UnknownDeviceDialog.js src/components/views/directory/NetworkDropdown.js src/components/views/elements/AddressSelector.js -src/components/views/elements/DeviceVerifyButtons.js src/components/views/elements/DirectorySearchBox.js src/components/views/elements/ImageView.js -src/components/views/elements/InlineSpinner.js src/components/views/elements/MemberEventListSummary.js -src/components/views/elements/Spinner.js src/components/views/elements/TintableSvg.js src/components/views/elements/UserSelector.js src/components/views/globals/MatrixToolbar.js @@ -90,7 +82,6 @@ src/MatrixClientPeg.js src/Modal.js src/notifications/ContentRules.js src/notifications/PushRuleVectorState.js -src/notifications/StandardActions.js src/notifications/VectorPushRulesDefinitions.js src/Notifier.js src/PlatformPeg.js @@ -111,7 +102,6 @@ src/utils/MultiInviter.js src/utils/Receipt.js src/VectorConferenceHandler.js src/Velociraptor.js -src/VelocityBounce.js src/WhoIsTyping.js src/wrappers/withMatrixClient.js test/components/structures/login/Registration-test.js diff --git a/.travis-test-riot.sh b/.travis-test-riot.sh index 7f2660a906..6cd073a1f8 100755 --- a/.travis-test-riot.sh +++ b/.travis-test-riot.sh @@ -27,12 +27,15 @@ npm run build npm run test popd -# run end to end tests -git clone https://github.com/matrix-org/matrix-react-end-to-end-tests.git --branch master -pushd matrix-react-end-to-end-tests -ln -s $REACT_SDK_DIR/$RIOT_WEB_DIR riot/riot-web -# PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true ./install.sh -# CHROME_PATH=$(which google-chrome-stable) ./run.sh -./install.sh -./run.sh --travis -popd +if [ "$TRAVIS_BRANCH" != "experimental" ] +then + # run end to end tests + git clone https://github.com/matrix-org/matrix-react-end-to-end-tests.git --branch master + pushd matrix-react-end-to-end-tests + ln -s $REACT_SDK_DIR/$RIOT_WEB_DIR riot/riot-web + # PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true ./install.sh + # CHROME_PATH=$(which google-chrome-stable) ./run.sh + ./install.sh + ./run.sh --travis + popd +fi diff --git a/CHANGELOG.md b/CHANGELOG.md index 00b035ac9c..dae09ee2f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,47 @@ +Changes in [0.14.2](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.14.2) (2018-10-29) +===================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.14.2-rc.1...v0.14.2) + + * Fix autoreplacement of ascii emoji + [\#2258](https://github.com/matrix-org/matrix-react-sdk/pull/2258) + +Changes in [0.14.2-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.14.2-rc.1) (2018-10-24) +=============================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.14.1...v0.14.2-rc.1) + + * Update from Weblate. + [\#2244](https://github.com/matrix-org/matrix-react-sdk/pull/2244) + * Show the group member list again + [\#2223](https://github.com/matrix-org/matrix-react-sdk/pull/2223) + * lint: make colorScheme camel case + [\#2237](https://github.com/matrix-org/matrix-react-sdk/pull/2237) + * Change leave room button text, OK -> Leave + [\#2236](https://github.com/matrix-org/matrix-react-sdk/pull/2236) + * Move all dialog buttons to the right and fix their order + [\#2231](https://github.com/matrix-org/matrix-react-sdk/pull/2231) + * Add a bit of text to explain the purpose of the RoomPreviewSpinner + [\#2225](https://github.com/matrix-org/matrix-react-sdk/pull/2225) + * Move the login box from the left sidebar to where the composer is + [\#2219](https://github.com/matrix-org/matrix-react-sdk/pull/2219) + * Fix an error where React doesn't like value=null on a select + [\#2230](https://github.com/matrix-org/matrix-react-sdk/pull/2230) + * add missing sticker translation + [\#2216](https://github.com/matrix-org/matrix-react-sdk/pull/2216) + * Support m.login.terms during registration + [\#2221](https://github.com/matrix-org/matrix-react-sdk/pull/2221) + * Don't show the invite nag bar when peeking + [\#2220](https://github.com/matrix-org/matrix-react-sdk/pull/2220) + * Apply the user's tint once the MatrixClientPeg is moderately ready + [\#2214](https://github.com/matrix-org/matrix-react-sdk/pull/2214) + * Make rageshake use less memory + [\#2217](https://github.com/matrix-org/matrix-react-sdk/pull/2217) + * Fix autocomplete + [\#2212](https://github.com/matrix-org/matrix-react-sdk/pull/2212) + * Explain feature states in a lot more detail + [\#2211](https://github.com/matrix-org/matrix-react-sdk/pull/2211) + * Fix various lint errors + [\#2213](https://github.com/matrix-org/matrix-react-sdk/pull/2213) + Changes in [0.14.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v0.14.1) (2018-10-19) ===================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v0.14.0...v0.14.1) diff --git a/karma.conf.js b/karma.conf.js index 4d699599cb..41ddbdf249 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -199,12 +199,25 @@ module.exports = function (config) { 'matrix-react-sdk': path.resolve('test/skinned-sdk.js'), 'sinon': 'sinon/pkg/sinon.js', + + // To make webpack happy + // Related: https://github.com/request/request/issues/1529 + // (there's no mock available for fs, so we fake a mock by using + // an in-memory version of fs) + "fs": "memfs", }, modules: [ path.resolve('./test'), "node_modules" ], }, + node: { + // Because webpack is made of fail + // https://github.com/request/request/issues/1529 + // Note: 'mock' is the new 'empty' + net: 'mock', + tls: 'mock' + }, devtool: 'inline-source-map', externals: { // Don't try to bundle electron: leave it as a commonjs dependency diff --git a/package.json b/package.json index dabaefe0ad..b72080cd36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "0.14.1", + "version": "0.14.2", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { @@ -76,6 +76,7 @@ "lodash": "^4.13.1", "lolex": "2.3.2", "matrix-js-sdk": "matrix-org/matrix-js-sdk#develop", + "memfs": "^2.10.1", "optimist": "^0.6.1", "pako": "^1.0.5", "prop-types": "^15.5.8", @@ -100,7 +101,7 @@ "devDependencies": { "babel-cli": "^6.26.0", "babel-core": "^6.26.3", - "babel-eslint": "^6.1.2", + "babel-eslint": "^10.0.1", "babel-loader": "^7.1.5", "babel-plugin-add-module-exports": "^0.2.1", "babel-plugin-transform-async-to-bluebird": "^1.1.1", @@ -114,9 +115,9 @@ "babel-preset-react": "^6.24.1", "chokidar": "^1.6.1", "concurrently": "^4.0.1", - "eslint": "^3.13.1", + "eslint": "^5.8.0", "eslint-config-google": "^0.7.1", - "eslint-plugin-babel": "^4.1.2", + "eslint-plugin-babel": "^5.2.1", "eslint-plugin-flowtype": "^2.30.0", "eslint-plugin-react": "^7.7.0", "estree-walker": "^0.5.0", diff --git a/res/css/_common.scss b/res/css/_common.scss index bf67edc1c3..9123e5ba8d 100644 --- a/res/css/_common.scss +++ b/res/css/_common.scss @@ -170,8 +170,7 @@ textarea { font-weight: 300; font-size: 15px; position: relative; - padding-left: 58px; - padding-bottom: 36px; + padding: 0 58px 36px; width: 60%; max-width: 704px; box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.2); @@ -216,14 +215,13 @@ textarea { } .mx_Dialog_content { - margin: 24px 58px 68px 0; + margin: 24px 0 68px; font-size: 14px; color: $primary-fg-color; word-wrap: break-word; } .mx_Dialog_buttons { - padding-right: 58px; text-align: right; } diff --git a/res/css/views/context_menus/_TagTileContextMenu.scss b/res/css/views/context_menus/_TagTileContextMenu.scss index 759b92bd68..799151b198 100644 --- a/res/css/views/context_menus/_TagTileContextMenu.scss +++ b/res/css/views/context_menus/_TagTileContextMenu.scss @@ -25,6 +25,10 @@ limitations under the License. line-height: 16px; } +.mx_TagTileContextMenu_item object { + pointer-events: none; +} + .mx_TagTileContextMenu_item_icon { padding-right: 8px; diff --git a/res/css/views/dialogs/_DevtoolsDialog.scss b/res/css/views/dialogs/_DevtoolsDialog.scss index 3764bb13b3..a4a868bd11 100644 --- a/res/css/views/dialogs/_DevtoolsDialog.scss +++ b/res/css/views/dialogs/_DevtoolsDialog.scss @@ -14,10 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -.mx_DevTools_dialog { - padding-right: 58px; -} - .mx_DevTools_content { margin: 10px 0; } diff --git a/res/css/views/dialogs/_ShareDialog.scss b/res/css/views/dialogs/_ShareDialog.scss index 116bef8dfd..9a2f67dea3 100644 --- a/res/css/views/dialogs/_ShareDialog.scss +++ b/res/css/views/dialogs/_ShareDialog.scss @@ -14,11 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -.mx_ShareDialog { - // this is to center the content - padding-right: 58px; -} - .mx_ShareDialog hr { margin-top: 25px; margin-bottom: 25px; diff --git a/res/css/views/dialogs/_UnknownDeviceDialog.scss b/res/css/views/dialogs/_UnknownDeviceDialog.scss index 3457e50b92..e3801e3550 100644 --- a/res/css/views/dialogs/_UnknownDeviceDialog.scss +++ b/res/css/views/dialogs/_UnknownDeviceDialog.scss @@ -20,9 +20,6 @@ limitations under the License. // is a pain in the ass. plus might as well make the dialog big given how // important it is. height: 100%; - - // position the gemini scrollbar nicely - padding-right: 58px; } .mx_UnknownDeviceDialog { @@ -51,4 +48,4 @@ limitations under the License. .mx_UnknownDeviceDialog .mx_UnknownDeviceDialog_deviceList li { height: 40px; border-bottom: 1px solid $primary-hairline-color; -} \ No newline at end of file +} diff --git a/res/css/views/elements/_RoleButton.scss b/res/css/views/elements/_RoleButton.scss index 094e0b9b1b..41cd11d7c1 100644 --- a/res/css/views/elements/_RoleButton.scss +++ b/res/css/views/elements/_RoleButton.scss @@ -1,5 +1,5 @@ /* -Copyright 2107 Vector Creations Ltd +Copyright 2017 Vector Creations Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/res/css/views/rooms/_RoomList.scss b/res/css/views/rooms/_RoomList.scss index 581016d5ba..a346a06a20 100644 --- a/res/css/views/rooms/_RoomList.scss +++ b/res/css/views/rooms/_RoomList.scss @@ -1,6 +1,6 @@ /* Copyright 2015, 2016 OpenMarket Ltd -Copyright 2107 Vector Creations Ltd +Copyright 2017 Vector Creations Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/src/ComposerHistoryManager.js b/src/ComposerHistoryManager.js index 0164e6c4cd..ecf773f2e7 100644 --- a/src/ComposerHistoryManager.js +++ b/src/ComposerHistoryManager.js @@ -22,7 +22,6 @@ import _clamp from 'lodash/clamp'; type MessageFormat = 'rich' | 'markdown'; class HistoryItem { - // We store history items in their native format to ensure history is accurate // and then convert them if our RTE has subsequently changed format. value: Value; diff --git a/src/Entities.js b/src/Entities.js index 21abd9c473..8be1da0db8 100644 --- a/src/Entities.js +++ b/src/Entities.js @@ -78,7 +78,6 @@ class MemberEntity extends Entity { } class UserEntity extends Entity { - constructor(model, showInviteButton, inviteFn) { super(model); this.showInviteButton = Boolean(showInviteButton); diff --git a/src/HtmlUtils.js b/src/HtmlUtils.js index b6a2bd0acb..e72c0bfe4b 100644 --- a/src/HtmlUtils.js +++ b/src/HtmlUtils.js @@ -64,7 +64,7 @@ export function containsEmoji(str) { * because we want to include emoji shortnames in title text */ function unicodeToImage(str) { - let replaceWith, unicode, alt, short, fname; + let replaceWith; let unicode; let alt; let short; let fname; const mappedUnicode = emojione.mapUnicodeToShort(); str = str.replace(emojione.regUnicode, function(unicodeChar) { diff --git a/src/PasswordReset.js b/src/PasswordReset.js index 71fc4f6b31..df51e4d846 100644 --- a/src/PasswordReset.js +++ b/src/PasswordReset.js @@ -25,7 +25,6 @@ import { _t } from './languageHandler'; * API on the homeserver in question with the new password. */ class PasswordReset { - /** * Configure the endpoints for password resetting. * @param {string} homeserverUrl The URL to the HS which has the account to reset. diff --git a/src/Presence.js b/src/Presence.js index 9367fe35cd..b1e85e4bc7 100644 --- a/src/Presence.js +++ b/src/Presence.js @@ -23,7 +23,6 @@ const UNAVAILABLE_TIME_MS = 3 * 60 * 1000; // 3 mins const PRESENCE_STATES = ["online", "offline", "unavailable"]; class Presence { - /** * Start listening the user activity to evaluate his presence state. * Any state change will be sent to the Home Server. diff --git a/src/Rooms.js b/src/Rooms.js index e24b8316b3..6f73ea0659 100644 --- a/src/Rooms.js +++ b/src/Rooms.js @@ -32,7 +32,6 @@ export function getDisplayAliasForRoom(room) { * return the other one. Otherwise, return null. */ export function getOnlyOtherMember(room, myUserId) { - if (room.currentState.getJoinedMemberCount() === 2) { return room.getJoinedMembers().filter(function(m) { return m.userId !== myUserId; @@ -103,7 +102,7 @@ export function guessAndSetDMRoom(room, isDirect) { let newTarget; if (isDirect) { const guessedUserId = guessDMRoomTargetId( - room, MatrixClientPeg.get().getUserId() + room, MatrixClientPeg.get().getUserId(), ); newTarget = guessedUserId; } else { diff --git a/src/ScalarAuthClient.js b/src/ScalarAuthClient.js index 2038430576..0639e7ceae 100644 --- a/src/ScalarAuthClient.js +++ b/src/ScalarAuthClient.js @@ -22,7 +22,6 @@ const SdkConfig = require('./SdkConfig'); const MatrixClientPeg = require('./MatrixClientPeg'); class ScalarAuthClient { - constructor() { this.scalarToken = null; } diff --git a/src/SdkConfig.js b/src/SdkConfig.js index 8df725a913..65982bd6f2 100644 --- a/src/SdkConfig.js +++ b/src/SdkConfig.js @@ -24,7 +24,6 @@ const DEFAULTS = { }; class SdkConfig { - static get() { return global.mxReactSdkConfig || {}; } diff --git a/src/UserActivity.js b/src/UserActivity.js index b6fae38ed5..c628ab4186 100644 --- a/src/UserActivity.js +++ b/src/UserActivity.js @@ -25,7 +25,6 @@ const CURRENTLY_ACTIVE_THRESHOLD_MS = 2000; * with the app (but at a much lower frequency than mouse move events) */ class UserActivity { - /** * Start listening to user activity */ diff --git a/src/UserSettingsStore.js b/src/UserSettingsStore.js index 5d2af3715f..b40d0529a2 100644 --- a/src/UserSettingsStore.js +++ b/src/UserSettingsStore.js @@ -87,7 +87,7 @@ export default { device_display_name: address, lang: navigator.language, data: data, - append: true, // We always append for email pushers since we don't want to stop other accounts notifying to the same email address + append: true, // We always append for email pushers since we don't want to stop other accounts notifying to the same email address }); }, }; diff --git a/src/VelocityBounce.js b/src/VelocityBounce.js index 2141b05325..b9513249b8 100644 --- a/src/VelocityBounce.js +++ b/src/VelocityBounce.js @@ -3,8 +3,8 @@ const Velocity = require('velocity-vector'); // courtesy of https://github.com/julianshapiro/velocity/issues/283 // We only use easeOutBounce (easeInBounce is just sort of nonsensical) function bounce( p ) { - let pow2, - bounce = 4; + let pow2; + let bounce = 4; while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) { // just sets pow2 diff --git a/src/autocomplete/Autocompleter.js b/src/autocomplete/Autocompleter.js index 7f91676cc3..e7b89fe576 100644 --- a/src/autocomplete/Autocompleter.js +++ b/src/autocomplete/Autocompleter.js @@ -85,7 +85,7 @@ export default class Autocompleter { provider .getCompletions(query, selection, force) .timeout(PROVIDER_COMPLETION_TIMEOUT) - .reflect() + .reflect(), ), ); diff --git a/src/autocomplete/CommunityProvider.js b/src/autocomplete/CommunityProvider.js index d164fab46a..b85c09b320 100644 --- a/src/autocomplete/CommunityProvider.js +++ b/src/autocomplete/CommunityProvider.js @@ -61,7 +61,7 @@ export default class CommunityProvider extends AutocompleteProvider { if (command) { const joinedGroups = cli.getGroups().filter(({myMembership}) => myMembership === 'join'); - const groups = (await Promise.all(joinedGroups.map(async ({groupId}) => { + const groups = (await Promise.all(joinedGroups.map(async({groupId}) => { try { return FlairStore.getGroupProfileCached(cli, groupId); } catch (e) { // if FlairStore failed, fall back to just groupId diff --git a/src/autocomplete/PlainWithPillsSerializer.js b/src/autocomplete/PlainWithPillsSerializer.js index 59cf1bde3b..09bb3772ac 100644 --- a/src/autocomplete/PlainWithPillsSerializer.js +++ b/src/autocomplete/PlainWithPillsSerializer.js @@ -26,7 +26,6 @@ import { Block } from 'slate'; */ class PlainWithPillsSerializer { - /* * @param {String} options.pillFormat - either 'md', 'plain', 'id' */ diff --git a/src/components/structures/BottomLeftMenu.js b/src/components/structures/BottomLeftMenu.js index d289ca5da1..ed8b8a00b7 100644 --- a/src/components/structures/BottomLeftMenu.js +++ b/src/components/structures/BottomLeftMenu.js @@ -33,12 +33,12 @@ module.exports = React.createClass({ }, getInitialState: function() { - return({ - directoryHover : false, - roomsHover : false, + return ({ + directoryHover: false, + roomsHover: false, homeHover: false, - peopleHover : false, - settingsHover : false, + peopleHover: false, + settingsHover: false, }); }, @@ -145,7 +145,7 @@ module.exports = React.createClass({ // Get the label/tooltip to show getLabel: function(label, show) { if (show) { - var RoomTooltip = sdk.getComponent("rooms.RoomTooltip"); + const RoomTooltip = sdk.getComponent("rooms.RoomTooltip"); return ; } }, diff --git a/src/components/structures/CompatibilityPage.js b/src/components/structures/CompatibilityPage.js index 4cbaab3dfa..3c5005c053 100644 --- a/src/components/structures/CompatibilityPage.js +++ b/src/components/structures/CompatibilityPage.js @@ -16,18 +16,18 @@ limitations under the License. 'use strict'; -var React = require('react'); +const React = require('react'); import { _t } from '../../languageHandler'; module.exports = React.createClass({ displayName: 'CompatibilityPage', propTypes: { - onAccept: React.PropTypes.func + onAccept: React.PropTypes.func, }, getDefaultProps: function() { return { - onAccept: function() {} // NOP + onAccept: function() {}, // NOP }; }, @@ -36,7 +36,6 @@ module.exports = React.createClass({ }, render: function() { - return (
@@ -69,5 +68,5 @@ module.exports = React.createClass({
); - } + }, }); diff --git a/src/components/structures/CreateRoom.js b/src/components/structures/CreateRoom.js index 2bb9adb544..a8aac71479 100644 --- a/src/components/structures/CreateRoom.js +++ b/src/components/structures/CreateRoom.js @@ -36,10 +36,10 @@ module.exports = React.createClass({ }, phases: { - CONFIG: "CONFIG", // We're waiting for user to configure and hit create. - CREATING: "CREATING", // We're sending the request. - CREATED: "CREATED", // We successfully created the room. - ERROR: "ERROR", // There was an error while trying to create room. + CONFIG: "CONFIG", // We're waiting for user to configure and hit create. + CREATING: "CREATING", // We're sending the request. + CREATED: "CREATED", // We successfully created the room. + ERROR: "ERROR", // There was an error while trying to create room. }, getDefaultProps: function() { diff --git a/src/components/structures/GroupView.js b/src/components/structures/GroupView.js index 5d23194702..2c287c1b60 100644 --- a/src/components/structures/GroupView.js +++ b/src/components/structures/GroupView.js @@ -777,7 +777,7 @@ export default React.createClass({ ), button: _t("Leave"), danger: this.state.isUserPrivileged, - onFinished: async (confirmed) => { + onFinished: async(confirmed) => { if (!confirmed) return; this.setState({membershipBusy: true}); diff --git a/src/components/structures/HomePage.js b/src/components/structures/HomePage.js index 457796f5dc..89053b35c7 100644 --- a/src/components/structures/HomePage.js +++ b/src/components/structures/HomePage.js @@ -52,15 +52,14 @@ class HomePage extends React.Component { if (this.props.teamToken && this.props.teamServerUrl) { this.setState({ - iframeSrc: `${this.props.teamServerUrl}/static/${this.props.teamToken}/home.html` + iframeSrc: `${this.props.teamServerUrl}/static/${this.props.teamToken}/home.html`, }); - } - else { + } else { // we use request() to inline the homepage into the react component // so that it can inherit CSS and theming easily rather than mess around // with iframes and trying to synchronise document.stylesheets. - let src = this.props.homePageUrl || 'home.html'; + const src = this.props.homePageUrl || 'home.html'; request( { method: "GET", url: src }, @@ -77,7 +76,7 @@ class HomePage extends React.Component { body = body.replace(/_t\(['"]([\s\S]*?)['"]\)/mg, (match, g1)=>this.translate(g1)); this.setState({ page: body }); - } + }, ); } } @@ -93,8 +92,7 @@ class HomePage extends React.Component {