summaryrefslogtreecommitdiffstats
path: root/webapp/utils
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-01-15 15:40:43 +0000
committerJoram Wilander <jwawilander@gmail.com>2017-01-15 10:40:43 -0500
commit95251258f513d076c99da164e607dae5c39b9275 (patch)
treef221aa0da7fde86153f0258c70d00aea2412db43 /webapp/utils
parent2010f74a21bdc0a4838aed0268bf07dc131e410b (diff)
downloadchat-95251258f513d076c99da164e607dae5c39b9275.tar.gz
chat-95251258f513d076c99da164e607dae5c39b9275.tar.bz2
chat-95251258f513d076c99da164e607dae5c39b9275.zip
PLT-5049 (Webapp) New Channel Members UI. (#5036)
This replaces the existing Channel Members UI with one based on the Team Members UI, so that either a button, a role or a role with a menu can be displayed. Basic logic for which actions and roles are displayed is implemented, although this doesn't change behaviour or functionality at all, as that will come in later PRs. It does, however, add code to fetch the ChannelMember objects as that is necessary to provide the full set of actions and roles as intended.
Diffstat (limited to 'webapp/utils')
-rw-r--r--webapp/utils/constants.jsx1
-rw-r--r--webapp/utils/utils.jsx8
2 files changed, 9 insertions, 0 deletions
diff --git a/webapp/utils/constants.jsx b/webapp/utils/constants.jsx
index af099d4a0..c8ac74a82 100644
--- a/webapp/utils/constants.jsx
+++ b/webapp/utils/constants.jsx
@@ -74,6 +74,7 @@ export const ActionTypes = keyMirror({
RECEIVED_MORE_CHANNELS: null,
RECEIVED_CHANNEL_STATS: null,
RECEIVED_MY_CHANNEL_MEMBERS: null,
+ RECEIVED_MEMBERS_IN_CHANNEL: null,
FOCUS_POST: null,
RECEIVED_POSTS: null,
diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx
index e7ed9567b..9654ff605 100644
--- a/webapp/utils/utils.jsx
+++ b/webapp/utils/utils.jsx
@@ -54,6 +54,14 @@ export function isInRole(roles, inRole) {
return false;
}
+export function isChannelAdmin(roles) {
+ if (isInRole(roles, 'channel_admin')) {
+ return true;
+ }
+
+ return false;
+}
+
export function isAdmin(roles) {
if (isInRole(roles, 'team_admin')) {
return true;