summaryrefslogtreecommitdiffstats
path: root/webapp/components/navbar.jsx
diff options
context:
space:
mode:
authorJonathan <jonfritz@gmail.com>2017-08-09 09:34:09 -0400
committerGitHub <noreply@github.com>2017-08-09 09:34:09 -0400
commitfd6856b674cc24deb708f2cd36c247662ee10bc7 (patch)
tree7c47d2468d894d7867fda71f0f6ac252832dd728 /webapp/components/navbar.jsx
parent6b741c4cea36f54b8f20c4a3e5871f00123db185 (diff)
downloadchat-fd6856b674cc24deb708f2cd36c247662ee10bc7.tar.gz
chat-fd6856b674cc24deb708f2cd36c247662ee10bc7.tar.bz2
chat-fd6856b674cc24deb708f2cd36c247662ee10bc7.zip
PLT-7206: Remove the "Delete Channel" option for private channels if you're the last channel member and policy setting restricts channel deletion (#7050)
* PLT-7206: UI changes. Removed last user in channel loophole, refactored code to clean it up, added differentiated support for public and private channels, added unit tests. Still need to implement server-side checks * PLT-7206: All helper methods in channel_utils.jsx now accept the same three boolean variables in the same order and use the same boolean logic to check their values. * PLT-7206: Added unit tests for showManagementOptions(...) * PLT-7206: Fixed test case descriptions * Added unit tests for showCreateOption(...) * PLT-7206: Added unit tests for canManageMembers(...) * PLT-7206: Removed last person in channel loophole from server-side code * PLT-7206: Reverted config.json * PLT-7206: Fixed double negatives in unit test names * PLT-7206: PR feedback - Removed confusing comment and unused variable
Diffstat (limited to 'webapp/components/navbar.jsx')
-rw-r--r--webapp/components/navbar.jsx7
1 files changed, 3 insertions, 4 deletions
diff --git a/webapp/components/navbar.jsx b/webapp/components/navbar.jsx
index 0217dc15c..25c458523 100644
--- a/webapp/components/navbar.jsx
+++ b/webapp/components/navbar.jsx
@@ -287,7 +287,6 @@ export default class Navbar extends React.Component {
};
createDropdown(channel, channelTitle, isSystemAdmin, isTeamAdmin, isChannelAdmin, isDirect, isGroup, popoverContent) {
- const isAdmin = isSystemAdmin || isTeamAdmin;
const infoIcon = Constants.INFO_ICON_SVG;
if (channel) {
@@ -434,7 +433,7 @@ export default class Navbar extends React.Component {
</li>
);
- if (ChannelUtils.canManageMembers(channel, isSystemAdmin, isTeamAdmin, isChannelAdmin)) {
+ if (ChannelUtils.canManageMembers(channel, isChannelAdmin, isTeamAdmin, isSystemAdmin)) {
manageMembersOption = (
<li
key='manage_members'
@@ -492,7 +491,7 @@ export default class Navbar extends React.Component {
</li>
);
- if (ChannelUtils.showManagementOptions(channel, isAdmin, isSystemAdmin, isChannelAdmin)) {
+ if (ChannelUtils.showManagementOptions(channel, isChannelAdmin, isTeamAdmin, isSystemAdmin)) {
setChannelHeaderOption = (
<li role='presentation'>
<a
@@ -539,7 +538,7 @@ export default class Navbar extends React.Component {
);
}
- if (ChannelUtils.showDeleteOption(channel, isAdmin, isSystemAdmin, isChannelAdmin, this.state.userCount)) {
+ if (ChannelUtils.showDeleteOptionForCurrentUser(channel, isChannelAdmin, isTeamAdmin, isSystemAdmin)) {
deleteChannelOption = (
<li role='presentation'>
<ToggleModalButton