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

Adding /setup to autocomplete (GitHub issue mattermost#892) #898

Merged
merged 11 commits into from
Jan 5, 2023

Conversation

bobf7
Copy link
Contributor

@bobf7 bobf7 commented Dec 14, 2022

Summary

Adding /setup to autocomplete

Ticket Link

#892

@mattermod
Copy link
Contributor

Hello @bobf7,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

@mattermod
Copy link
Contributor

This PR has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!

Copy link
Contributor

@mickmister mickmister left a comment

Choose a reason for hiding this comment

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

@bobf7 Thanks so much for this improvement 👍

Sorry for the delay on this review. Mostly looks good, just a few non-blocking suggestions.

docs/setup/configuration.md Outdated Show resolved Hide resolved
server/command.go Outdated Show resolved Hide resolved
changing to suggested correct spelling

Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com>
@codecov-commenter
Copy link

codecov-commenter commented Jan 4, 2023

Codecov Report

Base: 31.27% // Head: 31.27% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (daf7a22) compared to base (a6aa3fe).
Patch coverage: 0.00% of modified lines in pull request are covered.

❗ Current head daf7a22 differs from pull request most recent head e2401d8. Consider uploading reports for the commit e2401d8 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #898      +/-   ##
==========================================
- Coverage   31.27%   31.27%   -0.01%     
==========================================
  Files          49       49              
  Lines        6017     6018       +1     
==========================================
  Hits         1882     1882              
- Misses       3946     3947       +1     
  Partials      189      189              
Impacted Files Coverage Δ
server/command.go 17.17% <0.00%> (-0.03%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com>
@bobf7
Copy link
Contributor Author

bobf7 commented Jan 5, 2023

@bobf7 Thanks so much for this improvement +1

Sorry for the delay on this review. Mostly looks good, just a few non-blocking suggestions.

Many thanks @mickmister ! Your suggestions look great so fixed now ✔️

server/command.go Outdated Show resolved Hide resolved
Comment on lines 152 to 155
// Help and info
jira.AddCommand(model.NewAutocompleteData("setup", "", "Start Jira plugin setup flow"))
jira.AddCommand(model.NewAutocompleteData("info", "", "Display information about the current user and the Jira plug-in"))
jira.AddCommand(model.NewAutocompleteData("help", "", "Display help for `/jira` command"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this new command is an admin command, I think this should instead be placed into the section above called Admin Commands

bobf7 and others added 2 commits January 5, 2023 00:33
Make command show for system admins

Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com>
@bobf7 bobf7 marked this pull request as draft January 5, 2023 01:29
Copy link
Contributor

@mickmister mickmister left a comment

Choose a reason for hiding this comment

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

@bobf7 Thanks for addressing the feedback 👍

I have one last request to remove the call to withFlagInstance for the /setup command. It should be good to go after this change 🚀

Comment on lines 324 to 329
func createSetupCommand(optInstance bool) *model.AutocompleteData {
setup := model.NewAutocompleteData(
"setup", "", "Start Jira plugin setup flow")
setup.RoleID = model.SystemAdminRoleId
withFlagInstance(setup, optInstance, routeAutocompleteInstalledInstanceWithAlias)
return setup
Copy link
Contributor

Choose a reason for hiding this comment

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

In the case if the /setup command, we actually don't want to include the instance flag. I think this should work along with changing the calling function:

Suggested change
func createSetupCommand(optInstance bool) *model.AutocompleteData {
setup := model.NewAutocompleteData(
"setup", "", "Start Jira plugin setup flow")
setup.RoleID = model.SystemAdminRoleId
withFlagInstance(setup, optInstance, routeAutocompleteInstalledInstanceWithAlias)
return setup
func createSetupCommand() *model.AutocompleteData {
setup := model.NewAutocompleteData(
"setup", "", "Start Jira plugin setup flow")
setup.RoleID = model.SystemAdminRoleId
return setup

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perfect, done!

@bobf7 bobf7 marked this pull request as ready for review January 5, 2023 21:23
@bobf7 bobf7 requested a review from mickmister January 5, 2023 21:27
Copy link
Contributor

@mickmister mickmister left a comment

Choose a reason for hiding this comment

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

LGTM 🎉 Thanks @bobf7!

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