Make Mattermost Command easier to configure
The project service Mattermost Command is pretty complex to configure and all of it could be automated using their APIs and our existing integration; at least if Mattermost is installed as part of Omnibus.
- If Mattermost is installed by Omnibus or if SSO GitLab<>Mattermost is configured, detect the configuration automatically.
- Replace instructions and form with
Add to Mattermostbutton (but still provide instructions and form if Mattermost is not detected).
- When pressing the
Add to Mattermostbutton, the user is authenticated against Mattermost and enters an installation flow (see design below).
- After the installation is complete, the user can see in which Mattermost team the command was installed and also a
Edit in Mattermostbutton to configure or remove the installation
Flow and screens design
|1) Service (not installed)||2) OAuth in Mattermost||3) Service installation flow in GitLab||4) Service (successfully installed)|
|See Service installation scenarios below|
The OAuth screen comes from Mattermost's docs
The “Edit in Mattermost” button links to:
Service installation scenarios
|Multiple teams||One team||No permission||No teams|
Below the team selection input, the help text varies according to the following scenarios:
- If the user is not system admin AND the Restrict managing integrations to Admins option is true: “You can only install in teams where you are an administrator.”
- If the user is not system admin AND the Enable Team Creation option is false: “To create a team, ask your Mattermost system administrator.”
- If the user is system admin OR the Enable Team Creation option is true: “To create a team, use Mattermost’s interface”
The No permission screen appears if the Restrict managing integrations to Admins option is true AND the user is not an administrator of any team or system admin.
The No teams screen appears:
- if the Restrict managing integrations to Admins option is false AND the user isn't a member of any team
- OR if the Enable Team Creation option is true and there are no teams created yet
- OR if the Enable Team Creation option is false and the user is system admin
The “see list of built-in slash commands” links to https://docs.mattermost.com/help/messaging/executing-commands.html#built-in-commands, the “use Mattermost’s interface” links to
http://<mattermost-url>/create_team and the “join a team” links to