-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
[MM-18830] Unhelpful error message when adding bot to a channel before adding to team #12844
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Small (0/5) suggestion in case it matters to the translators.
i18n/en.json
Outdated
@@ -798,6 +798,10 @@ | |||
"id": "api.command_invite.user_already_in_channel.app_error", | |||
"translation": "{{.User}} is already in the channel." | |||
}, | |||
{ | |||
"id": "api.command_invite.user_not_in_team.app_error", | |||
"translation": "{{.User}} is not a member of the team." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"translation": "{{.User}} is not a member of the team." | |
"translation": "{{.Username}} is not a member of the team." |
app/command_invite.go
Outdated
@@ -143,6 +143,10 @@ func (me *InviteProvider) DoCommand(a *App, args *model.CommandArgs, message str | |||
var text string | |||
if err.Id == "api.channel.add_members.user_denied" { | |||
text = args.T("api.command_invite.group_constrained_user_denied") | |||
} else if err.Id == "store.sql_team.get_member.missing.app_error" { | |||
text = args.T("api.command_invite.user_not_in_team.app_error", map[string]interface{}{ | |||
"User": userProfile.Username, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"User": userProfile.Username, | |
"Username": userProfile.Username, |
Gentle reminder @cpanato , @DHaussermann ^_^ |
@iomodo can you update this PR with latest master? |
Mattermost test server updated with git commit Access here: https://mattermost-server-pr-12844.test.mattermost.cloud |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works as expected. Left a comment before merging.
i18n/en.json
Outdated
@@ -798,6 +798,10 @@ | |||
"id": "api.command_invite.user_already_in_channel.app_error", | |||
"translation": "{{.User}} is already in the channel." | |||
}, | |||
{ | |||
"id": "api.command_invite.user_not_in_team.app_error", | |||
"translation": "{{.Username}} is not a member of the team." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it should have @
before the username. Not sure if all but most of system messages have that convention so that it's clickable and can see details on profile popover. @asaadmahmood Any thoughts before merging this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, we should use an @
when the username is being shown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added @
to the username. There are lots of other uses of username without @
though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @asaadmahmood @iomodo!
Test server creation failed. See the logs for more information. |
* master: (70 commits) Run unused against codebase (mattermost#12968) [MM-12623] Create CLI command "config reset" (mattermost#10296) Migrate tests from store/storetest/status_store.go to use test… (mattermost#12873) Fix golangci-lint target (mattermost#12985) [MM-16437] Plugin crashes the server when calling WriteHeader with an invalid http code (mattermost#11276) MM-18060: Include deleted posts in compliance export. (mattermost#12957) [MM-18331] When patching a bot send websocket notification (mattermost#12373) [MM-19473] Fix data race on user login (mattermost#12870) license, openGraph tests: convert to testify (mattermost#12919) oauth_test: use testify (mattermost#12949) [MM-18830] Unhelpful error message when adding bot to a channel before adding to team (mattermost#12844) emoji_test: update to use testify (mattermost#12932) MM-19310 - Wrong validation message when Bot name ends in a . (mattermost#12905) Migrate tests from store/storetest/oauth_store.go to use testify (mattermost#12875) Include extra metadata when clicking an interactive button (mattermost#12697) MM-19553: Generate valid passwords on bulk import. (mattermost#12871) Convert api4/webhook_test.go t.Fatal calls into require/assert calls (mattermost#12904) Fix golangci-lint target for non GOPATH installations (mattermost#12934) MM-17888 Check plugin Helpers minimum server version comments (mattermost#12663) [MM-18898] Stringify plugin.Log* parameters (mattermost#12700) ...
Summary
This PR fixes error message. Message will be:
{{.Username}} is not a member of the team
Ticket Link
Fixes https://mattermost.atlassian.net/browse/MM-18830