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.
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
2010f74a21
Коммит
95251258f5
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Ссылка в новой задаче
Block a user