From 0c6d60a5ae668bc9015fc3699831bef83eecb70f Mon Sep 17 00:00:00 2001 From: Jason Blais <13119842+jasonblais@users.noreply.github.com> Date: Thu, 2 May 2019 14:15:15 -0400 Subject: [PATCH] Proposed text updates for /jira slash commands (#41) * Proposed text updates for /jira slash commands Feedback welcome * Address review feedback on command.go --- server/command.go | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/server/command.go b/server/command.go index 9fa57d603..9c24253c1 100644 --- a/server/command.go +++ b/server/command.go @@ -10,21 +10,21 @@ import ( "github.com/mattermost/mattermost-server/plugin" ) -const helpText = "###### Mattermost JIRA Plugin - Slash Command Help\n" + - "* `/jira connect` - Connect your Mattermost account to your JIRA account\n" + - "* `/jira disconnect` - Disonnect your Mattermost account to your JIRA account\n" + - "* `/jira instance` - Manage JIRA instances connected to Mattermost\n" + - " * `list` - List known JIRA instances\n" + - " * `select ` - Select a known instance as current\n" + - " * `add server ` - Add a JIRA Server instance\n" + - " * `add cloud` - Add a JIRA Cloud instance\n" + +const helpText = "###### Mattermost Jira Plugin - Slash Command Help\n" + + "* `/jira connect` - Connect your Mattermost account to your Jira account and subscribe to events\n" + + "* `/jira disconnect` - Disonnect your Mattermost account from your Jira account\n" + + "* `/jira instance [add/list/select]` - Manage connected Jira instances\n" + + " * `/jira instance add server ` - Connect a Jira Server instance to Mattermost\n" + + " * `/jira instance add cloud` - Connect a Jira Cloud instance to Mattermost\n" + + " * `/jira instance list` - List connected Jira instances\n" + + " * `/jira instance select ` - Select the active Jira instance. At most one active Jira instance is currently supported\n" + "" func getCommand() *model.Command { return &model.Command{ Trigger: "jira", - DisplayName: "JIRA", - Description: "Integration with JIRA.", + DisplayName: "Jira", + Description: "Integration with Jira.", AutoComplete: true, AutoCompleteDesc: "Available commands: connect, disconnect, help", AutoCompleteHint: "[command]", @@ -54,18 +54,18 @@ func (p *Plugin) ExecuteCommand(c *plugin.Context, commandArgs *model.CommandArg } func executeConnect(p *Plugin, c *plugin.Context, args []string) *model.CommandResponse { - return responsef("[Click here to link your JIRA account.](%s/%s)", + return responsef("[Click here to link your Jira account.](%s/%s)", p.GetPluginURL(), routeUserConnect) } func executeDisconnect(p *Plugin, c *plugin.Context, args []string) *model.CommandResponse { - return responsef("[Click here to unlink your JIRA account.](%s/%s)", + return responsef("[Click here to unlink your Jira account.](%s/%s)", p.GetPluginURL(), routeUserDisconnect) } func executeInstance(p *Plugin, c *plugin.Context, args []string) *model.CommandResponse { if len(args) < 1 { - return responsef("Usage: /jira instance [add,list,select,delete]") + return responsef("Please specify a parameter in the form `/jira instance [add,list,select]") } action := args[0] args = args[1:] @@ -78,13 +78,13 @@ func executeInstance(p *Plugin, c *plugin.Context, args []string) *model.Command case "select": return executeInstanceSelect(p, c, args) } - return responsef("Usage: /jira instance [add,list,select,delete]") + return responsef("Please specify a parameter in the form `/jira instance [add,list,select]") } func executeInstanceList(p *Plugin, c *plugin.Context, args []string) *model.CommandResponse { known, err := p.LoadKnownJIRAInstances() if err != nil { - return responsef("Failed to load known JIRA instances: %v", err) + return responsef("Failed to load known Jira instances: %v", err) } if len(known) == 0 { return responsef("(none installed)\n") @@ -92,7 +92,7 @@ func executeInstanceList(p *Plugin, c *plugin.Context, args []string) *model.Com current, err := p.LoadCurrentJIRAInstance() if err != nil { - return responsef("Failed to load current JIRA instance: %v", err) + return responsef("Failed to load current Jira instance: %v", err) } keys := []string{} @@ -100,7 +100,7 @@ func executeInstanceList(p *Plugin, c *plugin.Context, args []string) *model.Com keys = append(keys, key) } sort.Strings(keys) - text := "Known JIRA instances (selected instance is **bold**)\n\n| |Key|Type|\n|--|--|--|\n" + text := "Known Jira instances (selected instance is **bold**)\n\n| |URL|Type|\n|--|--|--|\n" for i, key := range keys { typ := known[key] if key == current.GetURL() { @@ -114,14 +114,14 @@ func executeInstanceList(p *Plugin, c *plugin.Context, args []string) *model.Com func executeInstanceAdd(p *Plugin, c *plugin.Context, args []string) *model.CommandResponse { if len(args) < 1 { - return responsef("Usage: `/jira instance add server {URL}` or `/jira instance add cloud`") + return responsef("Please specify a parameter in the form `/jira instance add server {URL}` or `/jira instance add cloud`") } typ := args[0] switch typ { case JIRATypeServer: if len(args) < 2 { - return responsef("Usage: `/jira instance add server {URL}`") + return responsef("Please specify the server URL in the form `/jira instance add server {URL}`") } jiraURL := args[1] @@ -134,11 +134,11 @@ func executeInstanceAdd(p *Plugin, c *plugin.Context, args []string) *model.Comm case JIRATypeCloud: // TODO the exact group membership in JIRA? - return responsef(`As an admin, upload an application from %s/%s. The link can be found in "JIRA Settings/Applications/Manage"`, + return responsef(`As an admin, upload an application from %s/%s. The link can be found in **JIRA Settings > Applications > Manage**`, p.GetPluginURL(), routeACJSON) } - return responsef("Usage: `/jira instance add server {URL}` or `/jira instance add cloud`") + return responsef("Please specify a parameter in the form `/jira instance add server {URL}` or `/jira instance add cloud`") } func executeInstanceSelect(p *Plugin, c *plugin.Context, args []string) *model.CommandResponse { @@ -166,11 +166,11 @@ func executeInstanceSelect(p *Plugin, c *plugin.Context, args []string) *model.C ji, err := p.LoadJIRAInstance(instanceKey) if err != nil { - return responsef("failed to load JIRA instance %s: %v", instanceKey, err) + return responsef("Failed to load Jira instance %s: %v", instanceKey, err) } err = p.StoreJIRAInstance(ji, true) if err != nil { - return responsef("failed to store JIRA instance %s: %v", instanceKey, err) + return responsef("Failed to store Jira instance %s: %v", instanceKey, err) } return executeInstanceList(p, c, args)