diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/user_settings/manage_command_hooks.jsx | 266 | ||||
-rw-r--r-- | web/react/components/user_settings/user_settings_integrations.jsx | 4 | ||||
-rw-r--r-- | web/static/i18n/en.json | 47 | ||||
-rw-r--r-- | web/static/i18n/es.json | 22 |
4 files changed, 167 insertions, 172 deletions
diff --git a/web/react/components/user_settings/manage_command_hooks.jsx b/web/react/components/user_settings/manage_command_hooks.jsx index 3656424b2..f4009aeaa 100644 --- a/web/react/components/user_settings/manage_command_hooks.jsx +++ b/web/react/components/user_settings/manage_command_hooks.jsx @@ -18,7 +18,7 @@ const holders = defineMessages({ }, addDisplayNamePlaceholder: { id: 'user.settings.cmds.add_display_name.placeholder', - defaultMessage: 'Display Name' + defaultMessage: 'Example: "Search patient records"' }, addUsernamePlaceholder: { id: 'user.settings.cmds.add_username.placeholder', @@ -30,11 +30,11 @@ const holders = defineMessages({ }, addAutoCompleteDescPlaceholder: { id: 'user.settings.cmds.auto_complete_desc.placeholder', - defaultMessage: 'A short description of what this commands does.' + defaultMessage: 'Example: "Returns search results for patient records"' }, addAutoCompleteHintPlaceholder: { id: 'user.settings.cmds.auto_complete_hint.placeholder', - defaultMessage: '[zipcode]' + defaultMessage: 'Example: [Patient Name]' }, adUrlPlaceholder: { id: 'user.settings.cmds.url.placeholder', @@ -261,7 +261,7 @@ export default class ManageCommandCmds extends React.Component { <strong> <FormattedMessage id='user.settings.cmds.trigger' - defaultMessage='Trigger: ' + defaultMessage='Command Trigger Word: ' /> </strong>{cmd.trigger} </div> @@ -273,19 +273,41 @@ export default class ManageCommandCmds extends React.Component { key={cmd.id} className='webhook__item webcmd__item' > + {triggerDiv} + <div className='padding-top x2 webcmd__url'> + <strong> + <FormattedMessage + id='user.settings.cmds.url' + defaultMessage='Request URL: ' + /> + </strong><span className='word-break--all'>{cmd.url}</span> + </div> <div className='padding-top x2'> <strong> <FormattedMessage - id='user.settings.cmds.display_name' - defaultMessage='Display Name: ' + id='user.settings.cmds.request_type' + defaultMessage='Request Method: ' /> - </strong><span className='word-break--all'>{cmd.display_name}</span> + </strong> + <span className='word-break--all'> + { + cmd.method === 'P' ? + <FormattedMessage + id='user.settings.cmds.request_type_post' + defaultMessage='POST' + /> : + <FormattedMessage + id='user.settings.cmds.request_type_get' + defaultMessage='GET' + /> + } + </span> </div> <div className='padding-top x2'> <strong> <FormattedMessage id='user.settings.cmds.username' - defaultMessage='Username: ' + defaultMessage='Response Username: ' /> </strong><span className='word-break--all'>{cmd.username}</span> </div> @@ -293,7 +315,7 @@ export default class ManageCommandCmds extends React.Component { <strong> <FormattedMessage id='user.settings.cmds.icon_url' - defaultMessage='Icon URL: ' + defaultMessage='Response Icon: ' /> </strong><span className='word-break--all'>{cmd.icon_url}</span> </div> @@ -301,56 +323,34 @@ export default class ManageCommandCmds extends React.Component { <strong> <FormattedMessage id='user.settings.cmds.auto_complete' - defaultMessage='Auto Complete: ' + defaultMessage='Autocomplete: ' /> </strong><span className='word-break--all'>{cmd.auto_complete ? this.props.intl.formatMessage(holders.autocompleteYes) : this.props.intl.formatMessage(holders.autocompleteNo)}</span> </div> <div className='padding-top x2'> <strong> <FormattedMessage - id='user.settings.cmds.auto_complete_desc' - defaultMessage='Auto Complete Description: ' - /> - </strong><span className='word-break--all'>{cmd.auto_complete_desc}</span> - </div> - <div className='padding-top x2'> - <strong> - <FormattedMessage id='user.settings.cmds.auto_complete_hint' - defaultMessage='Auto Complete Hint: ' + defaultMessage='Autocomplete Hint: ' /> </strong><span className='word-break--all'>{cmd.auto_complete_hint}</span> </div> <div className='padding-top x2'> <strong> <FormattedMessage - id='user.settings.cmds.request_type' - defaultMessage='Request Type: ' + id='user.settings.cmds.auto_complete_desc' + defaultMessage='Autocomplete Description: ' /> - </strong> - <span className='word-break--all'> - { - cmd.method === 'P' ? - <FormattedMessage - id='user.settings.cmds.request_type_post' - defaultMessage='POST' - /> : - <FormattedMessage - id='user.settings.cmds.request_type_get' - defaultMessage='GET' - /> - } - </span> + </strong><span className='word-break--all'>{cmd.auto_complete_desc}</span> </div> - <div className='padding-top x2 webcmd__url'> + <div className='padding-top x2'> <strong> <FormattedMessage - id='user.settings.cmds.url' - defaultMessage='URL: ' + id='user.settings.cmds.display_name' + defaultMessage='Descriptive Label: ' /> - </strong><span className='word-break--all'>{cmd.url}</span> + </strong><span className='word-break--all'>{cmd.display_name}</span> </div> - {triggerDiv} <div className='padding-top'> <strong> <FormattedMessage @@ -420,7 +420,7 @@ export default class ManageCommandCmds extends React.Component { <div key='addCommandCmd'> <FormattedHTMLMessage id='user.settings.cmds.add_desc' - defaultMessage='Create commands to send message events to an external integration. Please see <a href="http://mattermost.org/commands">http://mattermost.org/commands</a> to learn more.' + defaultMessage='Create slash commands to send events to external integrations and receive a response. For example typing `/patient Joe Smith` could bring back search results from your internal health records management system for the name “Joe Smith”. Please see <a href="http://docs.mattermost.com/developer/slash-commands.html">Slash commands documentation</a> for detailed instructions.' /> <div><label className='control-label padding-top x2'> <FormattedMessage @@ -430,103 +430,139 @@ export default class ManageCommandCmds extends React.Component { </label></div> <div className='padding-top divider-light'></div> <div className='padding-top'> + <div className='padding-top x2'> <label className='control-label'> <FormattedMessage - id='user.settings.cmds.display_name' - defaultMessage='Display Name: ' + id='user.settings.cmds.trigger' + defaultMessage='Command Trigger Word: ' /> </label> <div className='padding-top'> <input - ref='displayName' + ref='trigger' className='form-control' - value={this.state.cmd.display_name} - onChange={this.updateDisplayName} - placeholder={this.props.intl.formatMessage(holders.addDisplayNamePlaceholder)} + value={this.state.cmd.trigger} + onChange={this.updateTrigger} + placeholder={this.props.intl.formatMessage(holders.addTriggerPlaceholder)} /> </div> <div className='padding-top'> <FormattedMessage - id='user.settings.cmds.cmd_display_name' - defaultMessage='Command display name.' + id='user.settings.cmds.trigger_desc' + defaultMessage='Examples: /patient, /client, /employee Reserved: /echo, /join, /logout, /me, /shrug' /> </div> </div> + <div className='padding-top x2'> <label className='control-label'> <FormattedMessage - id='user.settings.cmds.username' - defaultMessage='Username: ' + id='user.settings.cmds.url' + defaultMessage='Request URL: ' /> </label> <div className='padding-top'> - <input - ref='username' - className='form-control' - value={this.state.cmd.username} - onChange={this.updateUsername} - placeholder={this.props.intl.formatMessage(holders.addUsernamePlaceholder)} + <input + ref='URL' + className='form-control' + value={this.state.cmd.url} + rows={1} + onChange={this.updateURL} + placeholder={this.props.intl.formatMessage(holders.adUrlPlaceholder)} + /> + </div> + <div className='padding-top'> + <FormattedMessage + id='user.settings.cmds.url_desc' + defaultMessage='The callback URL to receive the HTTP POST or GET event request when the slash command is run.' /> </div> + </div> + + <div className='padding-top x2'> + <label className='control-label'> + <FormattedMessage + id='user.settings.cmds.request_type' + defaultMessage='Request Method: ' + /> + </label> + <div className='padding-top'> + <select + ref='method' + className='form-control' + value={this.state.cmd.method} + onChange={this.updateMethod} + > + <option value='P'> + {this.props.intl.formatMessage(holders.requestTypePost)} + </option> + <option value='G'> + {this.props.intl.formatMessage(holders.requestTypeGet)} + </option> + </select> + </div> <div className='padding-top'> <FormattedMessage - id='user.settings.cmds.username_desc' - defaultMessage='The username to use when overriding the post.' + id='user.settings.cmds.request_type_desc' + defaultMessage='The type of command request issued to the Request URL.' /> </div> </div> + <div className='padding-top x2'> <label className='control-label'> <FormattedMessage - id='user.settings.cmds.icon_url' - defaultMessage='Icon URL: ' + id='user.settings.cmds.username' + defaultMessage='Response Username: ' /> </label> <div className='padding-top'> <input - ref='iconURL' + ref='username' className='form-control' - value={this.state.cmd.icon_url} - onChange={this.updateIconURL} - placeholder='https://www.example.com/myicon.png' + value={this.state.cmd.username} + onChange={this.updateUsername} + placeholder={this.props.intl.formatMessage(holders.addUsernamePlaceholder)} /> </div> <div className='padding-top'> <FormattedMessage - id='user.settings.cmds.icon_url_desc' - defaultMessage='URL to an icon' + id='user.settings.cmds.username_desc' + defaultMessage='Choose a username override for responses for this slash command. Usernames can consist of up to 22 characters consisting of lowercase letters, numbers and they symbols "-", "_", and "." .' /> </div> </div> + <div className='padding-top x2'> <label className='control-label'> <FormattedMessage - id='user.settings.cmds.trigger' - defaultMessage='Trigger: ' + id='user.settings.cmds.icon_url' + defaultMessage='Response Icon: ' /> </label> <div className='padding-top'> <input - ref='trigger' + ref='iconURL' className='form-control' - value={this.state.cmd.trigger} - onChange={this.updateTrigger} - placeholder={this.props.intl.formatMessage(holders.addTriggerPlaceholder)} + value={this.state.cmd.icon_url} + onChange={this.updateIconURL} + placeholder='https://www.example.com/myicon.png' /> </div> <div className='padding-top'> <FormattedMessage - id='user.settings.cmds.trigger_desc' - defaultMessage='Word to trigger on' + id='user.settings.cmds.icon_url_desc' + defaultMessage='Choose a profile picture override for the post responses to this slash command. Enter the URL of a .png or .jpg file at least 128 pixels by 128 pixels.' /> - {''}</div> + </div> </div> + <div className='padding-top x2'> <label className='control-label'> <FormattedMessage id='user.settings.cmds.auto_complete' - defaultMessage='Auto Complete: ' + defaultMessage='Autocomplete: ' /> </label> <div className='padding-top'> @@ -539,34 +575,18 @@ export default class ManageCommandCmds extends React.Component { /> <FormattedMessage id='user.settings.cmds.auto_complete_help' - defaultMessage=' Show this command in autocomplete list' + defaultMessage=' Show this command in the autocomplete list.' /> </label> </div> </div> </div> - <div className='padding-top x2'> - <label className='control-label'> - <FormattedMessage - id='user.settings.cmds.auto_complete_desc' - defaultMessage='Auto Complete Description: ' - /> - </label> - <div className='padding-top'> - <input - ref='autoCompleteDesc' - className='form-control' - value={this.state.cmd.auto_complete_desc} - onChange={this.updateAutoCompleteDesc} - placeholder={this.props.intl.formatMessage(holders.addAutoCompleteDescPlaceholder)} - /> - </div> - </div> + <div className='padding-top x2'> <label className='control-label'> <FormattedMessage id='user.settings.cmds.auto_complete_hint' - defaultMessage='Auto Complete Hint: ' + defaultMessage='Autocomplete Hint: ' /> </label> <div className='padding-top'> @@ -581,64 +601,60 @@ export default class ManageCommandCmds extends React.Component { <div className='padding-top'> <FormattedMessage id='user.settings.cmds.auto_complete_hint_desc' - defaultMessage='List parameters to be passed to the command.' + defaultMessage='Optional hint in the autocomplete list about parameters needed for command.' /> </div> </div> + <div className='padding-top x2'> <label className='control-label'> <FormattedMessage - id='user.settings.cmds.request_type' - defaultMessage='Request Type: ' + id='user.settings.cmds.auto_complete_desc' + defaultMessage='Autocomplete Description: ' /> </label> <div className='padding-top'> - <select - ref='method' + <input + ref='autoCompleteDesc' className='form-control' - value={this.state.cmd.method} - onChange={this.updateMethod} - > - <option value='P'> - {this.props.intl.formatMessage(holders.requestTypePost)} - </option> - <option value='G'> - {this.props.intl.formatMessage(holders.requestTypeGet)} - </option> - </select> + value={this.state.cmd.auto_complete_desc} + onChange={this.updateAutoCompleteDesc} + placeholder={this.props.intl.formatMessage(holders.addAutoCompleteDescPlaceholder)} + /> </div> <div className='padding-top'> <FormattedMessage - id='user.settings.cmds.request_type_desc' - defaultMessage='Command request type issued to the callback URL.' + id='user.settings.cmds.auto_complete_desc_desc' + defaultMessage='Optional short description of slash command for the autocomplete list.' /> </div> </div> + <div className='padding-top x2'> <label className='control-label'> <FormattedMessage - id='user.settings.cmds.url' - defaultMessage='URL: ' + id='user.settings.cmds.display_name' + defaultMessage='Descriptive Label: ' /> </label> <div className='padding-top'> - <input - ref='URL' - className='form-control' - value={this.state.cmd.url} - rows={1} - onChange={this.updateURL} - placeholder={this.props.intl.formatMessage(holders.adUrlPlaceholder)} - /> + <input + ref='displayName' + className='form-control' + value={this.state.cmd.display_name} + onChange={this.updateDisplayName} + placeholder={this.props.intl.formatMessage(holders.addDisplayNamePlaceholder)} + /> </div> <div className='padding-top'> <FormattedMessage - id='user.settings.cmds.url_desc' - defaultMessage='URL that will receive the HTTP POST or GET event' + id='user.settings.cmds.cmd_display_name' + defaultMessage='Brief description of slash command to show in listings.' /> </div> {addError} </div> + <div className='padding-top x2 padding-bottom'> <a className={'btn btn-sm btn-primary'} diff --git a/web/react/components/user_settings/user_settings_integrations.jsx b/web/react/components/user_settings/user_settings_integrations.jsx index 1a9edab03..07d5230d1 100644 --- a/web/react/components/user_settings/user_settings_integrations.jsx +++ b/web/react/components/user_settings/user_settings_integrations.jsx @@ -28,11 +28,11 @@ const holders = defineMessages({ }, cmdName: { id: 'user.settings.integrations.commands', - defaultMessage: 'Commands' + defaultMessage: 'Slash Commands' }, cmdDesc: { id: 'user.settings.integrations.commandsDescription', - defaultMessage: 'Manage your commands' + defaultMessage: 'Manage your slash commands' } }); diff --git a/web/static/i18n/en.json b/web/static/i18n/en.json index db4e1a9b2..a865730a1 100644 --- a/web/static/i18n/en.json +++ b/web/static/i18n/en.json @@ -1062,37 +1062,38 @@ "user.settings.import_theme.submit": "Submit", "user.settings.cmds.request_type_post": "POST", "user.settings.cmds.request_type_get": "GET", - "user.settings.cmds.add_display_name.placeholder": "Display Name", + "user.settings.cmds.add_display_name.placeholder": "Example: \"Search patient records\"", "user.settings.cmds.add_username.placeholder": "Username", "user.settings.cmds.add_trigger.placeholder": "Command trigger e.g. \"hello\" not including the slash", - "user.settings.cmds.auto_complete_desc.placeholder": "A short description of what this commands does.", - "user.settings.cmds.auto_complete_hint.placeholder": "[zipcode]", + "user.settings.cmds.auto_complete_desc.placeholder": "Example: \"Returns search results for patient records\"", + "user.settings.cmds.auto_complete_hint.placeholder": "Example: [Patient Name]", + "user.settings.cmds.auto_complete_desc_desc": "Optional short description of slash command for the autocomplete list.", "user.settings.cmds.url.placeholder": "Must start with http:// or https://", "user.settings.cmds.auto_complete.yes": "yes", "user.settings.cmds.auto_complete.no": "no", - "user.settings.cmds.trigger": "Trigger: ", - "user.settings.cmds.display_name": "Display Name: ", - "user.settings.cmds.username": "Username: ", - "user.settings.cmds.icon_url": "Icon URL: ", - "user.settings.cmds.auto_complete": "Auto Complete: ", - "user.settings.cmds.auto_complete_desc": "Auto Complete Description: ", - "user.settings.cmds.auto_complete_hint": "Auto Complete Hint: ", - "user.settings.cmds.request_type": "Request Type: ", - "user.settings.cmds.url": "URL: ", + "user.settings.cmds.trigger": "Command Trigger Word: ", + "user.settings.cmds.display_name": "Descriptive Label: ", + "user.settings.cmds.username": "Response Username: ", + "user.settings.cmds.icon_url": "Response Icon: ", + "user.settings.cmds.auto_complete": "Autocomplete: ", + "user.settings.cmds.auto_complete_desc": "Autocomplete Description: ", + "user.settings.cmds.auto_complete_hint": "Autocomplete Hint: ", + "user.settings.cmds.request_type": "Request Method: ", + "user.settings.cmds.url": "Request URL: ", "user.settings.cmds.token": "Token: ", "user.settings.cmds.regen": "Regen Token", "user.settings.cmds.none": "None", "user.settings.cmds.existing": "Existing commands", - "user.settings.cmds.add_desc": "Create commands to send message events to an external integration. Please see <a href=\"http://mattermost.org/commands\">http://mattermost.org/commands</a> to learn more.", + "user.settings.cmds.add_desc": "Create slash commands to send events to external integrations and receive a response. For example typing `/patient Joe Smith` could bring back search results from your internal health records management system for the name 'Joe Smith'. Please see <a href=\"http://docs.mattermost.com/developer/slash-commands.html\">Slash commands documentation</a> for detailed instructions.", "user.settings.cmds.add_new": "Add a new command", - "user.settings.cmds.cmd_display_name": "Command display name.", - "user.settings.cmds.username_desc": "The username to use when overriding the post.", - "user.settings.cmds.icon_url_desc": "URL to an icon", - "user.settings.cmds.trigger_desc": "Word to trigger on", - "user.settings.cmds.auto_complete_help": " Show this command in autocomplete list", - "user.settings.cmds.auto_complete_hint_desc": "List parameters to be passed to the command.", - "user.settings.cmds.request_type_desc": "Command request type issued to the callback URL.", - "user.settings.cmds.url_desc": "URL that will receive the HTTP POST or GET event", + "user.settings.cmds.cmd_display_name": "Brief description of slash command to show in listings.", + "user.settings.cmds.username_desc": "Choose a username override for responses for this slash command. Usernames can consist of up to 22 characters consisting of lowercase letters, numbers and they symbols \"-\", \"_\", and \".\" .", + "user.settings.cmds.icon_url_desc": "Choose a profile picture override for the post responses to this slash command. Enter the URL of a .png or .jpg file at least 128 pixels by 128 pixels.", + "user.settings.cmds.trigger_desc": "Examples: /patient, /client, /employee Reserved: /echo, /join, /logout, /me, /shrug", + "user.settings.cmds.auto_complete_help": " Show this command in the autocomplete list.", + "user.settings.cmds.auto_complete_hint_desc": "Optional hint in the autocomplete list about parameters needed for command.", + "user.settings.cmds.request_type_desc": "The type of command request issued to the Request URL.", + "user.settings.cmds.url_desc": "The callback URL to receive the HTTP POST or GET event request when the slash command is run.", "user.settings.cmds.add": "Add", "user.settings.hooks_in.channel": "Channel: ", "user.settings.hooks_in.none": "None", @@ -1182,8 +1183,8 @@ "user.settings.integrations.incomingWebhooksDescription": "Manage your incoming webhooks", "user.settings.integrations.outWebhooks": "Outgoing Webhooks", "user.settings.integrations.outWebhooksDescription": "Manage your outgoing webhooks", - "user.settings.integrations.commands": "Commands", - "user.settings.integrations.commandsDescription": "Manage your commands", + "user.settings.integrations.commands": "Slash Commands", + "user.settings.integrations.commandsDescription": "Manage your slash commands", "user.settings.integrations.title": "Integration Settings", "user.settings.modal.general": "General", "user.settings.modal.security": "Security", diff --git a/web/static/i18n/es.json b/web/static/i18n/es.json index 8b9ab09bf..778ecc60a 100644 --- a/web/static/i18n/es.json +++ b/web/static/i18n/es.json @@ -1059,39 +1059,19 @@ "user.settings.advance.sendTitle": "Enviar mensajes con Ctrl + Retorno", "user.settings.advance.title": "Configuración Avanzada", "user.settings.cmds.add": "Agregar", - "user.settings.cmds.add_desc": "Crea comandos que permitan enviar eventos a integraciones externas. Por favor revisa <a href=\"http://mattermost.org/commands\">http://mattermost.org/commands</a> para aprender más.", - "user.settings.cmds.add_display_name.placeholder": "Nombre a mostrar", "user.settings.cmds.add_new": "Agregar un nuevo comando", "user.settings.cmds.add_trigger.placeholder": "Gatillador del Comando ej. \"hola\" no se debe incluir la barra", "user.settings.cmds.add_username.placeholder": "Nombre de usuario", - "user.settings.cmds.auto_complete": "Auto completado: ", "user.settings.cmds.auto_complete.no": "no", "user.settings.cmds.auto_complete.yes": "sí", - "user.settings.cmds.auto_complete_desc": "Descripción del Auto Completado: ", - "user.settings.cmds.auto_complete_desc.placeholder": "Una pequeña descripción de que hace el comando.", "user.settings.cmds.auto_complete_help": "Mostrar este comando en la lista de auto completado.", - "user.settings.cmds.auto_complete_hint": "Pista de auto completado: ", - "user.settings.cmds.auto_complete_hint.placeholder": "[código postal]", - "user.settings.cmds.auto_complete_hint_desc": "Lista de parámetros que recibe el comando.", - "user.settings.cmds.cmd_display_name": "Nombre a mostrar del Comando.", - "user.settings.cmds.display_name": "Nombre a mostrar: ", "user.settings.cmds.existing": "Comandos existentes", - "user.settings.cmds.icon_url": "URL del icono: ", - "user.settings.cmds.icon_url_desc": "URL para un icono", "user.settings.cmds.none": "Ninguno", "user.settings.cmds.regen": "Regenerar Token", - "user.settings.cmds.request_type": "Tipo de Solicitud: ", - "user.settings.cmds.request_type_desc": "Tipo de solicitud emitido al callback URL por el Comando.", "user.settings.cmds.request_type_get": "GET", "user.settings.cmds.request_type_post": "POST", "user.settings.cmds.token": "Token: ", - "user.settings.cmds.trigger": "Gatillador: ", - "user.settings.cmds.trigger_desc": "Palabra que gatilla la acción", - "user.settings.cmds.url": "URL: ", "user.settings.cmds.url.placeholder": "Debe comenzar con http:// o https://", - "user.settings.cmds.url_desc": "URL que va a recibir el evento HTTP POST o GET", - "user.settings.cmds.username": "Nombre de usuario: ", - "user.settings.cmds.username_desc": "El nombre de usuario a utilizar cuando se genere el mensaje.", "user.settings.custom_theme.awayIndicator": "Indicador Ausente", "user.settings.custom_theme.buttonBg": "Fondo Botón", "user.settings.custom_theme.buttonColor": "Texto Botón", @@ -1194,8 +1174,6 @@ "user.settings.import_theme.importHeader": "Importar Tema de Slack", "user.settings.import_theme.submit": "Enviar", "user.settings.import_theme.submitError": "Formato inválido, por favor intenta copiando y pegando nuevamente.", - "user.settings.integrations.commands": "Comandos", - "user.settings.integrations.commandsDescription": "Administra tus comandos", "user.settings.integrations.incomingWebhooks": "Webhooks de entrada", "user.settings.integrations.incomingWebhooksDescription": "Administra tus webhooks de entrada", "user.settings.integrations.outWebhooks": "Webhooks de salida", |