Skip to content

Commit

Permalink
Merge branch 'master' into advanced-permissions-phase-2
Browse files Browse the repository at this point in the history
  • Loading branch information
jespino committed May 11, 2018
2 parents ea1bf9a + b7ea06f commit 8c769be
Show file tree
Hide file tree
Showing 940 changed files with 5,966 additions and 4,414 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"parser": "babel-eslint",
"plugins": [
"react",
"import"
"import",
"header"
],
"env": {
"browser": true,
Expand Down Expand Up @@ -64,6 +65,7 @@
"generator-star-spacing": [2, {"before": false, "after": true}],
"global-require": 2,
"guard-for-in": 2,
"header/header": [2, "line", " Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n See LICENSE.txt for license information."],
"id-blacklist": 0,
"import/no-unresolved": 2,
"import/order": ["error", {"newlines-between": "always-and-inside-groups", "groups": ["builtin", "external", ["internal", "parent"], "sibling", "index"]}],
Expand Down
44 changes: 38 additions & 6 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1878,7 +1878,7 @@ Creative Commons may be contacted at creativecommons.org.

## whatwg-fetch

This product contains a portion of `whatwg-fetch`, a promise-based mechanism for programmatically making web requests in the browser by Mislav Marohnić.
This product contains a modified portion of 'whatwg-fetch', a promise-based mechanism for programmatically making web requests in the browser by Mislav Marohnić.

* HOMEPAGE:
* https://www.npmjs.com/package/whatwg-fetch
Expand Down Expand Up @@ -1945,7 +1945,7 @@ THE SOFTWARE.

## katex

KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.
This product contains a modified portion of 'KaTeX', a fast, easy-to-use JavaScript library for TeX math rendering on the web.

* HOMEPAGE:
* https://github.com/Khan/KaTeX
Expand Down Expand Up @@ -1984,7 +1984,7 @@ SOFTWARE.

## localforage-observable

This project adds observables to localForage, providing a way to get notified whenever.
This product contains a modified portion of 'localforage-observable, which adds observables to localForage, providing a way to get notified whenever.

* HOMEPAGE:
* https://github.com/localForage/localForage-observable
Expand All @@ -2009,7 +2009,7 @@ limitations under the License.

## hoist-non-react-statics

This project Copies non-react specific statics from a child component to a parent component.
This product contains a modified portion of 'hoist-non-react-statics', which copies non-react specific statics from a child component to a parent component.

* HOMEPAGE:
* https://github.com/mridgway/hoist-non-react-statics
Expand All @@ -2029,7 +2029,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND

## react-contextmenu

This project includes ContextMenu implemented in React with accessibility support, built by Vivek Kumar Bansal.
This product contains a modified portion of 'react-contextmenu', implemented in React with accessibility support, built by Vivek Kumar Bansal.

* HOMEPAGE:
* https://github.com/vkbansal/react-contextmenu
Expand All @@ -2050,7 +2050,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI

## url-search-params-polyfill

This project is a polyfill library for javascript's URLSearchParams class. This library has implemented all features from MDN document, built by Jerry Bendy.
This product contains a modified portion of 'url-search-params-polyfill', a polyfill library for javascript's URLSearchParams class. This library has implemented all features from MDN document, built by Jerry Bendy.

* HOMEPAGE:
* https://github.com/jerrybendy/url-search-params-polyfill
Expand Down Expand Up @@ -2078,3 +2078,35 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

--------

## moment-timezone

This product contains a modified portion of 'moment-timezone', which adds timezone support for moment.js, built by Moment.js.

* HOMEPAGE:
* https://github.com/moment/moment-timezone

* LICENSE:

The MIT License (MIT)

Copyright (c) JS Foundation and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18 changes: 14 additions & 4 deletions actions/admin_actions.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import * as AdminActions from 'mattermost-redux/actions/admin';
import * as UserActions from 'mattermost-redux/actions/users';
Expand All @@ -23,9 +23,10 @@ export async function saveConfig(config, success, error) {
}

export async function reloadConfig(success, error) {
const {data, error: err} = await AdminActions.reloadConfig()(dispatch, getState);
const {data, error: err} = await dispatch(AdminActions.reloadConfig());
if (data && success) {
AdminActions.getConfig()(dispatch, getState);
dispatch(AdminActions.getConfig());
dispatch(AdminActions.getEnvironmentConfig());
success(data);
} else if (err && error) {
error({id: err.server_error_id, ...err});
Expand Down Expand Up @@ -271,6 +272,15 @@ export async function elasticsearchTest(config, success, error) {
}
}

export async function testS3Connection(success, error) {
const {data, error: err} = await AdminActions.testS3Connection()(dispatch, getState);
if (data && success) {
success(data);
} else if (err && error) {
error({id: err.server_error_id, ...err});
}
}

export async function elasticsearchPurgeIndexes(success, error) {
const {data, error: err} = await AdminActions.purgeElasticsearchIndexes()(dispatch, getState);
if (data && success) {
Expand Down
4 changes: 2 additions & 2 deletions actions/channel_actions.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import * as ChannelActions from 'mattermost-redux/actions/channels';
import {deletePreferences, savePreferences} from 'mattermost-redux/actions/preferences';
Expand Down
4 changes: 2 additions & 2 deletions actions/diagnostics_actions.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {getConfig} from 'mattermost-redux/selectors/entities/general';

Expand Down
4 changes: 2 additions & 2 deletions actions/emoji_actions.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import * as EmojiActions from 'mattermost-redux/actions/emojis';

Expand Down
4 changes: 2 additions & 2 deletions actions/file_actions.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {batchActions} from 'redux-batched-actions';
import request from 'superagent';
Expand Down
2 changes: 1 addition & 1 deletion actions/global_actions.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// See LICENSE.txt for license information.

import debounce from 'lodash/debounce';

Expand Down
4 changes: 2 additions & 2 deletions actions/integration_actions.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import request from 'superagent';
import * as IntegrationActions from 'mattermost-redux/actions/integrations';
Expand Down
4 changes: 2 additions & 2 deletions actions/job_actions.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import * as JobsActions from 'mattermost-redux/actions/jobs';

Expand Down
6 changes: 3 additions & 3 deletions actions/notification_actions.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {isChannelMuted} from 'mattermost-redux/utils/channel_utils';
Expand Down Expand Up @@ -33,7 +33,7 @@ export function sendDesktopNotification(post, msgProps) {
const userStatus = UserStore.getStatus(user.id);
const member = ChannelStore.getMyMember(post.channel_id);

if (isChannelMuted(member) || userStatus === UserStatuses.DND) {
if (isChannelMuted(member) || userStatus === UserStatuses.DND || userStatus === UserStatuses.OUT_OF_OFFICE) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions actions/oauth_actions.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import * as IntegrationActions from 'mattermost-redux/actions/integrations';

Expand Down
4 changes: 2 additions & 2 deletions actions/post_actions.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {batchActions} from 'redux-batched-actions';
import {PostTypes, SearchTypes} from 'mattermost-redux/action_types';
Expand Down
4 changes: 2 additions & 2 deletions actions/status_actions.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {getStatusesByIds} from 'mattermost-redux/actions/users';

Expand Down
4 changes: 2 additions & 2 deletions actions/storage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {StorageTypes} from 'utils/constants';
import {getPrefix} from 'utils/storage_utils';
Expand Down
4 changes: 2 additions & 2 deletions actions/team_actions.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {TeamTypes} from 'mattermost-redux/action_types';
import {viewChannel, getChannelStats} from 'mattermost-redux/actions/channels';
Expand Down
12 changes: 8 additions & 4 deletions actions/user_actions.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {getChannelAndMyMember} from 'mattermost-redux/actions/channels';
import {getClientConfig, getLicenseConfig} from 'mattermost-redux/actions/general';
Expand All @@ -22,7 +22,7 @@ import store from 'stores/redux_store.jsx';
import TeamStore from 'stores/team_store.jsx';
import UserStore from 'stores/user_store.jsx';
import * as Utils from 'utils/utils.jsx';
import {Constants, Preferences} from 'utils/constants.jsx';
import {Constants, Preferences, UserStatuses} from 'utils/constants.jsx';

const dispatch = store.dispatch;
const getState = store.getState;
Expand Down Expand Up @@ -673,7 +673,11 @@ export function autoResetStatus() {
return userStatus;
}

const autoReset = getBool(getState(), PreferencesRedux.CATEGORY_AUTO_RESET_MANUAL_STATUS, currentUserId, false);
let autoReset = getBool(getState(), PreferencesRedux.CATEGORY_AUTO_RESET_MANUAL_STATUS, currentUserId, false);
const userIsOutOfOffice = Selectors.getStatusForUserId(getState(), currentUserId) === UserStatuses.OUT_OF_OFFICE;
if (userIsOutOfOffice) {
autoReset = false;
}

if (autoReset) {
UserActions.setStatus({user_id: currentUserId, status: 'online'})(doDispatch, doGetState);
Expand Down
4 changes: 2 additions & 2 deletions actions/views/channel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {isMobile} from 'utils/utils.jsx';
import {ActionTypes} from 'utils/constants.jsx';
Expand Down
4 changes: 2 additions & 2 deletions actions/views/create_comment.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {createSelector} from 'reselect';
import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';
Expand Down
4 changes: 2 additions & 2 deletions actions/views/edit_post_modal.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import * as PostActions from 'mattermost-redux/actions/posts';

Expand Down
4 changes: 2 additions & 2 deletions actions/views/lhs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2018-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {ActionTypes} from 'utils/constants.jsx';

Expand Down
4 changes: 2 additions & 2 deletions actions/views/modals.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {ActionTypes} from 'utils/constants';

Expand Down
4 changes: 2 additions & 2 deletions actions/views/notice.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2018-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {ActionTypes} from 'utils/constants';

Expand Down
4 changes: 2 additions & 2 deletions actions/views/rhs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {batchActions} from 'redux-batched-actions';

Expand Down
4 changes: 2 additions & 2 deletions actions/views/search.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2018-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {SearchTypes} from 'utils/constants';

Expand Down
4 changes: 2 additions & 2 deletions actions/views/webrtc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2018-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {ActionTypes} from 'utils/constants.jsx';

Expand Down
4 changes: 2 additions & 2 deletions actions/webrtc_actions.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {Client4} from 'mattermost-redux/client';

Expand Down
7 changes: 6 additions & 1 deletion actions/websocket_actions.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// See LICENSE.txt for license information.

import $ from 'jquery';
import {batchActions} from 'redux-batched-actions';
Expand Down Expand Up @@ -462,6 +462,11 @@ function handleDirectAddedEvent(msg) {
function handleUserAddedEvent(msg) {
if (ChannelStore.getCurrentId() === msg.broadcast.channel_id) {
getChannelStats(ChannelStore.getCurrentId())(dispatch, getState);
dispatch({
type: UserTypes.RECEIVED_PROFILE_IN_CHANNEL,
data: {user_id: msg.data.user_id},
id: msg.broadcast.channel_id,
});
}

if (TeamStore.getCurrentId() === msg.data.team_id && UserStore.getCurrentId() === msg.data.user_id) {
Expand Down
4 changes: 2 additions & 2 deletions client/web_websocket_client.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import WebSocketClient from './websocket_client.jsx';

Expand Down
Loading

0 comments on commit 8c769be

Please sign in to comment.