Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BASH-18 Add configs to show/hide server management and multiteam settings #600

Merged
merged 1 commit into from
Nov 7, 2017

Conversation

csduarte
Copy link
Contributor

@csduarte csduarte commented Sep 8, 2017

Description
This PR add values enableMultiTeams and enableServerManagement to show/hide server management and multiteam settings.

Test Cases
Add override values like this to override.json (src/common/config/override.json)
After entering the a fist server no others are accepted

//override.js
{
  "1": {
    "enableMultiTeams": false,
    "enableServerManagement": false
  }
}

screen shot 2017-09-08 at 11 57 05 am

Notes
Includes bash-20

@jasonblais jasonblais added this to the v3.8.0 milestone Sep 15, 2017
@jasonblais
Copy link
Contributor

@yuya-oc Same as in #587, can you help share a link for the test build from circle-ci? I'll test this out.

@yuya-oc
Copy link
Contributor

yuya-oc commented Sep 18, 2017

@jasonblais
Copy link
Contributor

@csduarte @dmeza What is the purpose of the enableMultiTeams setting?

@dmeza
Copy link
Contributor

dmeza commented Sep 18, 2017

@jasonblais @yuya-oc enableMultiTeams=false hides the Add new server link if there's already a server added. enableServerManagement=false hides the whole server management, it will not allow you to edit or remove, if there's already a server added.
The image bellow is with both options to false:
screen shot 2017-09-08 at 11 57 05 am

@jasonblais
Copy link
Contributor

@dmeza Thanks! I can definitely see the use case for enableServerManagement (e.g. use #594 to pre-configure the server URL and don't allow the end user to change it).

Couple of more questions:

  • can the user configure it via the config.json file? E.g. could they modify it and add more than one server?
  • would you have an example use case for when enableMultiTeams is false but enableServerManagement is true?

@dmeza
Copy link
Contributor

dmeza commented Sep 18, 2017

@jasonblais @csduarte:

  • Yes, the user can configure it via the config.json file. Yes, they could add more than one server.
  • an example use case for when enableMultiTeams is false but enableServerManagement is true, is when the client can connect to only one server. User could remove or edit the server but never add more than one thru the config screen.

Copy link
Contributor

@yuya-oc yuya-oc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to merging of #586, please rebase the branch.

@jasonblais
Copy link
Contributor

jasonblais commented Oct 11, 2017

@yuya-oc Once rebased, would you be able to help with test builds for the four cases

  • enableMultiTeams = false / enableServerManagement - false
  • enableMultiTeams = false / enableServerManagement - true
  • enableMultiTeams = true / enableServerManagement - false
  • enableMultiTeams = true / enableServerManagement - true

I'll give this one a try

@dmeza
Copy link
Contributor

dmeza commented Oct 11, 2017

@yuya-oc rebased and tested.

@yuya-oc
Copy link
Contributor

yuya-oc commented Oct 12, 2017

@dmeza Probably you haven't pushed the branch yet.

@dmeza
Copy link
Contributor

dmeza commented Oct 12, 2017

@yuya-oc I think it was new conflicts from the merge of bash-11. It's rebased and green.

@yuya-oc
Copy link
Contributor

yuya-oc commented Oct 12, 2017

@jasonblais

@jasonblais
Copy link
Contributor

@dmeza Tested all the different cases. Left a few test notes below, but overall it works as expected.

I'm a bit hesitant on how useful enableMultiTeams actually is for admins? Is there a compliance regulation where the user would not be allowed to sign into more than one server at a time?

I can see admins wanting to flip enableServerManagement on/off especially combined with defaultTeam setting added with #594


Test cases:

  1. enableMultiTeams = false / enableServerManagement = false

You can still successfully add a new server via

  • File > Sign in to Another Server (Mattermost > Sign in to Another Server on MacOS)
  • Clicking the "+" icon in the server tab bar, if you've added more than one server via config.json (see attached)

image

If enableServerManagement is set to false, propose

  • Hiding the menu bar option for Sign in to Another Server
  • Hiding the "+" icon
  1. enableMultiTeams = false / enableServerManagement = true

Same issues as in the first test case. However, the Sign in to Another Server should only be hidden in this case if you've already added a server.

Another issue I found is that the Server Management section was still missing from the Settings page. So you couldn't actually edit the existing server (or servers if you had added multiple servers directly via config.json).

  1. enableMultiTeams = true / enableServerManagement = false

Same issues as in the first test case, given server management is disabled.

  1. enableMultiTeams = true / enableServerManagement = true

Default case. No issues.


@yuya-oc Once we work on #618, would it be possible to not allow users define teams via config.json if enableServerManagement is set to false?


@yuya-oc @dmeza enableServerManagement should really be an Enterprise setting given it limits user freedom, but I realize we don't have such a thing on the desktop app. I'm not sure if there's much we can do about that?

All the other settings are a benefit for the end user or make the initial administration easier, including settings like defaultTeam.

Copy link
Contributor

@jasonblais jasonblais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above notes

@yuya-oc
Copy link
Contributor

yuya-oc commented Oct 18, 2017

@jasonblais Yes. Once we decide, I think enableServerManagement: false can prevent teams which are written at user's config.json.

This feature is never used for us because we must use enableServerManagement: true. I feel the feature would be useful when creating fully-customized enterprise app which uses only specific server though. But we need to continue to maintain unused feature in future, so it might be not suitable for our code base.

@jasonblais
Copy link
Contributor

@yuya-oc

Yes. Once we decide, I think enableServerManagement: false can prevent teams which are written at user's config.json.

Would this be easy to implement already for this PR?

This feature is never used for us because we must use enableServerManagement: true.

That's true, but I think that particular setting is fine to support. I can see that some Enterprise admins would find this feature useful. However, the setting I'm less certain about is enableMultiTeams.

@dmeza
Copy link
Contributor

dmeza commented Oct 24, 2017

@yuya-oc rebased to latest from master. Made changes for comments from @jasonblais #600 (comment):

  • Hide Sign in to Another Server and "+" icon when enableMultiTeams = false

Jason the problem you saw with:
Another issue I found is that the Server Management section was still missing from the Settings page. So you couldn't actually edit the existing server (or servers if you had added multiple servers directly via config.json).
It's because the values are set in: config.json in the user directory ~/Library/Application Support/Mattermost on OS X

Let me know if you have any other questions.

<Glyphicon glyph='plus'/>
</NavItem>
);
if (AppConfig.data.enableMultiTeams === true) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably enableServerManagement should be referred here instead of enableMultiTeams.

And please make components stateless as well as possible. So the value should be passed via props.
For example, add showAddServerButton prop to TabBar.jsx and MainPage.jsx, then pass the parameter at ReactDOM.render() of index.jsx.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yuya-oc refactored to keep TabBar.jsx stateless. The right condition is to hide the plus is when enableMultiTeams= true since that's when you can add more teams.

"helpLink": "https://docs.mattermost.com/help/apps/desktop-guide.html",
"enableMultiTeams": true,
"enableServerManagement": true,
"allowDarwinIconTray": true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably unnecessary in this PR.

Copy link
Contributor

@dmeza dmeza Oct 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yuya-oc that config is related to this condition: https://github.com/mattermost/desktop/pull/600/files#diff-125da514cff642c8a155d6a3e3f118d0R403
I guess it shouldn't have been part of the same commit. How would you like me to proceed? do another PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yuya-oc removed this logic and will add it to a new PR.

"helpLink": "https://docs.mattermost.com/help/apps/desktop-guide.html",
"enableMultiTeams": true,
"enableServerManagement": true,
"allowDarwinIconTray": true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably unnecessary in this PR.

@yuya-oc
Copy link
Contributor

yuya-oc commented Oct 26, 2017

@dmeza To make sure, would you tell us the purpose of enableServerManagement and enableMultiTeams?

I feel enableServerManagement=false is good to prevent adding/editing servers. But I could not imagine the situation: users can edit server settings but it's limited up to one (enableServerManagement=true, enableMultiTeams=false).

When do admins want to limit the number of servers? If the admin can use build-time config, I feel they uses defaultTeams of #633 and enableServerManagement=false.

@dmeza
Copy link
Contributor

dmeza commented Oct 26, 2017

@yuya-oc @jasonblais how it was originally thought was:

  • enableMultiTeams=false restricts the user from adding more teams. if one doesn't exist, it allows to add one.
  • enableServerManagement=false disables the ability to edit or delete teams, so the user can not change them once added.
    Is this correct @csduarte?

@jasonblais
Copy link
Contributor

@dmeza Thanks for the reply. How are these settings used at Shift?

@dmeza
Copy link
Contributor

dmeza commented Oct 30, 2017

@jasonblais both would be set to false since there is not option to add new servers or edit/delete the existing one. The changes are not exactly the same right now for shift/desktop since there's burnt logic to have a default Team, to not allow add more Teams and to not allow to edit Teams.

@jasonblais
Copy link
Contributor

@dmeza If enableServerManagement is set to false, then enableMultiTeams is obsolete given you can't edit (or add) servers?

I'd lean towards removing enableMultiTeams for now unless it's needed by Shift. I agree with @yuya-oc that the use case for this setting is limited.

@dmeza
Copy link
Contributor

dmeza commented Nov 1, 2017

@jasonblais @yuya-oc: discussed yesterday with @csduarte that two configs where added in case they needed to be handled as separate options. Shift will just be disabling all options to edit or add servers. I removed config enableMultiTeams and all of it's logic so this ticket can move forward.
Also, rebased to the latest. Let me know if you need any other changes.

@jasonblais
Copy link
Contributor

Thanks @dmeza!

@yuya-oc Can you help share a test build with "enableServerManagement": false. I can grab "enableServerManagement": true from the Circle CI.

@yuya-oc
Copy link
Contributor

yuya-oc commented Nov 2, 2017

@jasonblais
Copy link
Contributor

@dmeza When enableServerManagement is set to false, I unfortunately still see the following issues

  1. You can still successfully add a new server via
  • File > Sign in to Another Server (Mattermost > Sign in to Another Server on MacOS)
  • Clicking the "+" icon in the server tab bar, if you've added more than one server via config.json (see attached)

image

If enableServerManagement is set to false, propose

  • Hiding the menu bar option for Sign in to Another Server
  • Hiding the "+" icon
  1. It would also be good if we prevented users from editing/adding servers via config.json if enableServerManagement is set to false. But this I can create a separate ticket for in order to merge this one and not let it sit much longer.

@dmeza
Copy link
Contributor

dmeza commented Nov 6, 2017

@jasonblais I believe it's because you have the value "enableServerManagement": true in ~/Library/Application Support/Mattermost/config.json (on OS X). Tested locally and it's working properly. Please help me test again.

@jasonblais
Copy link
Contributor

@dmeza hm, I tested again and it seems to be working. Thanks!

@yuya-oc this one is good to merge.

@yuya-oc
Copy link
Contributor

yuya-oc commented Nov 7, 2017

I could confirmed, too. Thanks!

@yuya-oc yuya-oc merged commit 8003c49 into mattermost:master Nov 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants