diff options
-rw-r--r-- | README.md | 28 | ||||
-rw-r--r-- | requirements.md | 23 | ||||
-rw-r--r-- | utils/config.go | 2 | ||||
-rw-r--r-- | web/react/components/channel_invite_modal.jsx | 2 | ||||
-rw-r--r-- | web/react/components/edit_channel_modal.jsx | 7 | ||||
-rw-r--r-- | web/react/components/edit_post_modal.jsx | 7 | ||||
-rw-r--r-- | web/react/components/new_channel.jsx | 4 | ||||
-rw-r--r-- | web/react/components/post.jsx | 2 | ||||
-rw-r--r-- | web/react/components/post_info.jsx | 1 | ||||
-rw-r--r-- | web/react/components/post_right.jsx | 4 | ||||
-rw-r--r-- | web/react/components/setting_picture.jsx | 4 | ||||
-rw-r--r-- | web/react/utils/client.jsx | 17 | ||||
-rw-r--r-- | web/templates/head.html | 2 | ||||
-rw-r--r-- | web/web.go | 15 |
14 files changed, 81 insertions, 37 deletions
@@ -60,7 +60,7 @@ Local Machine Setup (Docker) 3. When docker is done fetching the image, open http://localhost:8065/ in your browser. ### Arch ### -1. Install docker using the following commands: +1. Install Docker using the following commands: ``` bash pacman -S docker @@ -70,13 +70,13 @@ Local Machine Setup (Docker) newgrp docker ``` -2. Start docker container: +2. Start Docker container: ``` bash docker run --name mattermost-dev -d --publish 8065:80 mattermost/platform ``` -3. When docker is done fetching the image, open http://localhost:8065/ in your browser. +3. When Docker is done fetching the image, open http://localhost:8065/ in your browser. ### Additional Notes ### - If you want to work with the latest master from the repository (i.e. not a stable release) you can run the cmd: @@ -85,7 +85,7 @@ Local Machine Setup (Docker) docker run --name mattermost-dev -d --publish 8065:80 mattermost/platform:dev ``` -- Instructions on how to update your docker image are found below. +- Instructions on how to update your Docker image are found below. - If you wish to remove mattermost-dev use: @@ -103,7 +103,7 @@ Local Machine Setup (Docker) AWS Elastic Beanstalk Setup (Docker) ------------------------------------ -1. Create a new elastic beanstalk docker application using the [Dockerrun.aws.json](docker/0.6/Dockerrun.aws.json) file provided. +1. Create a new Elastic Beanstalk Docker application using the [Dockerrun.aws.json](docker/0.6/Dockerrun.aws.json) file provided. 1. From the AWS console select Elastic Beanstalk. 2. Select "Create New Application" from the top right. 3. Name the application and press next. @@ -125,7 +125,7 @@ AWS Elastic Beanstalk Setup (Docker) Configuration Settings ---------------------- -There are a few configuration settings you might want to adjust when setting up your instance of Mattermost. You can edit them in [config/config.json](config/config.json) or [docker/0.6/config_docker.json](docker/0.6/config_docker.json) if you're running a docker instance. +There are a few configuration settings you might want to adjust when setting up your instance of Mattermost. You can edit them in [config/config.json](config/config.json) or [docker/0.6/config_docker.json](docker/0.6/config_docker.json) if you're running a Docker instance. * *EmailSettings*:*ByPassEmail* - If this is set to true, then users on the system will not need to verify their email addresses when signing up. In addition, no emails will ever be sent. * *ServiceSettings*:*UseLocalStorage* - If this is set to true, then your Mattermost server will store uploaded files in the storage directory specified by *StorageDirectory*. *StorageDirectory* must be set if *UseLocalStorage* is set to true. @@ -171,34 +171,34 @@ Email Setup (Optional) 3. The service should restart automatically. Verify the Mattermost service is running with `ps -A` 4. Current logged in users will not be affected, but upon logging out or session expiration users will be required to verify their email address. -Upgrading Mattermost ---------------------- +Upgrading Mattermost Preview +---------------------------- ### Docker ### -To upgrade your docker image to the latest release (NOTE: this will destroy all data in the docker container): +To upgrade your Docker image to a preview of the latest stable release (NOTE: this will erase all data in the Docker container, including the database): -1. Stop your docker container by running: +1. Stop your Docker container by running: ``` bash docker stop mattermost-dev ``` -2. Delete your docker container by running: +2. Delete your Docker container by running: ``` bash docker rm mattermost-dev ``` -3. Update your docker image by running: +3. Update your Docker image by running: ``` bash docker pull mattermost/platform ``` -4. Start your docker container by running: +4. Start your Docker container by running: ``` bash docker run --name mattermost-dev -d --publish 8065:80 mattermost/platform ``` -To upgrade to the latest master from the repository replace `mattermost/platform` with `mattermost/platform:dev` in the above instructions. +To upgrade to the latest development build on master from the repository replace `mattermost/platform` with `mattermost/platform:dev` in the instructions 3) and 4) above. Contributing ------------ diff --git a/requirements.md b/requirements.md new file mode 100644 index 000000000..cc0d1833d --- /dev/null +++ b/requirements.md @@ -0,0 +1,23 @@ +# Requirements + +## Web Client + +Supported Operating Systems and Browsers: + +- PC: Windows 7, Windows 8 (Chrome 43+, Firefox 38+, Internet Explorer 10+) +- Mac: OS 10 (Safari 7, Chrome 43+) +- Linux: Arch 4.0.0 (Chrome 43+) +- iPhone 4s and higher (Safari on iOS 8.3+, Chrome 43+) +- Android 5 and higher (Chrome 43+) + +## Server + +While the pre-released version of Mattermost is not currently supported in production, the intention from the product team is to support: + +- Ubuntu +- Debian +- CentOS +- RedHat Enterprise Linux +- Oracle Linux + +The Mattermost roadmap does not currently include production support for Fedora, FreeBSD or Arch Linux. diff --git a/utils/config.go b/utils/config.go index 536d0d802..46daf203c 100644 --- a/utils/config.go +++ b/utils/config.go @@ -234,8 +234,8 @@ func LoadConfig(fileName string) { // Check for a valid email for feedback, if not then do feedback@domain if _, err := mail.ParseAddress(config.EmailSettings.FeedbackEmail); err != nil { - config.EmailSettings.FeedbackEmail = "feedback@localhost" l4g.Error("Misconfigured feedback email setting: %s", config.EmailSettings.FeedbackEmail) + config.EmailSettings.FeedbackEmail = "feedback@localhost" } configureLog(config.LogSettings) diff --git a/web/react/components/channel_invite_modal.jsx b/web/react/components/channel_invite_modal.jsx index e446167ec..b70811db1 100644 --- a/web/react/components/channel_invite_modal.jsx +++ b/web/react/components/channel_invite_modal.jsx @@ -138,7 +138,7 @@ export default class ChannelInviteModal extends React.Component { <div className='modal-content'> <div className='modal-header'> <button type='button' className='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>×</span></button> - <h4 className='modal-title'>Add New Members to <span className='name'>{this.state.channel_name}</span></h4> + <h4 className='modal-title'>Add New Members to <span className='name'>{this.state.channelName}</span></h4> </div> <div className='modal-body'> {inviteError} diff --git a/web/react/components/edit_channel_modal.jsx b/web/react/components/edit_channel_modal.jsx index 1a633b193..76f0c2c4d 100644 --- a/web/react/components/edit_channel_modal.jsx +++ b/web/react/components/edit_channel_modal.jsx @@ -50,13 +50,18 @@ module.exports = React.createClass({ render: function() { var server_error = this.state.server_error ? <div className='form-group has-error'><br/><label className='control-label'>{ this.state.server_error }</label></div> : null; + var editTitle = <h4 className='modal-title' ref='title'>Edit Description</h4>; + if (this.state.title) { + editTitle = <h4 className='modal-title' ref='title'>Edit Description for <span className='name'>{this.state.title}</span></h4>; + } + return ( <div className="modal fade" ref="modal" id="edit_channel" role="dialog" tabIndex="-1" aria-hidden="true"> <div className="modal-dialog"> <div className="modal-content"> <div className="modal-header"> <button type="button" className="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> - <h4 className="modal-title" ref="title">Edit Description for {this.state.title}</h4> + {editTitle} </div> <div className="modal-body"> <textarea className="form-control no-resize" rows="6" ref="channelDesc" maxLength="1024" value={this.state.description} onChange={this.handleUserInput}></textarea> diff --git a/web/react/components/edit_post_modal.jsx b/web/react/components/edit_post_modal.jsx index 064d3fa94..2d865a45d 100644 --- a/web/react/components/edit_post_modal.jsx +++ b/web/react/components/edit_post_modal.jsx @@ -34,6 +34,7 @@ module.exports = React.createClass({ ); $("#edit_post").modal('hide'); + $(this.state.refocusId).focus(); }, handleEditInput: function(editText) { this.setState({ editText: editText }); @@ -52,12 +53,12 @@ module.exports = React.createClass({ var self = this; $(this.refs.modal.getDOMNode()).on('hidden.bs.modal', function(e) { - self.setState({ editText: "", title: "", channel_id: "", post_id: "", comments: 0 }); + self.setState({ editText: "", title: "", channel_id: "", post_id: "", comments: 0, refocusId: "" }); }); $(this.refs.modal.getDOMNode()).on('show.bs.modal', function(e) { var button = e.relatedTarget; - self.setState({ editText: $(button).attr('data-message'), title: $(button).attr('data-title'), channel_id: $(button).attr('data-channelid'), post_id: $(button).attr('data-postid'), comments: $(button).attr('data-comments') }); + self.setState({ editText: $(button).attr('data-message'), title: $(button).attr('data-title'), channel_id: $(button).attr('data-channelid'), post_id: $(button).attr('data-postid'), comments: $(button).attr('data-comments'), refocusId: $(button).attr('data-refoucsid') }); }); $(this.refs.modal.getDOMNode()).on('shown.bs.modal', function(e) { @@ -65,7 +66,7 @@ module.exports = React.createClass({ }); }, getInitialState: function() { - return { editText: "", title: "", post_id: "", channel_id: "", comments: 0 }; + return { editText: "", title: "", post_id: "", channel_id: "", comments: 0, refocusId: "" }; }, render: function() { var error = this.state.error ? <div className='form-group has-error'><label className='control-label'>{ this.state.error }</label></div> : null; diff --git a/web/react/components/new_channel.jsx b/web/react/components/new_channel.jsx index b00376758..38c9ea76d 100644 --- a/web/react/components/new_channel.jsx +++ b/web/react/components/new_channel.jsx @@ -127,12 +127,12 @@ module.exports = React.createClass({ <div className='modal-body'> <div className={displayNameClass}> <label className='control-label'>Display Name</label> - <input onKeyUp={this.displayNameKeyUp} type='text' ref='display_name' className='form-control' placeholder='Enter display name' maxLength='64' /> + <input onKeyUp={this.displayNameKeyUp} type='text' ref='display_name' className='form-control' placeholder='Enter display name' maxLength='22' /> {displayNameError} </div> <div className={nameClass}> <label className='control-label'>Handle</label> - <input type='text' className='form-control' ref='channel_name' placeholder="lowercase alphanumeric's only" maxLength='64' /> + <input type='text' className='form-control' ref='channel_name' placeholder="lowercase alphanumeric's only" maxLength='22' /> {nameError} </div> <div className='form-group'> diff --git a/web/react/components/post.jsx b/web/react/components/post.jsx index 7bc6a8c01..53ffeb400 100644 --- a/web/react/components/post.jsx +++ b/web/react/components/post.jsx @@ -102,7 +102,7 @@ module.exports = React.createClass({ currentUserCss = "current--user"; } - var timestamp = UserStore.getCurrentUser().update_at; + var timestamp = UserStore.getProfile(post.user_id).update_at; return ( <div> diff --git a/web/react/components/post_info.jsx b/web/react/components/post_info.jsx index c96a04c7c..73e897f62 100644 --- a/web/react/components/post_info.jsx +++ b/web/react/components/post_info.jsx @@ -49,6 +49,7 @@ export default class PostInfo extends React.Component { role='menuitem' data-toggle='modal' data-target='#edit_post' + data-refoucsid="#post_textbox" data-title={type} data-message={post.message} data-postid={post.id} diff --git a/web/react/components/post_right.jsx b/web/react/components/post_right.jsx index c8c51b0c3..ac4c8a6d7 100644 --- a/web/react/components/post_right.jsx +++ b/web/react/components/post_right.jsx @@ -93,7 +93,7 @@ RootPost = React.createClass({ <div> <a href='#' className='dropdown-toggle theme' type='button' data-toggle='dropdown' aria-expanded='false' /> <ul className='dropdown-menu' role='menu'> - <li role='presentation'><a href='#' role='menuitem' data-toggle='modal' data-target='#edit_post' data-title={type} data-message={post.message} data-postid={post.id} data-channelid={post.channel_id}>Edit</a></li> + <li role='presentation'><a href='#' role='menuitem' data-toggle='modal' data-target='#edit_post' data-refoucsid='#reply_textbox' data-title={type} data-message={post.message} data-postid={post.id} data-channelid={post.channel_id}>Edit</a></li> <li role='presentation'><a href='#' role='menuitem' data-toggle='modal' data-target='#delete_post' data-title={type} data-postid={post.id} data-channelid={post.channel_id} data-comments={this.props.commentCount}>Delete</a></li> </ul> </div> @@ -203,7 +203,7 @@ CommentPost = React.createClass({ <div className='dropdown' onClick={function(e){$('.post-list-holder-by-time').scrollTop($('.post-list-holder-by-time').scrollTop() + 50);}}> <a href='#' className='dropdown-toggle theme' type='button' data-toggle='dropdown' aria-expanded='false' /> <ul className='dropdown-menu' role='menu'> - <li role='presentation'><a href='#' role='menuitem' data-toggle='modal' data-target='#edit_post' data-title={type} data-message={post.message} data-postid={post.id} data-channelid={post.channel_id}>Edit</a></li> + <li role='presentation'><a href='#' role='menuitem' data-toggle='modal' data-target='#edit_post' data-refoucsid='#reply_textbox' data-title={type} data-message={post.message} data-postid={post.id} data-channelid={post.channel_id}>Edit</a></li> <li role='presentation'><a href='#' role='menuitem' data-toggle='modal' data-target='#delete_post' data-title={type} data-postid={post.id} data-channelid={post.channel_id} data-comments={0}>Delete</a></li> </ul> </div> diff --git a/web/react/components/setting_picture.jsx b/web/react/components/setting_picture.jsx index e97b67706..5b12ad7e9 100644 --- a/web/react/components/setting_picture.jsx +++ b/web/react/components/setting_picture.jsx @@ -48,6 +48,7 @@ module.exports = React.createClass({ } confirmButton = <a className={confirmButtonClass} onClick={this.props.submit}>Save</a>; } + var helpText = 'Upload a profile picture in either JPG or PNG format, at least ' + config.ProfileWidth + 'px in width and ' + config.ProfileHeight + 'px height.' var self = this; return ( @@ -59,6 +60,9 @@ module.exports = React.createClass({ {img} </li> <li className='setting-list-item'> + {helpText} + </li> + <li className='setting-list-item'> {serverError} {clientError} <span className='btn btn-sm btn-primary btn-file sel-btn'>Select<input ref='input' accept='.jpg,.png,.bmp' type='file' onChange={this.props.pictureChange}/></span> diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx index 103292abf..754843697 100644 --- a/web/react/utils/client.jsx +++ b/web/react/utils/client.jsx @@ -252,6 +252,7 @@ module.exports.revokeSession = function(altId, success, error) { module.exports.getSessions = function(userId, success, error) { $.ajax({ + cache: false, url: '/api/v1/users/' + userId + '/sessions', dataType: 'json', contentType: 'application/json', @@ -282,6 +283,7 @@ module.exports.getMeSynchronous = function(success, error) { var currentUser = null; $.ajax({ async: false, + cache: false, url: '/api/v1/users/me', dataType: 'json', contentType: 'application/json', @@ -293,12 +295,9 @@ module.exports.getMeSynchronous = function(success, error) { } }, error: function onError(xhr, status, err) { - var ieChecker = window.navigator.userAgent; // This and the condition below is used to check specifically for browsers IE10 & 11 to suppress a 200 'OK' error from appearing on login - if (xhr.status !== 200 || !(ieChecker.indexOf('Trident/7.0') > 0 || ieChecker.indexOf('Trident/6.0') > 0)) { - if (error) { - var e = handleError('getMeSynchronous', xhr, status, err); - error(e); - } + if (error) { + var e = handleError('getMeSynchronous', xhr, status, err); + error(e); } } }); @@ -566,6 +565,7 @@ module.exports.updateLastViewedAt = function(channelId, success, error) { function getChannels(success, error) { $.ajax({ + cache: false, url: '/api/v1/channels/', dataType: 'json', type: 'GET', @@ -581,6 +581,7 @@ module.exports.getChannels = getChannels; module.exports.getChannel = function(id, success, error) { $.ajax({ + cache: false, url: '/api/v1/channels/' + id + '/', dataType: 'json', type: 'GET', @@ -610,6 +611,7 @@ module.exports.getMoreChannels = function(success, error) { function getChannelCounts(success, error) { $.ajax({ + cache: false, url: '/api/v1/channels/counts', dataType: 'json', type: 'GET', @@ -653,6 +655,7 @@ module.exports.executeCommand = function(channelId, command, suggest, success, e module.exports.getPosts = function(channelId, offset, limit, success, error, complete) { $.ajax({ + cache: false, url: '/api/v1/channels/' + channelId + '/posts/' + offset + '/' + limit, dataType: 'json', type: 'GET', @@ -668,6 +671,7 @@ module.exports.getPosts = function(channelId, offset, limit, success, error, com module.exports.getPost = function(channelId, postId, success, error) { $.ajax({ + cache: false, url: '/api/v1/channels/' + channelId + '/post/' + postId, dataType: 'json', type: 'GET', @@ -791,6 +795,7 @@ module.exports.removeChannelMember = function(id, data, success, error) { module.exports.getProfiles = function(success, error) { $.ajax({ + cache: false, url: '/api/v1/users/profiles', dataType: 'json', contentType: 'application/json', diff --git a/web/templates/head.html b/web/templates/head.html index 5448b09ed..02904e764 100644 --- a/web/templates/head.html +++ b/web/templates/head.html @@ -50,6 +50,8 @@ config = {}; } config.SiteName = '{{ .SiteName }}'; + config.ProfileWidth = '{{ .Props.ProfileWidth }}' + config.ProfileHeight = '{{ .Props.ProfileHeight }}' </script> <script src="/static/js/bundle.js"></script> diff --git a/web/web.go b/web/web.go index d6f8d553b..dc2b5dced 100644 --- a/web/web.go +++ b/web/web.go @@ -4,18 +4,19 @@ package web import ( - l4g "code.google.com/p/log4go" "fmt" + "html/template" + "net/http" + "strconv" + "strings" + + l4g "code.google.com/p/log4go" "github.com/gorilla/mux" "github.com/mattermost/platform/api" "github.com/mattermost/platform/model" "github.com/mattermost/platform/utils" "github.com/mssola/user_agent" "gopkg.in/fsnotify.v1" - "html/template" - "net/http" - "strconv" - "strings" ) var Templates *template.Template @@ -30,6 +31,8 @@ func NewHtmlTemplatePage(templateName string, title string) *HtmlTemplatePage { props := make(map[string]string) props["AnalyticsUrl"] = utils.Cfg.ServiceSettings.AnalyticsUrl + props["ProfileHeight"] = fmt.Sprintf("%v", utils.Cfg.ImageSettings.ProfileHeight) + props["ProfileWidth"] = fmt.Sprintf("%v", utils.Cfg.ImageSettings.ProfileWidth) return &HtmlTemplatePage{TemplateName: templateName, Title: title, SiteName: utils.Cfg.ServiceSettings.SiteName, Props: props} } @@ -212,7 +215,7 @@ func signupTeamComplete(c *api.Context, w http.ResponseWriter, r *http.Request) props := model.MapFromJson(strings.NewReader(data)) t, err := strconv.ParseInt(props["time"], 10, 64) - if err != nil || model.GetMillis()-t > 1000*60*60 { // one hour + if err != nil || model.GetMillis()-t > 1000*60*60*24*30 { // 30 days c.Err = model.NewAppError("signupTeamComplete", "The signup link has expired", "") return } |