From 5edb5f6487404b89da45f13f3d8444dd1f533d0f Mon Sep 17 00:00:00 2001 From: Jani Mustonen Date: Fri, 6 Jan 2017 01:37:12 +0200 Subject: [PATCH 01/34] Turned divs to button-likes to comply with MDN's recommendations --- src/components/structures/BottomLeftMenu.js | 17 ++++---- src/components/structures/RightPanel.js | 17 +++++--- src/components/structures/RoomSubList.js | 13 +++--- src/components/structures/SearchBox.js | 43 +++++++++++++++---- src/components/views/elements/ImageView.js | 3 +- src/components/views/globals/MatrixToolbar.js | 3 +- src/components/views/rooms/SearchBar.js | 11 ++--- 7 files changed, 74 insertions(+), 33 deletions(-) diff --git a/src/components/structures/BottomLeftMenu.js b/src/components/structures/BottomLeftMenu.js index 0ea35b4ecb..1e352fa12a 100644 --- a/src/components/structures/BottomLeftMenu.js +++ b/src/components/structures/BottomLeftMenu.js @@ -20,6 +20,7 @@ var React = require('react'); var ReactDOM = require('react-dom'); var sdk = require('matrix-react-sdk') var dis = require('matrix-react-sdk/lib/dispatcher'); +var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton'); module.exports = React.createClass({ displayName: 'BottomLeftMenu', @@ -101,22 +102,22 @@ module.exports = React.createClass({ return (
-
+ { this.getLabel("Start chat", this.state.peopleHover) } -
-
+ + { this.getLabel("Room directory", this.state.directoryHover) } -
-
+ + { this.getLabel("Create new room", this.state.roomsHover) } -
-
+ + { this.getLabel("Settings", this.state.settingsHover) } -
+
); diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index d1622e5f41..7bd5d3b9ed 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -23,6 +23,7 @@ var dis = require('matrix-react-sdk/lib/dispatcher'); var MatrixClientPeg = require("matrix-react-sdk/lib/MatrixClientPeg"); var rate_limited_func = require('matrix-react-sdk/lib/ratelimitedfunc'); var Modal = require('matrix-react-sdk/lib/Modal'); +var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton'); module.exports = React.createClass({ displayName: 'RightPanel', @@ -207,12 +208,12 @@ module.exports = React.createClass({ if (user_is_in_room) { inviteGroup = -
+
Invite to this room
-
; + ; } } @@ -220,20 +221,26 @@ module.exports = React.createClass({ if (this.props.roomId) { buttonGroup =
-
+
+
{ membersBadge ? membersBadge :  }
{ membersHighlight } +
-
+
+
 
{ filesHighlight } +
-
+
+
 
{ notificationsHighlight } +
; } diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index e87f3f8a33..af8500df77 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -26,6 +26,7 @@ var Unread = require('matrix-react-sdk/lib/Unread'); var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); var RoomNotifs = require('matrix-react-sdk/lib/RoomNotifs'); var FormattingUtils = require('matrix-react-sdk/lib/utils/FormattingUtils'); +var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton'); // turn this on for drop & drag console debugging galore var debug = false; @@ -417,15 +418,17 @@ var RoomSubList = React.createClass({ } } + var tabindex = this.props.searchFilter === "" ? "0" : "-1"; + return (
-
+ { this.props.collapsed ? '' : this.props.label }
{ roomCount }
{ badge } { incomingCall } -
+
); }, @@ -447,11 +450,11 @@ var RoomSubList = React.createClass({ }); return ( -
+
more
-
{ content }
-
+
{ content }
+ ); }, diff --git a/src/components/structures/SearchBox.js b/src/components/structures/SearchBox.js index 7fc5100049..036ff3f15c 100644 --- a/src/components/structures/SearchBox.js +++ b/src/components/structures/SearchBox.js @@ -20,6 +20,7 @@ var React = require('react'); var sdk = require('matrix-react-sdk') var dis = require('matrix-react-sdk/lib/dispatcher'); var rate_limited_func = require('matrix-react-sdk/lib/ratelimitedfunc'); +var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton'); module.exports = React.createClass({ displayName: 'SearchBox', @@ -35,6 +36,25 @@ module.exports = React.createClass({ }; }, + componentDidMount: function() { + this.dispatcherRef = dis.register(this.onAction); + }, + + componentWillUnmount: function() { + dis.unregister(this.dispatcherRef); + }, + + onAction: function(payload) { + switch (payload.action) { + // Clear up the text field when a room is selected. + case 'view_room': + if (this.refs.search) { + this._clearSearch(); + } + break; + } + }, + onChange: function() { if (!this.refs.search) return; this.setState({ searchTerm: this.refs.search.value }); @@ -61,35 +81,42 @@ module.exports = React.createClass({ } }, + _clearSearch: function() { + this.refs.search.value = ""; + this.onChange(); + }, + render: function() { var TintableSvg = sdk.getComponent('elements.TintableSvg'); + var collapseTabIndex = this.refs.search && this.refs.search.value !== "" ? "-1" : "0"; + var toggleCollapse; if (this.props.collapsed) { toggleCollapse = -
+ -
+ } else { toggleCollapse = -
+ -
+ } var searchControls; if (!this.props.collapsed) { searchControls = [ this.state.searchTerm.length > 0 ? -
{ this.refs.search.value = ""; this.onChange(); } }> + { this._clearSearch(); } }> -
+ :
- Close + Close
diff --git a/src/components/views/globals/MatrixToolbar.js b/src/components/views/globals/MatrixToolbar.js index a22e15ffc1..dbe4196aad 100644 --- a/src/components/views/globals/MatrixToolbar.js +++ b/src/components/views/globals/MatrixToolbar.js @@ -19,6 +19,7 @@ limitations under the License. var React = require('react'); var Notifier = require("matrix-react-sdk/lib/Notifier"); var sdk = require('matrix-react-sdk') +var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton'); module.exports = React.createClass({ displayName: 'MatrixToolbar', @@ -38,7 +39,7 @@ module.exports = React.createClass({
You are not receiving desktop notifications. Enable them now
-
+
); } diff --git a/src/components/views/rooms/SearchBar.js b/src/components/views/rooms/SearchBar.js index 99e7706416..1653f269a8 100644 --- a/src/components/views/rooms/SearchBar.js +++ b/src/components/views/rooms/SearchBar.js @@ -20,6 +20,7 @@ var React = require('react'); var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); var sdk = require('matrix-react-sdk'); var classNames = require('classnames'); +var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton'); module.exports = React.createClass({ displayName: 'SearchBar', @@ -57,12 +58,12 @@ module.exports = React.createClass({ var allRoomsClasses = classNames({ mx_SearchBar_button : true, mx_SearchBar_unselected : this.state.scope !== 'All' }); return ( -
+
-
Search
-
This Room
-
All Rooms
- + Search + This Room + All Rooms +
); } From 9d034c77a5a226cbefd51a2faed35b750398d229 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 25 Jan 2017 17:27:07 +0000 Subject: [PATCH 02/34] Initial rageshake server --- scripts/rageshake.go | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 scripts/rageshake.go diff --git a/scripts/rageshake.go b/scripts/rageshake.go new file mode 100644 index 0000000000..883dd4fa1f --- /dev/null +++ b/scripts/rageshake.go @@ -0,0 +1,53 @@ +// Run a web server capable of dumping bug reports sent by Riot. +// Requires Go 1.5+ +// Usage: go run rageshake.go PORT +// Example: go run rageshake.go 8080 +package main + +import ( + "encoding/json" + "fmt" + "log" + "net/http" + "os" +) + +type LogEntry struct { + ID string `json:"id"` + Lines string `json:"lines"` +} + +type Payload struct { + Text string `json:"text"` + Version string `json:"version"` + UserAgent string `json:"user_agent"` + Logs []LogEntry `json:"logs"` +} + +func main() { + http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { + if req.Method != "POST" && req.Method != "OPTIONS" { + w.WriteHeader(405) + return + } + // Set CORS + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS") + w.Header().Set("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept") + if req.Method == "OPTIONS" { + return; + } + var p Payload + if err := json.NewDecoder(req.Body).Decode(&p); err != nil { + w.WriteHeader(400) + w.Write([]byte("Body is not JSON")) + return + } + // Dump bug report to disk + fmt.Println(p) + + }) + + port := os.Args[1] + log.Fatal(http.ListenAndServe(":"+port, nil)) +} From e8c51a0b543987ce416651c2b52a586eab07fb61 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 26 Jan 2017 11:28:38 +0000 Subject: [PATCH 03/34] gzip bug reports when storing on disk. Set max payload size --- scripts/rageshake.go | 70 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 56 insertions(+), 14 deletions(-) diff --git a/scripts/rageshake.go b/scripts/rageshake.go index 883dd4fa1f..317b94ec78 100644 --- a/scripts/rageshake.go +++ b/scripts/rageshake.go @@ -5,13 +5,19 @@ package main import ( + "bytes" + "compress/gzip" "encoding/json" - "fmt" + "io/ioutil" "log" "net/http" "os" + "strconv" + "time" ) +var maxPayloadSize = 1024 * 1024 * 55 // 55 MB + type LogEntry struct { ID string `json:"id"` Lines string `json:"lines"` @@ -24,28 +30,64 @@ type Payload struct { Logs []LogEntry `json:"logs"` } +func respond(code int, w http.ResponseWriter) { + w.WriteHeader(code) + w.Write([]byte("{}")) +} + +func gzipAndSave(data []byte, filepath string) error { + var b bytes.Buffer + gz := gzip.NewWriter(&b) + if _, err := gz.Write(data); err != nil { + return err + } + if err := gz.Flush(); err != nil { + return err + } + if err := gz.Close(); err != nil { + return err + } + if err := ioutil.WriteFile(filepath, b.Bytes(), 0644); err != nil { + return err + } + return nil +} + func main() { http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { if req.Method != "POST" && req.Method != "OPTIONS" { - w.WriteHeader(405) + respond(405, w) + return + } + // Set CORS + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS") + w.Header().Set("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept") + if req.Method == "OPTIONS" { + respond(200, w) + return + } + if length, err := strconv.Atoi(req.Header.Get("Content-Length")); err != nil || length > maxPayloadSize { + respond(413, w) return } - // Set CORS - w.Header().Set("Access-Control-Allow-Origin", "*") - w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS") - w.Header().Set("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept") - if req.Method == "OPTIONS" { - return; - } var p Payload if err := json.NewDecoder(req.Body).Decode(&p); err != nil { - w.WriteHeader(400) - w.Write([]byte("Body is not JSON")) + respond(400, w) return } - // Dump bug report to disk - fmt.Println(p) - + // Dump bug report to disk as form: + // "bugreport-20170115-112233.log.gz" => user text, version, user agent, # logs + // "bugreport-20170115-112233-0.log.gz" => most recent log + // "bugreport-20170115-112233-1.log.gz" => ... + // "bugreport-20170115-112233-N.log.gz" => oldest log + t := time.Now() + prefix := t.Format("bugreport-20060102-150405") + if err := gzipAndSave([]byte(p.Text), prefix+".log.gz"); err != nil { + respond(500, w) + return + } + respond(200, w) }) port := os.Args[1] From aae62ff94e79c4c5ba5f98f8f801a90529aaef4f Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 26 Jan 2017 11:44:07 +0000 Subject: [PATCH 04/34] store logs --- scripts/rageshake.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/rageshake.go b/scripts/rageshake.go index 317b94ec78..6ffd14768d 100644 --- a/scripts/rageshake.go +++ b/scripts/rageshake.go @@ -8,6 +8,7 @@ import ( "bytes" "compress/gzip" "encoding/json" + "fmt" "io/ioutil" "log" "net/http" @@ -83,10 +84,19 @@ func main() { // "bugreport-20170115-112233-N.log.gz" => oldest log t := time.Now() prefix := t.Format("bugreport-20060102-150405") - if err := gzipAndSave([]byte(p.Text), prefix+".log.gz"); err != nil { + summary := fmt.Sprintf( + "%s\n\nNumber of logs: %d\nVersion: %s\nUser-Agent: %s\n", p.Text, len(p.Logs), p.Version, p.UserAgent, + ) + if err := gzipAndSave([]byte(summary), prefix+".log.gz"); err != nil { respond(500, w) return } + for i, log := range p.Logs { + if err := gzipAndSave([]byte(log.Lines), fmt.Sprintf("%s-%d.log.gz", prefix, i)); err != nil { + respond(500, w) + return // TODO: Rollback? + } + } respond(200, w) }) From 6a40ad8a2073de4ae05f1b31cb9e3237ea776153 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 26 Jan 2017 11:57:56 +0000 Subject: [PATCH 05/34] Fail the request if we clash files Rather than make the file names incredibly long (by adding ms), just 500 it and expect the user to resend. --- scripts/rageshake.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/rageshake.go b/scripts/rageshake.go index 6ffd14768d..51532890b0 100644 --- a/scripts/rageshake.go +++ b/scripts/rageshake.go @@ -37,6 +37,9 @@ func respond(code int, w http.ResponseWriter) { } func gzipAndSave(data []byte, filepath string) error { + if _, err := os.Stat(filepath); err == nil { + return fmt.Errorf("file already exists") // the user can just retry + } var b bytes.Buffer gz := gzip.NewWriter(&b) if _, err := gz.Write(data); err != nil { From 22bb0f9d309baddf395281d48897270d916fed82 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 26 Jan 2017 12:17:47 +0000 Subject: [PATCH 06/34] UTC please --- scripts/rageshake.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/rageshake.go b/scripts/rageshake.go index 51532890b0..ebf94e67ac 100644 --- a/scripts/rageshake.go +++ b/scripts/rageshake.go @@ -85,7 +85,7 @@ func main() { // "bugreport-20170115-112233-0.log.gz" => most recent log // "bugreport-20170115-112233-1.log.gz" => ... // "bugreport-20170115-112233-N.log.gz" => oldest log - t := time.Now() + t := time.Now().UTC() prefix := t.Format("bugreport-20060102-150405") summary := fmt.Sprintf( "%s\n\nNumber of logs: %d\nVersion: %s\nUser-Agent: %s\n", p.Text, len(p.Logs), p.Version, p.UserAgent, From 874e32699ab6233f8b5e9957eb934931a008a27e Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 2 Feb 2017 11:30:14 +0000 Subject: [PATCH 07/34] Handle icons with width > height Icons with width > height will now only assume a max-height of 100% as opposed to a height of 100%. This is so they don't overflow the width of 300px. --- .../vector/css/matrix-react-sdk/structures/login/_Login.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/skins/vector/css/matrix-react-sdk/structures/login/_Login.scss b/src/skins/vector/css/matrix-react-sdk/structures/login/_Login.scss index 39c65e5d18..a359627af3 100644 --- a/src/skins/vector/css/matrix-react-sdk/structures/login/_Login.scss +++ b/src/skins/vector/css/matrix-react-sdk/structures/login/_Login.scss @@ -46,7 +46,7 @@ limitations under the License. } .mx_Login_logo img { - height: 100% + max-height: 100% } .mx_Login_support { From c4a590f6afd0468e6e124e443d73c300739b4e36 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 2 Feb 2017 16:18:12 +0000 Subject: [PATCH 08/34] CSS for empty timelinepanels --- .../css/matrix-react-sdk/structures/_RoomView.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/skins/vector/css/matrix-react-sdk/structures/_RoomView.scss b/src/skins/vector/css/matrix-react-sdk/structures/_RoomView.scss index 55771f7945..37c68ad9e6 100644 --- a/src/skins/vector/css/matrix-react-sdk/structures/_RoomView.scss +++ b/src/skins/vector/css/matrix-react-sdk/structures/_RoomView.scss @@ -107,6 +107,16 @@ limitations under the License. justify-content: flex-start; } +.mx_RoomView_empty { + flex: 1 1 auto; + font-size: 13px; + padding-left: 3em; + padding-right: 3em; + margin-right: 20px; + margin-top: 33%; + text-align: center; +} + .mx_RoomView_MessageList { width: 100%; list-style-type: none; From 4c3a723aa8c7dc219e8699a1a9315648d162b756 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 2 Feb 2017 18:42:03 +0000 Subject: [PATCH 09/34] make TopRightMenu more intuitive should fix https://github.com/vector-im/riot-web/issues/2827 --- src/components/structures/RightPanel.js | 45 +++++-------------- src/components/structures/SearchBox.js | 4 +- .../vector-web/structures/_RightPanel.scss | 11 ++++- 3 files changed, 23 insertions(+), 37 deletions(-) diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index d1622e5f41..1adc31649e 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -69,45 +69,21 @@ module.exports = React.createClass({ }, onMemberListButtonClick: function() { - if (this.props.collapsed || this.state.phase !== this.Phase.MemberList) { - this.setState({ phase: this.Phase.MemberList }); - dis.dispatch({ - action: 'show_right_panel', - }); - } - else { - dis.dispatch({ - action: 'hide_right_panel', - }); - } + this.setState({ phase: this.Phase.MemberList }); }, onFileListButtonClick: function() { - if (this.props.collapsed || this.state.phase !== this.Phase.FilePanel) { - this.setState({ phase: this.Phase.FilePanel }); - dis.dispatch({ - action: 'show_right_panel', - }); - } - else { - dis.dispatch({ - action: 'hide_right_panel', - }); - } + this.setState({ phase: this.Phase.FilePanel }); }, onNotificationListButtonClick: function() { - if (this.props.collapsed || this.state.phase !== this.Phase.NotificationPanel) { - this.setState({ phase: this.Phase.NotificationPanel }); - dis.dispatch({ - action: 'show_right_panel', - }); - } - else { - dis.dispatch({ - action: 'hide_right_panel', - }); - } + this.setState({ phase: this.Phase.NotificationPanel }); + }, + + onCollapseClick: function() { + dis.dispatch({ + action: 'hide_right_panel', + }); }, onInviteButtonClick: function() { @@ -235,6 +211,9 @@ module.exports = React.createClass({ { notificationsHighlight }
+
+ +
; } diff --git a/src/components/structures/SearchBox.js b/src/components/structures/SearchBox.js index 7fc5100049..20181f75b4 100644 --- a/src/components/structures/SearchBox.js +++ b/src/components/structures/SearchBox.js @@ -68,13 +68,13 @@ module.exports = React.createClass({ if (this.props.collapsed) { toggleCollapse =
- +
} else { toggleCollapse =
- +
} diff --git a/src/skins/vector/css/vector-web/structures/_RightPanel.scss b/src/skins/vector/css/vector-web/structures/_RightPanel.scss index 91034e633d..c0872e82d7 100644 --- a/src/skins/vector/css/vector-web/structures/_RightPanel.scss +++ b/src/skins/vector/css/vector-web/structures/_RightPanel.scss @@ -34,14 +34,15 @@ limitations under the License. .mx_RightPanel_headerButtonGroup { margin-top: 6px; - float: left; + display: flex; + width: 100%; background-color: $primary-bg-color; margin-left: 0px; } .mx_RightPanel_headerButton { cursor: pointer; - display: table-cell; + flex: 0; vertical-align: top; padding-left: 4px; padding-right: 5px; @@ -69,6 +70,12 @@ limitations under the License. padding-bottom: 2px; } +.mx_RightPanel_collapsebutton { + flex: 1; + text-align: right; + margin-top: 20px; +} + .mx_RightPanel .mx_MemberList, .mx_RightPanel .mx_MemberInfo, .mx_RightPanel_blank { From 3903954bf22290ac133e7972d71752ab67d21504 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 2 Feb 2017 19:35:36 +0000 Subject: [PATCH 10/34] Allow mxc: URLs for icons in the NetworkDropdown For https://github.com/vector-im/riot-web/issues/3086 --- src/components/views/directory/NetworkDropdown.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/views/directory/NetworkDropdown.js b/src/components/views/directory/NetworkDropdown.js index 4ce094bc37..c891ee5b29 100644 --- a/src/components/views/directory/NetworkDropdown.js +++ b/src/components/views/directory/NetworkDropdown.js @@ -181,7 +181,10 @@ export default class NetworkDropdown extends React.Component { span_class = 'mx_NetworkDropdown_menu_network'; } else { key = server + '_inst_' + instance.instance_id; - icon = ; + const imgUrl = instance.icon ? + MatrixClientPeg.get().mxcUrlToHttp(instance.icon, 25, 25, 'crop', true) : + DEFAULT_ICON_URL; + icon = ; name = instance.desc; span_class = 'mx_NetworkDropdown_menu_network'; } From 1c2de1e483210f93ebe8163a36fd1468403b725d Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 2 Feb 2017 23:31:22 +0000 Subject: [PATCH 11/34] Refactor karma config - rename test:multi npm target to test-multi, for consistency with react-sdk - base karma webpack config on the distribution one - include Olm if we have it - don't use the karma source loader - it's pointless given we webpack everything. - turn off module listing in the webpack stats to shorten the console output --- karma.conf.js | 105 ++++++++++++++++++++++++-------------------------- package.json | 3 +- 2 files changed, 51 insertions(+), 57 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 901832c78c..b0a48c92ba 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -2,13 +2,14 @@ var path = require('path'); var webpack = require('webpack'); +var webpack_config = require('./webpack.config'); /* * We use webpack to build our tests. It's a pain to have to wait for webpack * to build everything; however it's the easiest way to load our dependencies * from node_modules. * - * If you run karma in multi-run mode (with `npm run test:multi`), it will watch + * If you run karma in multi-run mode (with `npm run test-multi`), it will watch * the tests for changes, and webpack will rebuild using a cache. This is much quicker * than a clean rebuild. */ @@ -19,8 +20,41 @@ var testFile = process.env.KARMA_TEST_FILE || 'test/all-tests.js'; process.env.PHANTOMJS_BIN = 'node_modules/.bin/phantomjs'; process.env.Q_DEBUG = 1; +/* the webpack config is based on the real one, to (a) try to simulate the + * deployed environment as closely as possible, and (b) to avoid a shedload of + * cut-and-paste. + */ + +// find out if we're shipping olm, and where it is, if so. +const olm_entry = webpack_config.entry['olm']; + +// remove the default entries - karma provides its own (via the 'files' and +// 'preprocessors' config below) +delete webpack_config['entry']; + +// add ./test as a search path for js +webpack_config.module.loaders.unshift({ + test: /\.js$/, loader: "babel", + include: [path.resolve('./src'), path.resolve('./test')], +}); + +// disable parsing for sinon, because it +// tries to do voodoo with 'require' which upsets +// webpack (https://github.com/webpack/webpack/issues/304) +webpack_config.module.noParse.push(/sinon\/pkg\/sinon\.js$/); + +// ? +webpack_config.resolve.alias['sinon'] = 'sinon/pkg/sinon.js'; + +webpack_config.resolve.root = [ + path.resolve('./src'), + path.resolve('./test'), +]; + +webpack_config.devtool = 'inline-source-map'; + module.exports = function (config) { - config.set({ + const myconfig = { // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['mocha'], @@ -51,7 +85,7 @@ module.exports = function (config) { // available preprocessors: // https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { - 'test/**/*.js': ['webpack', 'sourcemap'] + '{src,test}/**/*.js': ['webpack'], }, // test results reporter to use @@ -94,59 +128,20 @@ module.exports = function (config) { outputDir: 'karma-reports', }, - webpack: { - module: { - preLoaders: [ - // use the source-map-loader for javascript. This means - // that we have a better chance of seeing line numbers from - // the pre-babeled source. - { test: /\.js$/, loader: "source-map-loader" }, - ], - loaders: [ - { test: /\.json$/, loader: "json" }, - { - test: /\.js$/, loader: "babel", - include: [path.resolve('./src'), - path.resolve('./test'), - ] - }, - ], - noParse: [ - // don't parse the languages within highlight.js. They - // cause stack overflows - // (https://github.com/webpack/webpack/issues/1721), and - // there is no need for webpack to parse them - they can - // just be included as-is. - /highlight\.js\/lib\/languages/, + webpack: webpack_config, - // also disable parsing for sinon, because it - // tries to do voodoo with 'require' which upsets - // webpack (https://github.com/webpack/webpack/issues/304) - /sinon\/pkg\/sinon\.js$/, - ], + webpackMiddleware: { + stats: { + // don't fill the console up with a mahoosive list of modules + chunks: false, }, - resolve: { - alias: { - // alias any requires to the react module to the one in our path, otherwise - // we tend to get the react source included twice when using npm link. - react: path.resolve('./node_modules/react'), - - // same goes for js-sdk - "matrix-js-sdk": path.resolve('./node_modules/matrix-js-sdk'), - - sinon: 'sinon/pkg/sinon.js', - }, - root: [ - path.resolve('./src'), - path.resolve('./test'), - ], - }, - plugins: [ - // olm may not be installed, so avoid webpack warnings by - // ignoring it. - new webpack.IgnorePlugin(/^olm$/), - ], - devtool: 'inline-source-map', }, - }); + }; + + // include the olm loader if we have it. + if (olm_entry) { + myconfig.files.unshift(olm_entry); + } + + config.set(myconfig); }; diff --git a/package.json b/package.json index 915056e636..d48eaffe62 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "clean": "rimraf lib webapp electron/dist", "prepublish": "npm run build:compile", "test": "karma start --single-run=true --autoWatch=false --browsers PhantomJS --colors=false", - "test:multi": "karma start" + "test-multi": "karma start" }, "dependencies": { "babel-polyfill": "^6.5.0", @@ -111,7 +111,6 @@ "karma-junit-reporter": "^0.4.1", "karma-mocha": "^0.2.2", "karma-phantomjs-launcher": "^1.0.0", - "karma-sourcemap-loader": "^0.3.7", "karma-webpack": "^1.7.0", "minimist": "^1.2.0", "mkdirp": "^0.5.1", From 5368c87dc142b42f60fb9e6b7cad3c876a11e374 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 2 Feb 2017 23:41:49 +0000 Subject: [PATCH 12/34] Fix tests to run crypto code Return a device_id from /login requests, so that all the crypto logic works. --- test/app-tests/loading.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/app-tests/loading.js b/test/app-tests/loading.js index 4504d00b8d..d2cb78d04b 100644 --- a/test/app-tests/loading.js +++ b/test/app-tests/loading.js @@ -193,6 +193,7 @@ describe('loading:', function () { expect(req.data.password).toEqual('pass'); }).respond(200, { user_id: '@user:id', + device_id: 'DEVICE_ID', access_token: 'access_token', }); login.onPasswordLogin("user", "pass") @@ -393,6 +394,7 @@ describe('loading:', function () { expect(req.data.token).toEqual("secretToken"); }).respond(200, { user_id: "@user:localhost", + device_id: 'DEVICE_ID', access_token: "access_token", }); From 654a025a9fdefd366882e23d308b13e6e40defd5 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 3 Feb 2017 01:57:54 +0000 Subject: [PATCH 13/34] fix button width for unkdevdialog --- .../matrix-react-sdk/views/dialogs/_UnknownDeviceDialog.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/skins/vector/css/matrix-react-sdk/views/dialogs/_UnknownDeviceDialog.scss b/src/skins/vector/css/matrix-react-sdk/views/dialogs/_UnknownDeviceDialog.scss index 579e385249..804b3f419e 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/dialogs/_UnknownDeviceDialog.scss +++ b/src/skins/vector/css/matrix-react-sdk/views/dialogs/_UnknownDeviceDialog.scss @@ -54,7 +54,7 @@ limitations under the License. margin-right: 8px; padding-left: 0.5em; padding-right: 0.5em; - width: 70px; + width: 85px; outline: none; cursor: pointer; color: $accent-color; From 0050e1557d128f04ff184293e8dac5e947307016 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 3 Feb 2017 01:58:01 +0000 Subject: [PATCH 14/34] fix darktheme for close button --- src/skins/vector/img/icons-close.svg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/skins/vector/img/icons-close.svg b/src/skins/vector/img/icons-close.svg index 6feb660aff..453b51082f 100644 --- a/src/skins/vector/img/icons-close.svg +++ b/src/skins/vector/img/icons-close.svg @@ -3,7 +3,7 @@ icons_create_room Created with sketchtool. @@ -13,8 +13,8 @@ - - + + From b20f6ff8c17d2b659d10bf43378f59a7a7802db3 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Fri, 3 Feb 2017 11:40:07 +0000 Subject: [PATCH 15/34] Silence webpack dev server Configure the dev server not to spew module lists all over the console. (Arguably the fact our module list is so long that I have to do this is a bug, but my life is too short) --- webpack.config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webpack.config.js b/webpack.config.js index 136e0af754..f3cffa0ea7 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -132,6 +132,11 @@ module.exports = { devServer: { // serve unwebpacked assets from webapp. contentBase: './webapp', + + stats: { + // don't fill the console up with a mahoosive list of modules + chunks: false, + }, }, }; From 7ceaabb166fe1c07357e0d7d99f23cbc62c07c93 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Fri, 3 Feb 2017 12:00:33 +0000 Subject: [PATCH 16/34] RightPanel: remove superfluous divs --- src/components/structures/RightPanel.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index f609a4cd46..04a981196b 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -197,27 +197,26 @@ module.exports = React.createClass({ if (this.props.roomId) { buttonGroup =
-
- +
{ membersBadge ? membersBadge :  }
{ membersHighlight }
-
-
- +
 
{ filesHighlight }
-
-
- +
 
{ notificationsHighlight }
-
@@ -262,4 +261,3 @@ module.exports = React.createClass({ ); } }); - From cad2d72bfe90759dd9719a30c255456ce016fb9d Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 3 Feb 2017 12:15:36 +0000 Subject: [PATCH 17/34] Release js-sdk & react-sdk --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d48eaffe62..c0fc62bc82 100644 --- a/package.json +++ b/package.json @@ -62,8 +62,8 @@ "gfm.css": "^1.1.1", "highlight.js": "^9.0.0", "linkifyjs": "^2.1.3", - "matrix-js-sdk": "matrix-org/matrix-js-sdk#develop", - "matrix-react-sdk": "matrix-org/matrix-react-sdk#develop", + "matrix-js-sdk": "0.7.5-rc.1", + "matrix-react-sdk": "0.8.6-rc.1", "modernizr": "^3.1.0", "q": "^1.4.1", "react": "^15.4.0", From 8f86cfa2d3a89ed2394a7e9d314f9f7954ab4734 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 3 Feb 2017 12:17:28 +0000 Subject: [PATCH 18/34] Prepare changelog for v0.9.7-rc.1 --- CHANGELOG.md | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee745baa1b..aa131ff5c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,84 @@ +Changes in [0.9.7-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.9.7-rc.1) (2017-02-03) +==================================================================================================== +[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.6...v0.9.7-rc.1) + + * Better user interface for screen readers and keyboard navigation + [\#2946](https://github.com/vector-im/riot-web/pull/2946) + * Allow mxc: URLs for icons in the NetworkDropdown + [\#3118](https://github.com/vector-im/riot-web/pull/3118) + * make TopRightMenu more intuitive + [\#3117](https://github.com/vector-im/riot-web/pull/3117) + * Handle icons with width > height + [\#3110](https://github.com/vector-im/riot-web/pull/3110) + * Fix jenkins build + [\#3105](https://github.com/vector-im/riot-web/pull/3105) + * Add CSS for a support box in login + [\#3081](https://github.com/vector-im/riot-web/pull/3081) + * Allow a custom login logo to be displayed on login + [\#3082](https://github.com/vector-im/riot-web/pull/3082) + * Fix the width of input fields within login/reg box + [\#3080](https://github.com/vector-im/riot-web/pull/3080) + * Set BaseAvatar_image bg colour = #fff + [\#3057](https://github.com/vector-im/riot-web/pull/3057) + * only recalculate favicon if it changes + [\#3067](https://github.com/vector-im/riot-web/pull/3067) + * CSS tweak for email address lookup + [\#3064](https://github.com/vector-im/riot-web/pull/3064) + * Glue the dialog to rageshake: honour sendLogs flag. + [\#3061](https://github.com/vector-im/riot-web/pull/3061) + * Don't use hash-named directory for dev server + [\#3049](https://github.com/vector-im/riot-web/pull/3049) + * Implement bug reporting logic + [\#3000](https://github.com/vector-im/riot-web/pull/3000) + * Add css for bug report dialog + [\#3045](https://github.com/vector-im/riot-web/pull/3045) + * Increase the max-height of the expanded status bar + [\#3043](https://github.com/vector-im/riot-web/pull/3043) + * Hopefully, fix intermittent test failure + [\#3040](https://github.com/vector-im/riot-web/pull/3040) + * CSS for 'searching known users' + [\#2971](https://github.com/vector-im/riot-web/pull/2971) + * Animate status bar max-height and margin-top + [\#2981](https://github.com/vector-im/riot-web/pull/2981) + * Add eslint config + [\#3032](https://github.com/vector-im/riot-web/pull/3032) + * Re-position typing avatars relative to "is typing" + [\#3030](https://github.com/vector-im/riot-web/pull/3030) + * CSS for avatars that appear when users are typing + [\#2998](https://github.com/vector-im/riot-web/pull/2998) + * Add StartupWMClass + [\#3001](https://github.com/vector-im/riot-web/pull/3001) + * Fix link to image for event options menu + [\#3002](https://github.com/vector-im/riot-web/pull/3002) + * Make riot desktop single instance + [\#2999](https://github.com/vector-im/riot-web/pull/2999) + * Add electron tray icon + [\#2997](https://github.com/vector-im/riot-web/pull/2997) + * Fixes to electron desktop notifs + [\#2994](https://github.com/vector-im/riot-web/pull/2994) + * Auto-hide the electron menu bar + [\#2975](https://github.com/vector-im/riot-web/pull/2975) + * A couple of tweaks to the karma config + [\#2987](https://github.com/vector-im/riot-web/pull/2987) + * Deploy script + [\#2974](https://github.com/vector-im/riot-web/pull/2974) + * Use the postcss-webpack-loader + [\#2990](https://github.com/vector-im/riot-web/pull/2990) + * Switch CSS to using postcss, and implement a dark theme. + [\#2973](https://github.com/vector-im/riot-web/pull/2973) + * Update redeploy script to keep old bundles + [\#2969](https://github.com/vector-im/riot-web/pull/2969) + * Include current version in update check explicitly + [\#2967](https://github.com/vector-im/riot-web/pull/2967) + * Add another layer of directory to webpack chunks + [\#2966](https://github.com/vector-im/riot-web/pull/2966) + * Fix links to fonts and images from CSS + [\#2965](https://github.com/vector-im/riot-web/pull/2965) + * Put parent build hash in webpack output filenames + [\#2961](https://github.com/vector-im/riot-web/pull/2961) + * update README to point to new names/locations + [\#2846](https://github.com/vector-im/riot-web/pull/2846) + Changes in [0.9.6](https://github.com/vector-im/riot-web/releases/tag/v0.9.6) (2017-01-16) ========================================================================================== [Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.6-rc.1...v0.9.6) From 3d45aa7455d23c6c31195fcda4e1295c586f2409 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 3 Feb 2017 12:17:28 +0000 Subject: [PATCH 19/34] v0.9.7-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c0fc62bc82..dd333b0009 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "electron/src/electron-main.js", - "version": "0.9.6", + "version": "0.9.7-rc.1", "description": "A feature-rich client for Matrix.org", "author": "Vector Creations Ltd.", "repository": { From 51de4a3347711130f5f1798a52637461304f904f Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 3 Feb 2017 13:08:20 +0000 Subject: [PATCH 20/34] Bump js-sdk & react-sdk --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index dd333b0009..4610acb8f2 100644 --- a/package.json +++ b/package.json @@ -62,8 +62,8 @@ "gfm.css": "^1.1.1", "highlight.js": "^9.0.0", "linkifyjs": "^2.1.3", - "matrix-js-sdk": "0.7.5-rc.1", - "matrix-react-sdk": "0.8.6-rc.1", + "matrix-js-sdk": "0.7.5-rc.2", + "matrix-react-sdk": "0.8.6-rc.2", "modernizr": "^3.1.0", "q": "^1.4.1", "react": "^15.4.0", From 4d8bdfa07e7bb93d4998533da415b0953474129d Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 3 Feb 2017 13:19:22 +0000 Subject: [PATCH 21/34] Prepare changelog for v0.9.7-rc.2 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa131ff5c9..81b8553a69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +Changes in [0.9.7-rc.2](https://github.com/vector-im/riot-web/releases/tag/v0.9.7-rc.2) (2017-02-03) +==================================================================================================== +[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.7-rc.1...v0.9.7-rc.2) + + * Update matrix-js-sdk to get new device change + notifications interface for more reliable e2e crypto + + Changes in [0.9.7-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.9.7-rc.1) (2017-02-03) ==================================================================================================== [Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.6...v0.9.7-rc.1) From c2d2287541ae6e812c3b789e280f5adbdded0381 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 3 Feb 2017 13:19:22 +0000 Subject: [PATCH 22/34] v0.9.7-rc.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4610acb8f2..a62109490a 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "electron/src/electron-main.js", - "version": "0.9.7-rc.1", + "version": "0.9.7-rc.2", "description": "A feature-rich client for Matrix.org", "author": "Vector Creations Ltd.", "repository": { From 5285d56a45bdd9589e801382819ee00d90c3e076 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 3 Feb 2017 13:51:02 +0000 Subject: [PATCH 23/34] Bump olm version Looks like this is causing pickle errors on packaged builds. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a62109490a..feb206c51a 100644 --- a/package.json +++ b/package.json @@ -133,7 +133,7 @@ "webpack-dev-server": "^1.16.2" }, "optionalDependencies": { - "olm": "https://matrix.org/packages/npm/olm/olm-2.1.0.tgz" + "olm": "https://matrix.org/packages/npm/olm/olm-2.2.1.tgz" }, "build": { "appId": "im.riot.app", From 53e5c7eebe9f8cb2d6b9841ad826d65641dcbd71 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Fri, 3 Feb 2017 14:39:11 +0000 Subject: [PATCH 24/34] Unpin js-sdk & react-sdk --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index feb206c51a..6edbf07038 100644 --- a/package.json +++ b/package.json @@ -62,8 +62,8 @@ "gfm.css": "^1.1.1", "highlight.js": "^9.0.0", "linkifyjs": "^2.1.3", - "matrix-js-sdk": "0.7.5-rc.2", - "matrix-react-sdk": "0.8.6-rc.2", + "matrix-js-sdk": "matrix-org/matrix-js-sdk#develop", + "matrix-react-sdk": "matrix-org/matrix-react-sdk#develop", "modernizr": "^3.1.0", "q": "^1.4.1", "react": "^15.4.0", From 541eb45e1aeb8f75b8dcd271a23bfdce5b52d7b8 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Fri, 3 Feb 2017 15:06:03 +0000 Subject: [PATCH 25/34] Jenkins: use default olm ... to stop us making a release and realising we forgot to bump the olm version in vector-web. --- scripts/jenkins.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/jenkins.sh b/scripts/jenkins.sh index 0f4fac2513..5ce930b8cd 100755 --- a/scripts/jenkins.sh +++ b/scripts/jenkins.sh @@ -11,13 +11,18 @@ set -x npm install # apparently npm 3.10.3 on node 6.4.0 doesn't upgrade #develop target with npm install unless explicitly asked. -npm install matrix-react-sdk matrix-js-sdk +npm install matrix-react-sdk matrix-js-sdk olm # install olm. A naive 'npm i ./olm/olm-*.tgz' fails because it uses the url # from our package.json (or even matrix-js-sdk's) in preference. -tar -C olm -xz < olm/olm-*.tgz -rm -r node_modules/olm -cp -r olm/package node_modules/olm +# +# disabled for now, to avoid the annoying scenario of a release doing something +# different to /develop. Instead, add it to the 'npm install' list above. +# -- rav 2016/02/03 +#tar -C olm -xz < olm/olm-*.tgz +#rm -r node_modules/olm +#cp -r olm/package node_modules/olm + # we may be using dev branches of js-sdk and react-sdk, in which case we need to build them (cd node_modules/matrix-js-sdk && npm install) From d176e83e94c1c7a1240397f77da95a1d8bdad1df Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Fri, 3 Feb 2017 15:34:15 +0000 Subject: [PATCH 26/34] Bump matrix-js-sdk and react-sdk --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a62109490a..146a5d36c5 100644 --- a/package.json +++ b/package.json @@ -62,8 +62,8 @@ "gfm.css": "^1.1.1", "highlight.js": "^9.0.0", "linkifyjs": "^2.1.3", - "matrix-js-sdk": "0.7.5-rc.2", - "matrix-react-sdk": "0.8.6-rc.2", + "matrix-js-sdk": "0.7.5-rc.3", + "matrix-react-sdk": "0.8.6-rc.3", "modernizr": "^3.1.0", "q": "^1.4.1", "react": "^15.4.0", From e0be012737ccfc8b314a8503c160c77e246c8012 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 3 Feb 2017 13:51:02 +0000 Subject: [PATCH 27/34] Bump olm version Looks like this is causing pickle errors on packaged builds. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 146a5d36c5..f3ded26929 100644 --- a/package.json +++ b/package.json @@ -133,7 +133,7 @@ "webpack-dev-server": "^1.16.2" }, "optionalDependencies": { - "olm": "https://matrix.org/packages/npm/olm/olm-2.1.0.tgz" + "olm": "https://matrix.org/packages/npm/olm/olm-2.2.1.tgz" }, "build": { "appId": "im.riot.app", From 961f279a822bc18d7a7815c9e539f6500e66c46b Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Fri, 3 Feb 2017 15:44:37 +0000 Subject: [PATCH 28/34] Prepare changelog for v0.9.7-rc.3 --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81b8553a69..7593166c4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +Changes in [0.9.7-rc.3](https://github.com/vector-im/riot-web/releases/tag/v0.9.7-rc.3) (2017-02-03) +==================================================================================================== +[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.7-rc.2...v0.9.7-rc.3) + * Update to latest Olm to fix key import/export and use of megolm sessions + created on more recent versions + * Update to latest matrix-react-sdk and matrix-js-sdk to fix e2e device + handling + Changes in [0.9.7-rc.2](https://github.com/vector-im/riot-web/releases/tag/v0.9.7-rc.2) (2017-02-03) ==================================================================================================== [Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.7-rc.1...v0.9.7-rc.2) @@ -5,7 +13,6 @@ Changes in [0.9.7-rc.2](https://github.com/vector-im/riot-web/releases/tag/v0.9. * Update matrix-js-sdk to get new device change notifications interface for more reliable e2e crypto - Changes in [0.9.7-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.9.7-rc.1) (2017-02-03) ==================================================================================================== [Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.6...v0.9.7-rc.1) From dea557619c0d85999447b03fa80e3bb49d979739 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Fri, 3 Feb 2017 15:44:37 +0000 Subject: [PATCH 29/34] v0.9.7-rc.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f3ded26929..44d6e67cfd 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "electron/src/electron-main.js", - "version": "0.9.7-rc.2", + "version": "0.9.7-rc.3", "description": "A feature-rich client for Matrix.org", "author": "Vector Creations Ltd.", "repository": { From cd7bc3bfd3d131ef505102e3c89bfab16da1e117 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Sat, 4 Feb 2017 10:52:41 +0000 Subject: [PATCH 30/34] Bump to js-sdk 0.7.5 and react-sdk 0.8.6 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 44d6e67cfd..4b0e5d234b 100644 --- a/package.json +++ b/package.json @@ -62,8 +62,8 @@ "gfm.css": "^1.1.1", "highlight.js": "^9.0.0", "linkifyjs": "^2.1.3", - "matrix-js-sdk": "0.7.5-rc.3", - "matrix-react-sdk": "0.8.6-rc.3", + "matrix-js-sdk": "0.7.5", + "matrix-react-sdk": "0.8.6", "modernizr": "^3.1.0", "q": "^1.4.1", "react": "^15.4.0", From 08cdf21aeedc67ec43b53d369fad34872c9d2308 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Sat, 4 Feb 2017 10:55:46 +0000 Subject: [PATCH 31/34] Prepare changelog for v0.9.7 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7593166c4f..659a3742c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +Changes in [0.9.7](https://github.com/vector-im/riot-web/releases/tag/v0.9.7) (2017-02-04) +========================================================================================== +[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.7-rc.3...v0.9.7) + + * Update to matrix-js-sdk 0.7.5 (no changes from 0.7.5-rc.3) + * Update to matrix-react-sdk 0.8.6 (no changes from 0.8.6-rc.3) + Changes in [0.9.7-rc.3](https://github.com/vector-im/riot-web/releases/tag/v0.9.7-rc.3) (2017-02-03) ==================================================================================================== [Full Changelog](https://github.com/vector-im/riot-web/compare/v0.9.7-rc.2...v0.9.7-rc.3) From dc1a0c554f7a7ec74e95be3d63a58a93c3cc438f Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Sat, 4 Feb 2017 10:55:46 +0000 Subject: [PATCH 32/34] v0.9.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4b0e5d234b..155523af6c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "electron/src/electron-main.js", - "version": "0.9.7-rc.3", + "version": "0.9.7", "description": "A feature-rich client for Matrix.org", "author": "Vector Creations Ltd.", "repository": { From d4247e0179f176a853d3dd964b0c2074026a7b35 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 6 Feb 2017 14:56:06 +0000 Subject: [PATCH 33/34] Dump to bugs subdirectory --- scripts/rageshake.go | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/rageshake.go b/scripts/rageshake.go index ebf94e67ac..df02f493e0 100644 --- a/scripts/rageshake.go +++ b/scripts/rageshake.go @@ -37,6 +37,7 @@ func respond(code int, w http.ResponseWriter) { } func gzipAndSave(data []byte, filepath string) error { + filepath = "bugs/" + filepath if _, err := os.Stat(filepath); err == nil { return fmt.Errorf("file already exists") // the user can just retry } From db31f0a087a23ec5a77ccf7d7c01fd8c3cdbb313 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 6 Feb 2017 15:31:53 +0000 Subject: [PATCH 34/34] Host API under /api. Use filepath.Join rather than string concatenation --- scripts/rageshake.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/rageshake.go b/scripts/rageshake.go index df02f493e0..cd62b4f9ed 100644 --- a/scripts/rageshake.go +++ b/scripts/rageshake.go @@ -13,6 +13,7 @@ import ( "log" "net/http" "os" + "path/filepath" "strconv" "time" ) @@ -36,9 +37,10 @@ func respond(code int, w http.ResponseWriter) { w.Write([]byte("{}")) } -func gzipAndSave(data []byte, filepath string) error { - filepath = "bugs/" + filepath - if _, err := os.Stat(filepath); err == nil { +func gzipAndSave(data []byte, fpath string) error { + fpath = filepath.Join("bugs", fpath) + + if _, err := os.Stat(fpath); err == nil { return fmt.Errorf("file already exists") // the user can just retry } var b bytes.Buffer @@ -52,14 +54,14 @@ func gzipAndSave(data []byte, filepath string) error { if err := gz.Close(); err != nil { return err } - if err := ioutil.WriteFile(filepath, b.Bytes(), 0644); err != nil { + if err := ioutil.WriteFile(fpath, b.Bytes(), 0644); err != nil { return err } return nil } func main() { - http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { + http.HandleFunc("/api/submit", func(w http.ResponseWriter, req *http.Request) { if req.Method != "POST" && req.Method != "OPTIONS" { respond(405, w) return