summaryrefslogtreecommitdiffstats
path: root/webapp/reducers
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-08-29 09:54:02 -0400
committerGitHub <noreply@github.com>2017-08-29 09:54:02 -0400
commit257edc9ea3b25328aa44098e963815c3c3d25312 (patch)
treeed72b2f646ea9287fdccb5076b99b01bc8585a1d /webapp/reducers
parent82a8bd99cc5fe59fe4577c9b0d2c06a82c89e628 (diff)
downloadchat-257edc9ea3b25328aa44098e963815c3c3d25312.tar.gz
chat-257edc9ea3b25328aa44098e963815c3c3d25312.tar.bz2
chat-257edc9ea3b25328aa44098e963815c3c3d25312.zip
Experimental implementation for webapp plugins (#7185)
* Start of experimental implementation for webapp plugins * Updates to webapp plugin architecture * Update pluggable test * Remove debug code
Diffstat (limited to 'webapp/reducers')
-rw-r--r--webapp/reducers/index.js4
-rw-r--r--webapp/reducers/plugins/index.js22
2 files changed, 25 insertions, 1 deletions
diff --git a/webapp/reducers/index.js b/webapp/reducers/index.js
index ff2eb0d50..eb245d851 100644
--- a/webapp/reducers/index.js
+++ b/webapp/reducers/index.js
@@ -2,7 +2,9 @@
// See License.txt for license information.
import views from './views';
+import plugins from './plugins';
export default {
- views
+ views,
+ plugins
};
diff --git a/webapp/reducers/plugins/index.js b/webapp/reducers/plugins/index.js
new file mode 100644
index 000000000..9cad72715
--- /dev/null
+++ b/webapp/reducers/plugins/index.js
@@ -0,0 +1,22 @@
+// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+import {combineReducers} from 'redux';
+import {ActionTypes} from 'utils/constants.jsx';
+
+function components(state = {}, action) {
+ switch (action.type) {
+ case ActionTypes.RECEIVED_PLUGIN_COMPONENTS: {
+ if (action.data) {
+ return {...action.data, ...state};
+ }
+ return state;
+ }
+ default:
+ return state;
+ }
+}
+
+export default combineReducers({
+ components
+});