Skip to content

Commit

Permalink
Merge pull request #92 from mattermost/release/v1.1.0
Browse files Browse the repository at this point in the history
Release/v1.1.0
  • Loading branch information
yuya-oc committed Mar 30, 2016
2 parents 8f7710a + 55e5741 commit 108cf91
Show file tree
Hide file tree
Showing 18 changed files with 446 additions and 113 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
end_of_line = lf
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
49 changes: 43 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,54 @@
# Mattermost Desktop Application Changelog

## IN PROGRESS: Release v1.0.8 (Beta)
## Release v1.1.0 (Beta)

The `electron-mattermost` project is now the official desktop application for the Mattermost open source project.


### Changes
- Renaming project from `electron-mattermost` to `desktop`

#### All platforms

- Rename project from `electron-mattermost` to `desktop`
- Rename the executable file from `electron-mattermost` to `Mattermost`
- The configuration directory is also different from previous versions.
- Should execute following command to take over `config.json`.
- Windows: `copy %APPDATA%\electron-mattermost\config.json %APPDATA%\Mattermost\config.json`
- OS X: `cp ~/Library/Application\ Support/electron-mattermost/config.json ~/Library/Application\ Support/Mattermost/config.json`
- Linux: `cp ~/.config/electron-mattermost/config.json ~/.config/Mattermost/config.json`


### Improvements

#### All platforms
- Refine application icon.
- Show error messages when the application failed in loading Mattermost server.
- Show confirmation dialog to continue connection when there is certificate error.
- Add validation to check whether both of **Name** and **URL** fields are not blank.
- Add simple basic HTTP authentication (requires a command line).

#### Windows
- Show a small circle on the tray icon when there are new messages.


### Fixes
- On **Settings Page** added validation so that **Name** field value is required before team site can be added.

#### Windows
- **File** > **About** does not bring up version number dialog.

#### Linux
- **File** > **About** does not bring up version number dialog.
- Ubuntu: Notification is not showing up.
- The view crashes when freetype 2.6.3 is used in system.


### Known issues

- Windows and Linux: **File** > **About** does not bring up version number dialog
- Windows: Application does not appear in Windows volume mixer
- All platforms: Embedded markdown images with `http://` do not render
#### All platforms
- Images with `http://` do not render.
- Basic Authentication is not working.
- Some keyboard shortcuts are missing. (e.g. <kbd>Ctrl+W</kbd>, <kbd>Command+,</kbd>)
- Basic authentication requires a command line.

#### Windows
- Application does not appear properly in Windows volume mixer.
20 changes: 10 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@ Thank you for your contributing! My requests are few things. Please read below.
Thank you for feedback. When you report a problem, please pay attention to following points.

### Does it happen on web browsers? (especially Chrome)
electron-mattermost is based on Electron. It integrates Chrome as a browser window.
If the problem appears on web browsers, it may be the issue for Mattermost (or Chrome).
Mattermost Desktop is based on Electron, which integrates the Chrome engine within a standalone application.
If the problem you encounter can be reproduced on web browsers, it may be an issue with Mattermost server (or Chrome).

### Try "Clear Cache and Reload"
It's available as `Ctrl(Command) + Shift + R`.
Some layout problems are caused by browser cache.
Especially, this kind of issue might happen when you have updated Mattermost server.

### Write detailed information
Following points are very helpful to understand the problem.
Detailed information is very helpful to understand the problem.

For example:
* How to reproduce, step-by-step
* Expected behavior (or what is wrong)
* Screenshots (for GUI issues)
* Application version
* Operating system
* Mattermost version
* Mattermost server version

## Feature idea
Please see http://www.mattermost.org/feature-requests/ .

## Pull request
Pull requests are welcome. Thank you for your great work!

1. When you edit the code, please run `npm run prettify` to format your code before `git commit`.
2. In the description of your pull request, please include:
* Operating System version on which you tested
* Mattermost server version on which you tested
* New or updated unit tests for your changes
1. When you edit the code, please run `npm run prettify` to format your code before `git commit`.
2. In the description of your pull request, please include:
* Operating System version on which you tested
* Mattermost server version on which you tested
* New or updated unit tests for your changes
3. Please complete the [Mattermost CLA](http://www.mattermost.org/mattermost-contributor-agreement/) prior to submitting a PR.

10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ Configuration will be saved into Electron's userData directory:
*When you upgrade from electron-mattermost, please copy `config.json` from `electron-mattermost`.
Otherwise, you have to configure again.*

### Proxy
Normally, the application will follow your system settings to use proxy.
Or you can set proxy by following command line options.

* `--proxy-server=<SERVER>:<PORT>`
* `--proxy-pac-url=<URL>`

*Note: Authorization is not supported yet.*


## Testing and Development
Node.js is required to test this app.

Expand Down
3 changes: 3 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ dependencies:
cache_directories:
- "~/.electron"
- "src/node_modules"
pre:
- npm install -g npm@3.3.12
post:
- mkdir -p ~/.electron
- docker run --rm -it -v `pwd`:/home/xclient/electron-mattermost -v ~/.electron:/home/xclient/.electron yuyaoc/em-builder:dev ./electron-mattermost/docker/package_in_docker.sh
Expand All @@ -30,6 +32,7 @@ dependencies:
test:
override:
- node_modules/.bin/mocha --reporter mocha-circleci-reporter
- node_modules/.bin/gulp prettify:verify
post:
- mv test-results.xml $CIRCLE_TEST_REPORTS/

Expand Down
68 changes: 50 additions & 18 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ var webpack = require('webpack-stream');
var named = require('vinyl-named');
var changed = require('gulp-changed');
var esformatter = require('gulp-esformatter');
var esformatter_origin = require('esformatter');
var through = require('through2');
var del = require('del');
var electron = require('electron-connect').server.create({
path: './dist'
Expand All @@ -16,35 +18,65 @@ var packager = require('electron-packager');
var sources = ['**/*.js', '**/*.css', '**/*.html', '!**/node_modules/**', '!dist/**', '!release/**'];

gulp.task('prettify', ['prettify:sources', 'prettify:jsx']);
gulp.task('prettify:verify', ['prettify:sources:verify', 'prettify:jsx:verify'])

var prettify_options = {
html: {
eol: '\n',
indentSize: 2
},
css: {
eol: '\n',
indentSize: 2
},
js: {
eol: '\n',
indentSize: 2,
braceStyle: "end-expand"
}
};

gulp.task('prettify:sources', ['sync-meta'], function() {
prettify_options.mode = "VERIFY_AND_WRITE";
return gulp.src(sources)
.pipe(prettify({
html: {
indentSize: 2
},
css: {
indentSize: 2
},
js: {
indentSize: 2,
braceStyle: "end-expand"
}
}))
.pipe(prettify(prettify_options))
.pipe(gulp.dest('.'));
});

gulp.task('prettify:sources:verify', function() {
prettify_options.mode = "VERIFY_ONLY";
prettify_options.showDiff = false;
return gulp.src(sources)
.pipe(prettify(prettify_options));
});


var esformatter_jsx_options = {
indent: {
value: ' '
},
plugins: ['esformatter-jsx']
};

gulp.task('prettify:jsx', function() {
return gulp.src('src/browser/**/*.jsx')
.pipe(esformatter({
indent: {
value: ' '
},
plugins: ['esformatter-jsx']
}))
.pipe(esformatter(esformatter_jsx_options))
.pipe(gulp.dest('src/browser'));
});

gulp.task('prettify:jsx:verify', function() {
return gulp.src('src/browser/**/*.jsx')
.pipe(through.obj(function(file, enc, cb) {
var result = esformatter_origin.diff.unified(file.contents.toString(), esformatter_origin.rc(file.path, esformatter_jsx_options));
if (result !== "") {
console.log('Error: ' + file.path + ' must be formatted');
process.exit(1);
}
cb();
}));
});


gulp.task('build', ['sync-meta', 'webpack', 'copy'], function() {
return gulp.src('src/package.json')
.pipe(gulp.dest('dist'));
Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
{
"name": "mattermost-desktop",
"productName": "Mattermost",
"version": "1.0.7",
"version": "1.1.0",
"description": "Mattermost Desktop application for Windows, Mac and Linux",
"main": "main.js",
"author": "Yuya Ochiai",
"license": "MIT",
"engines": {
"node": ">=4.2.0"
},
"scripts": {
"install": "cd src && npm install",
"postinstall": "npm run build",
"build": "gulp build",
"start": "electron dist",
"watch": "gulp watch",
"serve": "gulp watch",
"test": "gulp build && mocha",
"test": "gulp build && mocha && gulp prettify:verify",
"package": "gulp package",
"package:windows": "gulp package:windows",
"package:osx": "gulp package:osx",
Expand All @@ -29,7 +32,7 @@
"del": "^2.2.0",
"electron-connect": "^0.3.3",
"electron-packager": "^5.1.0",
"electron-prebuilt": "0.36.7",
"electron-prebuilt": "0.36.11",
"esformatter": "^0.8.1",
"esformatter-jsx": "^4.0.6",
"gulp": "^3.9.0",
Expand All @@ -42,6 +45,7 @@
"mocha-circleci-reporter": "0.0.1",
"should": "^8.0.1",
"style-loader": "^0.13.0",
"through2": "^2.0.1",
"vinyl-named": "^1.1.0",
"webdriverio": "^3.3.0",
"webpack-stream": "^3.1.0"
Expand Down
60 changes: 57 additions & 3 deletions src/browser/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const Col = ReactBootstrap.Col;
const Nav = ReactBootstrap.Nav;
const NavItem = ReactBootstrap.NavItem;
const Badge = ReactBootstrap.Badge;
const ListGroup = ReactBootstrap.ListGroup;
const ListGroupItem = ReactBootstrap.ListGroupItem;

const electron = require('electron');
const remote = electron.remote;
Expand Down Expand Up @@ -204,6 +206,7 @@ var TabBar = React.createClass({
var MattermostView = React.createClass({
getInitialState: function() {
return {
did_fail_load: null
};
},
handleUnreadCountChange: function(unreadCount, mentionCount, isUnread, isMentioned) {
Expand All @@ -216,6 +219,22 @@ var MattermostView = React.createClass({
var thisObj = this;
var webview = ReactDOM.findDOMNode(this.refs.webview);

webview.addEventListener('did-fail-load', function(e) {
console.log(thisObj.props.name, 'webview did-fail-load', e);
if (e.errorCode === -3) { // An operation was aborted (due to user action).
return;
}

// should use permanent way to indicate
var did_fail_load_notification = new Notification(`Failed to load "${thisObj.props.name}"`, {
body: `ErrorCode: ${e.errorCode}`,
icon: '../resources/appicon.png'
});
thisObj.setState({
did_fail_load: e
});
});

// Open link in browserWindow. for exmaple, attached files.
webview.addEventListener('new-window', function(e) {
var currentURL = url.parse(webview.getURL());
Expand Down Expand Up @@ -293,7 +312,40 @@ var MattermostView = React.createClass({
// 'disablewebsecurity' is necessary to display external images.
// However, it allows also CSS/JavaScript.
// So webview should use 'allowDisplayingInsecureContent' as same as BrowserWindow.
return (<webview id={ this.props.id } className="mattermostView" style={ this.props.style } preload="webview/mattermost.js" src={ this.props.src } ref="webview"></webview>);
if (this.state.did_fail_load === null) {
return (<webview id={ this.props.id } className="mattermostView" style={ this.props.style } preload="webview/mattermost.js" src={ this.props.src } ref="webview"></webview>);
} else {
return (<ErrorView id={ this.props.id + '-fail' } className="errorView" errorInfo={ this.state.did_fail_load } style={ this.props.style }></ErrorView>)
}
}
});

// ErrorCode: https://code.google.com/p/chromium/codesearch#chromium/src/net/base/net_error_list.h
// FIXME: need better wording in English
var ErrorView = React.createClass({
render: function() {
return (
<Grid id={ this.props.id } style={ this.props.style }>
<h1>Failed to load the URL</h1>
<p>
{ 'URL: ' }
{ this.props.errorInfo.validatedURL }
</p>
<p>
{ 'Error code: ' }
{ this.props.errorInfo.errorCode }
</p>
<p>
{ this.props.errorInfo.errorDescription }
</p>
<p>Please check below. Then, reload this window. (Ctrl+R or Command+R)</p>
<ListGroup>
<ListGroupItem>Is your computer online?</ListGroupItem>
<ListGroupItem>Is the server alive?</ListGroupItem>
<ListGroupItem>Is the URL correct?</ListGroupItem>
</ListGroup>
</Grid>
);
}
});

Expand Down Expand Up @@ -321,7 +373,9 @@ var showUnreadBadgeWindows = function(unreadCount, mentionCount) {
// https://github.com/atom/electron/issues/4011
electron.ipcRenderer.send('win32-overlay', {
overlayDataURL: dataURL,
description: description
description: description,
unreadCount: unreadCount,
mentionCount: mentionCount
});
};

Expand All @@ -332,7 +386,7 @@ var showUnreadBadgeWindows = function(unreadCount, mentionCount) {
const dataURL = badge.createDataURL('•');
sendBadge(dataURL, 'You have unread channels');
} else {
remote.getCurrentWindow().setOverlayIcon(null, '');
sendBadge(null, 'You have no unread messages');
}
}

Expand Down
Loading

0 comments on commit 108cf91

Please sign in to comment.