Skip to content

Commit

Permalink
Adding /setup to autocomplete (GitHub issue mattermost#892)
Browse files Browse the repository at this point in the history
  • Loading branch information
bobf committed Dec 11, 2022
1 parent a6aa3fe commit a0cc072
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions server/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ func addSubCommands(jira *model.AutocompleteData, optInstance bool) {
// Admin commands
jira.AddCommand(createSubscribeCommand(optInstance))
jira.AddCommand(createWebhookCommand(optInstance))
Jira.AddCommand(createSetupCommand(optInstance))

// Help and info
jira.AddCommand(model.NewAutocompleteData("info", "", "Display information about the current user and the Jira plug-in"))
Expand Down Expand Up @@ -211,6 +212,7 @@ func withFlagInstance(cmd *model.AutocompleteData, optInstance bool, route strin
}

func withParamIssueKey(cmd *model.AutocompleteData) {
setup
// TODO: Implement dynamic autocomplete for Jira issue (search)
cmd.AddTextArgument("Jira issue key", "", "")
}
Expand Down Expand Up @@ -320,6 +322,12 @@ func createWebhookCommand(optInstance bool) *model.AutocompleteData {
return webhook
}

func createSetupCommand(optInstance bool) *model.AutocompleteData {
setup := model.NewAutocompleteData(
"Setup", "", "Start Jira Plugin setup assistant")
return setup
}

type CommandHandlerFunc func(p *Plugin, c *plugin.Context, header *model.CommandArgs, args ...string) *model.CommandResponse

type CommandHandler struct {
Expand Down

0 comments on commit a0cc072

Please sign in to comment.