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

[MM-382] Add feature to use struct fields in the channel welcome message #130

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ayusht2810
Copy link
Contributor

@ayusht2810 ayusht2810 commented Apr 16, 2024

Summary

  • Added feature to use struct fields in the channel welcome message
  • Updated readme regarding the above feature

Screenshot

image

Ticket Link

Fixes #96
Fixes #55

What to test?

  • Create a welcome message for a channel while using struct fields (eg: {{.UserDisplayName}}
  • Join the channel in which welcome message is created
  • Check for the words replaced by the struct fields

Checklist

  • Completed dev testing
  • make test Ran test cases and ensured they are passing
  • make check-style Ran style check and ensured both webapp and server pass the checks

@ayusht2810 ayusht2810 requested a review from mickmister as a code owner April 16, 2024 10:16
@ayusht2810 ayusht2810 self-assigned this Apr 16, 2024
@ayusht2810 ayusht2810 added the 2: Dev Review Requires review by a core committer label Apr 16, 2024
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
server/welcomebot.go Outdated Show resolved Hide resolved
server/welcomebot.go Outdated Show resolved Hide resolved
Comment on lines 66 to 76
if len(channelID) > 0 {
data.Channel, err = p.API.GetChannel(channelID)
if err != nil {
p.API.LogError("failed to query channel", "ChannelID", channelID)
return nil
}
}

data.UserDisplayName = data.User.GetDisplayName(model.ShowNicknameFullName)

return data
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it the case that channelID will always be provided and non-empty? Is it the case that this function must return a fully populated ChannelMessageTemplate?

If that's the case, we should return an error if necessary passed in data is not available. Not sure about the situation here though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it is not necessary to pass the channel ID here. Also, the function doesn't need to return a fully populated ChannelMessageTemplate.

@ayusht2810 ayusht2810 added the 3: QA Review Requires review by a QA tester label Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester
Projects
None yet
3 participants