diff options
-rw-r--r-- | api/command.go | 94 | ||||
-rw-r--r-- | api/command_test.go | 5 | ||||
-rw-r--r-- | i18n/en.json | 112 | ||||
-rw-r--r-- | i18n/es.json | 56 | ||||
-rw-r--r-- | model/client.go | 7 | ||||
-rw-r--r-- | model/command.go | 33 | ||||
-rw-r--r-- | store/sql_command_store.go | 1 | ||||
-rw-r--r-- | webapp/components/admin_console/legal_and_support_settings.jsx | 17 | ||||
-rw-r--r-- | webapp/components/signup_team_complete/components/team_signup_welcome_page.jsx | 6 | ||||
-rw-r--r-- | webapp/components/suggestion/command_provider.jsx | 4 | ||||
-rw-r--r-- | webapp/components/suggestion/suggestion_box.jsx | 3 | ||||
-rw-r--r-- | webapp/components/textbox.jsx | 1 | ||||
-rw-r--r-- | webapp/components/user_settings/manage_command_hooks.jsx | 313 | ||||
-rw-r--r-- | webapp/components/user_settings/user_settings_advanced.jsx | 4 | ||||
-rw-r--r-- | webapp/i18n/en.json | 77 | ||||
-rw-r--r-- | webapp/i18n/es.json | 38 | ||||
-rw-r--r-- | webapp/utils/async_client.jsx | 6 | ||||
-rw-r--r-- | webapp/utils/client.jsx | 5 | ||||
-rw-r--r-- | webapp/utils/constants.jsx | 4 | ||||
-rw-r--r-- | webapp/utils/utils.jsx | 3 | ||||
-rw-r--r-- | webapp/webpack.config.js | 2 |
21 files changed, 362 insertions, 429 deletions
diff --git a/api/command.go b/api/command.go index 29cee070e..99fd05d7a 100644 --- a/api/command.go +++ b/api/command.go @@ -44,7 +44,7 @@ func InitCommand(r *mux.Router) { sr := r.PathPrefix("/commands").Subrouter() sr.Handle("/execute", ApiUserRequired(executeCommand)).Methods("POST") - sr.Handle("/list", ApiUserRequired(listCommands)).Methods("POST") + sr.Handle("/list", ApiUserRequired(listCommands)).Methods("GET") sr.Handle("/create", ApiUserRequired(createCommand)).Methods("POST") sr.Handle("/list_team_commands", ApiUserRequired(listTeamCommands)).Methods("GET") @@ -76,9 +76,7 @@ func listCommands(c *Context, w http.ResponseWriter, r *http.Request) { } else { teamCmds := result.Data.([]*model.Command) for _, cmd := range teamCmds { - if cmd.ExternalManagement { - commands = append(commands, autocompleteCommands(c, cmd, r)...) - } else if cmd.AutoComplete && !seen[cmd.Id] { + if cmd.AutoComplete && !seen[cmd.Id] { cmd.Sanitize() seen[cmd.Trigger] = true commands = append(commands, cmd) @@ -90,92 +88,6 @@ func listCommands(c *Context, w http.ResponseWriter, r *http.Request) { w.Write([]byte(model.CommandListToJson(commands))) } -func autocompleteCommands(c *Context, cmd *model.Command, r *http.Request) []*model.Command { - props := model.MapFromJson(r.Body) - command := strings.TrimSpace(props["command"]) - channelId := strings.TrimSpace(props["channelId"]) - parts := strings.Split(command, " ") - trigger := parts[0][1:] - message := strings.Join(parts[1:], " ") - - chanChan := Srv.Store.Channel().Get(channelId) - teamChan := Srv.Store.Team().Get(c.Session.TeamId) - userChan := Srv.Store.User().Get(c.Session.UserId) - - var team *model.Team - if tr := <-teamChan; tr.Err != nil { - c.Err = tr.Err - return make([]*model.Command, 0, 32) - } else { - team = tr.Data.(*model.Team) - } - - var user *model.User - if ur := <-userChan; ur.Err != nil { - c.Err = ur.Err - return make([]*model.Command, 0, 32) - } else { - user = ur.Data.(*model.User) - } - - var channel *model.Channel - if cr := <-chanChan; cr.Err != nil { - c.Err = cr.Err - return make([]*model.Command, 0, 32) - } else { - channel = cr.Data.(*model.Channel) - } - - l4g.Debug(fmt.Sprintf(utils.T("api.command.execute_command.debug"), trigger, c.Session.UserId)) - p := url.Values{} - p.Set("token", cmd.Token) - - p.Set("team_id", cmd.TeamId) - p.Set("team_domain", team.Name) - - p.Set("channel_id", channelId) - p.Set("channel_name", channel.Name) - - p.Set("user_id", c.Session.UserId) - p.Set("user_name", user.Username) - - p.Set("command", "/"+trigger) - p.Set("text", message) - p.Set("response_url", "not supported yet") - p.Set("suggest", "true") - - method := "POST" - if cmd.Method == model.COMMAND_METHOD_GET { - method = "GET" - } - - tr := &http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: *utils.Cfg.ServiceSettings.EnableInsecureOutgoingConnections}, - } - client := &http.Client{Transport: tr} - - req, _ := http.NewRequest(method, cmd.URL, strings.NewReader(p.Encode())) - req.Header.Set("Accept", "application/json") - if cmd.Method == model.COMMAND_METHOD_POST { - req.Header.Set("Content-Type", "application/x-www-form-urlencoded") - } - - if resp, err := client.Do(req); err != nil { - c.Err = model.NewLocAppError("command", "api.command.execute_command.failed.app_error", map[string]interface{}{"Trigger": trigger}, err.Error()) - } else { - if resp.StatusCode == http.StatusOK { - response := model.CommandListFromJson(resp.Body) - - return response - - } else { - body, _ := ioutil.ReadAll(resp.Body) - c.Err = model.NewLocAppError("command", "api.command.execute_command.failed_resp.app_error", map[string]interface{}{"Trigger": trigger, "Status": resp.Status}, string(body)) - } - } - return make([]*model.Command, 0, 32) -} - func executeCommand(c *Context, w http.ResponseWriter, r *http.Request) { props := model.MapFromJson(r.Body) command := strings.TrimSpace(props["command"]) @@ -247,7 +159,7 @@ func executeCommand(c *Context, w http.ResponseWriter, r *http.Request) { teamCmds := result.Data.([]*model.Command) for _, cmd := range teamCmds { - if trigger == cmd.Trigger || cmd.ExternalManagement { + if trigger == cmd.Trigger { l4g.Debug(fmt.Sprintf(utils.T("api.command.execute_command.debug"), trigger, c.Session.UserId)) p := url.Values{} diff --git a/api/command_test.go b/api/command_test.go index 8ca8b65b1..22e2bd666 100644 --- a/api/command_test.go +++ b/api/command_test.go @@ -24,10 +24,7 @@ func TestListCommands(t *testing.T) { Client.LoginByEmail(team.Name, user1.Email, "pwd") - channel1 := &model.Channel{DisplayName: "AA", Name: "aa" + model.NewId() + "a", Type: model.CHANNEL_OPEN, TeamId: team.Id} - channel1 = Client.Must(Client.CreateChannel(channel1)).Data.(*model.Channel) - - if results, err := Client.ListCommands(channel1.Id, "/test"); err != nil { + if results, err := Client.ListCommands(); err != nil { t.Fatal(err) } else { commands := results.Data.([]*model.Command) diff --git a/i18n/en.json b/i18n/en.json index 775e56cc4..6ba877f56 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1708,6 +1708,26 @@ "translation": "Inappropriate permissions to regenerate outcoming webhook token" }, { + "id": "ent.compliance.licence_disable.app_error", + "translation": "Compliance functionality disabled by current license. Please contact your system administrator about upgrading your enterprise license." + }, + { + "id": "ent.compliance.run_failed.error", + "translation": "Compliance export failed for job '{{.JobName}}' at '{{.FilePath}}'" + }, + { + "id": "ent.compliance.run_finished.info", + "translation": "Compliance export finished for job '{{.JobName}}' exported {{.Count}} records to '{{.FilePath}}'" + }, + { + "id": "ent.compliance.run_limit.warning", + "translation": "Compliance export warning for job '{{.JobName}}' too many rows returned truncating to 30,000 at '{{.FilePath}}'" + }, + { + "id": "ent.compliance.run_started.info", + "translation": "Compliance export started for job '{{.JobName}}' at '{{.FilePath}}'" + }, + { "id": "ent.ldap.do_login.bind_admin_user.app_error", "translation": "Unable to bind to LDAP server. Check BindUsername and BindPassword." }, @@ -1800,26 +1820,6 @@ "translation": "Failed to read security bulletin details" }, { - "id": "ent.compliance.run_started.info", - "translation": "Compliance export started for job '{{.JobName}}' at '{{.FilePath}}'" - }, - { - "id": "ent.compliance.run_failed.error", - "translation": "Compliance export failed for job '{{.JobName}}' at '{{.FilePath}}'" - }, - { - "id": "ent.compliance.run_limit.warning", - "translation": "Compliance export warning for job '{{.JobName}}' too many rows returned truncating to 30,000 at '{{.FilePath}}'" - }, - { - "id": "ent.compliance.run_finished.info", - "translation": "Compliance export finished for job '{{.JobName}}' exported {{.Count}} records to '{{.FilePath}}'" - }, - { - "id": "ent.compliance.licence_disable.app_error", - "translation": "Compliance functionality disabled by current license. Please contact your system administrator about upgrading your enterprise license." - }, - { "id": "mattermost.security_checks.debug", "translation": "Checking for security update from Mattermost" }, @@ -1996,6 +1996,30 @@ "translation": "Invalid user id" }, { + "id": "model.compliance.is_valid.create_at.app_error", + "translation": "Create at must be a valid time" + }, + { + "id": "model.compliance.is_valid.desc.app_error", + "translation": "Invalid description" + }, + { + "id": "model.compliance.is_valid.end_at.app_error", + "translation": "To must be a valid time" + }, + { + "id": "model.compliance.is_valid.id.app_error", + "translation": "Invalid Id" + }, + { + "id": "model.compliance.is_valid.start_at.app_error", + "translation": "From must be a valid time" + }, + { + "id": "model.compliance.is_valid.start_end_at.app_error", + "translation": "To must be greater than From" + }, + { "id": "model.config.is_valid.email_reset_salt.app_error", "translation": "Invalid password reset salt for email settings. Must be 32 chars or more." }, @@ -2240,30 +2264,6 @@ "translation": "Invalid user id" }, { - "id": "model.compliance.is_valid.id.app_error", - "translation": "Invalid Id" - }, - { - "id": "model.compliance.is_valid.create_at.app_error", - "translation": "Create at must be a valid time" - }, - { - "id": "model.compliance.is_valid.desc.app_error", - "translation": "Invalid description" - }, - { - "id": "model.compliance.is_valid.start_at.app_error", - "translation": "From must be a valid time" - }, - { - "id": "model.compliance.is_valid.end_at.app_error", - "translation": "To must be a valid time" - }, - { - "id": "model.compliance.is_valid.start_end_at.app_error", - "translation": "To must be greater than From" - }, - { "id": "model.preference.is_valid.category.app_error", "translation": "Invalid category" }, @@ -2540,14 +2540,6 @@ "translation": "We encountered an error saving the audit" }, { - "id": "store.sql_compliance.save.saving.app_error", - "translation": "We encountered an error saving the compliance report" - }, - { - "id": "store.sql_compliance.get.finding.app_error", - "translation": "We encountered an error retrieving the compliance reports" - }, - { "id": "store.sql_channel.analytics_type_count.app_error", "translation": "We couldn't get channel type counts" }, @@ -2760,6 +2752,14 @@ "translation": "We couldn't update the command" }, { + "id": "store.sql_compliance.get.finding.app_error", + "translation": "We encountered an error retrieving the compliance reports" + }, + { + "id": "store.sql_compliance.save.saving.app_error", + "translation": "We encountered an error saving the compliance report" + }, + { "id": "store.sql_license.get.app_error", "translation": "We encountered an error getting the license" }, @@ -2848,10 +2848,6 @@ "translation": "We couldn't get post counts" }, { - "id": "store.sql_post.compliance_export.app_error", - "translation": "We couldn't get posts for compliance export" - }, - { "id": "store.sql_post.analytics_posts_count_by_day.app_error", "translation": "We couldn't get post counts by day" }, @@ -2860,6 +2856,10 @@ "translation": "We couldn't get user counts with posts" }, { + "id": "store.sql_post.compliance_export.app_error", + "translation": "We couldn't get posts for compliance export" + }, + { "id": "store.sql_post.delete.app_error", "translation": "We couldn't delete the post" }, diff --git a/i18n/es.json b/i18n/es.json index 231ebd9fb..97471ee98 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -1708,6 +1708,26 @@ "translation": "Permisos inapropiados para regenerar un token para el Webhook saliente" }, { + "id": "ent.compliance.licence_disable.app_error", + "translation": "La característica de Cumplimiento está deshabilitada para tu licencia actual. Por favor contacta a un administrador del sistema sobre como actualizar a una licencia enterprise." + }, + { + "id": "ent.compliance.run_failed.error", + "translation": "Fallo el trabajo '{{.JobName}}' para exportar el Cumplimiento en '{{.FilePath}}'" + }, + { + "id": "ent.compliance.run_finished.info", + "translation": "Se completo la exportación de Cumplimiento para el trabajo '{{.JobName}}' exportados {{.Count}} registros en '{{.FilePath}}'" + }, + { + "id": "ent.compliance.run_limit.warning", + "translation": "Advertencia en el trabajo '{{.JobName}}' para exportación de Cumplimiento. Se retornaron demasiados registros, truncando a 30,000 en '{{.FilePath}}'" + }, + { + "id": "ent.compliance.run_started.info", + "translation": "Iniciado el trabajo '{{.JobName}}' para exportar el Cumplimiento en '{{.FilePath}}'" + }, + { "id": "ent.ldap.do_login.bind_admin_user.app_error", "translation": "No se pudo enlazar con el servidor LDAP. Revisa las opciones de BindUsername y BindPassword." }, @@ -1976,6 +1996,30 @@ "translation": "Id de usuario inválido" }, { + "id": "model.compliance.is_valid.create_at.app_error", + "translation": "Create debe ser una fecha válida" + }, + { + "id": "model.compliance.is_valid.desc.app_error", + "translation": "Descripción inválida" + }, + { + "id": "model.compliance.is_valid.end_at.app_error", + "translation": "Hasta debe ser una fecha válida" + }, + { + "id": "model.compliance.is_valid.id.app_error", + "translation": "Id inválido" + }, + { + "id": "model.compliance.is_valid.start_at.app_error", + "translation": "Desde debe ser una fecha válida" + }, + { + "id": "model.compliance.is_valid.start_end_at.app_error", + "translation": "Desde debe ser mayor que Hasta" + }, + { "id": "model.config.is_valid.email_reset_salt.app_error", "translation": "Salt para restablecer contraseñas en la configuración de correos es inválido. Debe ser de 32 caracteres o más." }, @@ -2708,6 +2752,14 @@ "translation": "No pudimos actualizar el comando" }, { + "id": "store.sql_compliance.get.finding.app_error", + "translation": "Se ha detectado un error al recuperar los informes de cumplimiento" + }, + { + "id": "store.sql_compliance.save.saving.app_error", + "translation": "Se ha detectado un error al guardar el informe de cumplimiento" + }, + { "id": "store.sql_license.get.app_error", "translation": "Encontramos un error al obtener la licencia" }, @@ -2804,6 +2856,10 @@ "translation": "No pudimos obtener la cantidad de usuarios con mensajes" }, { + "id": "store.sql_post.compliance_export.app_error", + "translation": "No pudimos obtener los mensajes para exportar el informe de cumplimiento" + }, + { "id": "store.sql_post.delete.app_error", "translation": "No pudimos eliminar el mensaje" }, diff --git a/model/client.go b/model/client.go index 68cf11414..f5c8ad641 100644 --- a/model/client.go +++ b/model/client.go @@ -363,11 +363,8 @@ func (c *Client) Command(channelId string, command string, suggest bool) (*Resul } } -func (c *Client) ListCommands(channelId string, command string) (*Result, *AppError) { - m := make(map[string]string) - m["command"] = command - m["channelId"] = channelId - if r, err := c.DoApiPost("/commands/list", MapToJson(m)); err != nil { +func (c *Client) ListCommands() (*Result, *AppError) { + if r, err := c.DoApiGet("/commands/list", "", ""); err != nil { return nil, err } else { return &Result{r.Header.Get(HEADER_REQUEST_ID), diff --git a/model/command.go b/model/command.go index 8e0b31583..56d88f13c 100644 --- a/model/command.go +++ b/model/command.go @@ -14,23 +14,22 @@ const ( ) type Command struct { - Id string `json:"id"` - Token string `json:"token"` - CreateAt int64 `json:"create_at"` - UpdateAt int64 `json:"update_at"` - DeleteAt int64 `json:"delete_at"` - CreatorId string `json:"creator_id"` - TeamId string `json:"team_id"` - ExternalManagement bool `json:"external_management"` - Trigger string `json:"trigger"` - Method string `json:"method"` - Username string `json:"username"` - IconURL string `json:"icon_url"` - AutoComplete bool `json:"auto_complete"` - AutoCompleteDesc string `json:"auto_complete_desc"` - AutoCompleteHint string `json:"auto_complete_hint"` - DisplayName string `json:"display_name"` - URL string `json:"url"` + Id string `json:"id"` + Token string `json:"token"` + CreateAt int64 `json:"create_at"` + UpdateAt int64 `json:"update_at"` + DeleteAt int64 `json:"delete_at"` + CreatorId string `json:"creator_id"` + TeamId string `json:"team_id"` + Trigger string `json:"trigger"` + Method string `json:"method"` + Username string `json:"username"` + IconURL string `json:"icon_url"` + AutoComplete bool `json:"auto_complete"` + AutoCompleteDesc string `json:"auto_complete_desc"` + AutoCompleteHint string `json:"auto_complete_hint"` + DisplayName string `json:"display_name"` + URL string `json:"url"` } func (o *Command) ToJson() string { diff --git a/store/sql_command_store.go b/store/sql_command_store.go index a35737bd7..074a6e588 100644 --- a/store/sql_command_store.go +++ b/store/sql_command_store.go @@ -34,7 +34,6 @@ func NewSqlCommandStore(sqlStore *SqlStore) CommandStore { } func (s SqlCommandStore) UpgradeSchemaIfNeeded() { - s.CreateColumnIfNotExists("Commands", "ExternalManagement", "tinyint(1)", "boolean", "0") } func (s SqlCommandStore) CreateIndexesIfNotExists() { diff --git a/webapp/components/admin_console/legal_and_support_settings.jsx b/webapp/components/admin_console/legal_and_support_settings.jsx index 4997a1385..bbbb3713c 100644 --- a/webapp/components/admin_console/legal_and_support_settings.jsx +++ b/webapp/components/admin_console/legal_and_support_settings.jsx @@ -81,7 +81,22 @@ class LegalAndSupportSettings extends React.Component { return ( <div className='wrapper--fixed'> - + <div className='banner'> + <div className='banner__content'> + <h4 className='banner__heading'> + <FormattedMessage + id='admin.support.noteTitle' + defaultMessage='Note:' + /> + </h4> + <p> + <FormattedMessage + id='admin.support.noteDescription' + defaultMessage='If linking to an external site, URLs should begin with http:// or https://.' + /> + </p> + </div> + </div> <h3> <FormattedMessage id='admin.support.title' diff --git a/webapp/components/signup_team_complete/components/team_signup_welcome_page.jsx b/webapp/components/signup_team_complete/components/team_signup_welcome_page.jsx index 99e633659..78d7cec47 100644 --- a/webapp/components/signup_team_complete/components/team_signup_welcome_page.jsx +++ b/webapp/components/signup_team_complete/components/team_signup_welcome_page.jsx @@ -96,7 +96,11 @@ class TeamSignupWelcomePage extends React.Component { } handleKeyPress(event) { if (event.keyCode === 13) { - this.submitNext(event); + if (this.state.useDiff) { + this.handleDiffSubmit(event); + } else { + this.submitNext(event); + } } } componentWillUnmount() { diff --git a/webapp/components/suggestion/command_provider.jsx b/webapp/components/suggestion/command_provider.jsx index 204f52483..36860fa66 100644 --- a/webapp/components/suggestion/command_provider.jsx +++ b/webapp/components/suggestion/command_provider.jsx @@ -37,9 +37,9 @@ CommandSuggestion.propTypes = { }; export default class CommandProvider { - handlePretextChanged(suggestionId, pretext, channelId) { + handlePretextChanged(suggestionId, pretext) { if (pretext.startsWith('/')) { - AsyncClient.getSuggestedCommands(pretext, channelId, suggestionId, CommandSuggestion); + AsyncClient.getSuggestedCommands(pretext, suggestionId, CommandSuggestion); } } } diff --git a/webapp/components/suggestion/suggestion_box.jsx b/webapp/components/suggestion/suggestion_box.jsx index 97c6c6cd9..e3ec63194 100644 --- a/webapp/components/suggestion/suggestion_box.jsx +++ b/webapp/components/suggestion/suggestion_box.jsx @@ -111,7 +111,7 @@ export default class SuggestionBox extends React.Component { handlePretextChanged(pretext) { for (const provider of this.props.providers) { - provider.handlePretextChanged(this.suggestionId, pretext, this.props.channelId); + provider.handlePretextChanged(this.suggestionId, pretext); } } @@ -160,7 +160,6 @@ SuggestionBox.propTypes = { value: React.PropTypes.string.isRequired, onUserInput: React.PropTypes.func, providers: React.PropTypes.arrayOf(React.PropTypes.object), - channelId: React.PropTypes.string, // explicitly name any input event handlers we override and need to manually call onChange: React.PropTypes.func, diff --git a/webapp/components/textbox.jsx b/webapp/components/textbox.jsx index 952026ed5..1a395072e 100644 --- a/webapp/components/textbox.jsx +++ b/webapp/components/textbox.jsx @@ -224,7 +224,6 @@ export default class Textbox extends React.Component { style={{visibility: this.state.preview ? 'hidden' : 'visible'}} listComponent={SuggestionList} providers={this.suggestionProviders} - channelId={this.props.channelId} /> <div ref='preview' diff --git a/webapp/components/user_settings/manage_command_hooks.jsx b/webapp/components/user_settings/manage_command_hooks.jsx index 9703664cc..ce353ad64 100644 --- a/webapp/components/user_settings/manage_command_hooks.jsx +++ b/webapp/components/user_settings/manage_command_hooks.jsx @@ -4,13 +4,9 @@ import LoadingScreen from '../loading_screen.jsx'; import * as Client from 'utils/client.jsx'; -import * as Utils from 'utils/utils.jsx'; -import Constants from 'utils/constants.jsx'; import {intlShape, injectIntl, defineMessages, FormattedMessage, FormattedHTMLMessage} from 'react-intl'; -const PreReleaseFeatures = Constants.PRE_RELEASE_FEATURES; - const holders = defineMessages({ requestTypePost: { id: 'user.settings.cmds.request_type_post', @@ -63,7 +59,6 @@ export default class ManageCommandCmds extends React.Component { this.getCmds = this.getCmds.bind(this); this.addNewCmd = this.addNewCmd.bind(this); this.emptyCmd = this.emptyCmd.bind(this); - this.updateExternalManagement = this.updateExternalManagement.bind(this); this.updateTrigger = this.updateTrigger.bind(this); this.updateURL = this.updateURL.bind(this); this.updateMethod = this.updateMethod.bind(this); @@ -104,7 +99,7 @@ export default class ManageCommandCmds extends React.Component { addNewCmd(e) { e.preventDefault(); - if (this.state.cmd.url === '' || (this.state.cmd.trigger === '' && !this.state.external_management)) { + if (this.state.cmd.trigger === '' || this.state.cmd.url === '') { return; } @@ -194,12 +189,6 @@ export default class ManageCommandCmds extends React.Component { ); } - updateExternalManagement(e) { - var cmd = this.state.cmd; - cmd.external_management = e.target.checked; - this.setState(cmd); - } - updateTrigger(e) { var cmd = this.state.cmd; cmd.trigger = e.target.value; @@ -281,26 +270,11 @@ export default class ManageCommandCmds extends React.Component { ); } - let slashCommandAutocompleteDiv; - if (Utils.isFeatureEnabled(PreReleaseFeatures.SLASHCMD_AUTOCMP)) { - slashCommandAutocompleteDiv = ( - <div className='padding-top x2'> - <strong> - <FormattedMessage - id='user.settings.cmds.external_management' - defaultMessage='External management: ' - /> - </strong><span className='word-break--all'>{cmd.external_management ? this.props.intl.formatMessage(holders.autocompleteYes) : this.props.intl.formatMessage(holders.autocompleteNo)}</span> - </div> - ); - } - cmds.push( <div key={cmd.id} className='webhook__item webcmd__item' > - {slashCommandAutocompleteDiv} {triggerDiv} <div className='padding-top x2 webcmd__url'> <strong> @@ -442,188 +416,46 @@ export default class ManageCommandCmds extends React.Component { </div> ); - const disableButton = this.state.cmd.url === '' || (this.state.cmd.trigger === '' && !this.state.external_management); - - let triggerInput; - if (!this.state.cmd.external_management) { - triggerInput = ( - <div className='padding-top x2'> - <label className='control-label'> - <FormattedMessage - id='user.settings.cmds.trigger' - defaultMessage='Command Trigger Word: ' - /> - </label> - <div className='padding-top'> - <input - ref='trigger' - className='form-control' - 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.trigger_desc' - defaultMessage='Examples: /patient, /client, /employee Reserved: /echo, /join, /logout, /me, /shrug' - /> - </div> - </div> - ); - } - - let slashCommandAutocompleteCheckbox; - if (Utils.isFeatureEnabled(PreReleaseFeatures.SLASHCMD_AUTOCMP)) { - slashCommandAutocompleteCheckbox = ( - <div className='padding-top x2'> - <label className='control-label'> - <FormattedMessage - id='user.settings.cmds.external_management' - defaultMessage='External management: ' - /> - </label> - <div className='padding-top'> - <div className='checkbox'> - <label> - <input - type='checkbox' - checked={this.state.cmd.external_management} - onChange={this.updateExternalManagement} - /> - <FormattedMessage - id='user.settings.cmds.slashCmd_autocmp' - defaultMessage='Enable external application to offer autocomplete' - /> - </label> - </div> - </div> - </div> - - ); - } - - let autoCompleteSettings; - if (!this.state.cmd.external_management) { - autoCompleteSettings = ( - <div> - <div className='padding-top x2'> - <label className='control-label'> - <FormattedMessage - id='user.settings.cmds.auto_complete' - defaultMessage='Autocomplete: ' - /> - </label> - <div className='padding-top'> - <div className='checkbox'> - <label> - <input - type='checkbox' - checked={this.state.cmd.auto_complete} - onChange={this.updateAutoComplete} - /> - <FormattedMessage - id='user.settings.cmds.auto_complete_help' - 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_hint' - defaultMessage='Autocomplete Hint: ' - /> - </label> - <div className='padding-top'> - <input - ref='autoCompleteHint' - className='form-control' - value={this.state.cmd.auto_complete_hint} - onChange={this.updateAutoCompleteHint} - placeholder={this.props.intl.formatMessage(holders.addAutoCompleteHintPlaceholder)} - /> - </div> - <div className='padding-top'> - <FormattedMessage - id='user.settings.cmds.auto_complete_hint_desc' - defaultMessage='Optional hint in the autocomplete list about parameters needed for command.' - /> - </div> - </div> + const disableButton = this.state.cmd.trigger === '' || this.state.cmd.url === ''; - <div className='padding-top x2'> - <label className='control-label'> - <FormattedMessage - id='user.settings.cmds.auto_complete_desc' - defaultMessage='Autocomplete 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 className='padding-top'> - <FormattedMessage - id='user.settings.cmds.auto_complete_desc_desc' - defaultMessage='Optional short description of slash command for the autocomplete list.' - /> - </div> - </div> + return ( + <div key='addCommandCmd'> + <FormattedHTMLMessage + id='user.settings.cmds.add_desc' + 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. View all slash commands configured on this team below.' + /> + <div><label className='control-label padding-top x2'> + <FormattedMessage + id='user.settings.cmds.add_new' + defaultMessage='Add a new command' + /> + </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='Descriptive Label: ' + 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='Brief description of slash command to show in listings.' + id='user.settings.cmds.trigger_desc' + defaultMessage='Examples: /patient, /client, /employee Reserved: /echo, /join, /logout, /me, /shrug' /> </div> - {addError} </div> - </div> - ); - } - - return ( - <div key='addCommandCmd'> - <FormattedHTMLMessage - id='user.settings.cmds.add_desc' - 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. View all slash commands configured on this team below.' - /> - <div><label className='control-label padding-top x2'> - <FormattedMessage - id='user.settings.cmds.add_new' - defaultMessage='Add a new command' - /> - </label></div> - <div className='padding-top divider-light'></div> - <div className='padding-top'> - - {slashCommandAutocompleteCheckbox} - {triggerInput} <div className='padding-top x2'> <label className='control-label'> @@ -728,7 +560,102 @@ export default class ManageCommandCmds extends React.Component { </div> </div> - {autoCompleteSettings} + <div className='padding-top x2'> + <label className='control-label'> + <FormattedMessage + id='user.settings.cmds.auto_complete' + defaultMessage='Autocomplete: ' + /> + </label> + <div className='padding-top'> + <div className='checkbox'> + <label> + <input + type='checkbox' + checked={this.state.cmd.auto_complete} + onChange={this.updateAutoComplete} + /> + <FormattedMessage + id='user.settings.cmds.auto_complete_help' + 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_hint' + defaultMessage='Autocomplete Hint: ' + /> + </label> + <div className='padding-top'> + <input + ref='autoCompleteHint' + className='form-control' + value={this.state.cmd.auto_complete_hint} + onChange={this.updateAutoCompleteHint} + placeholder={this.props.intl.formatMessage(holders.addAutoCompleteHintPlaceholder)} + /> + </div> + <div className='padding-top'> + <FormattedMessage + id='user.settings.cmds.auto_complete_hint_desc' + 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.auto_complete_desc' + defaultMessage='Autocomplete 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 className='padding-top'> + <FormattedMessage + 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.display_name' + defaultMessage='Descriptive Label: ' + /> + </label> + <div className='padding-top'> + <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.cmd_display_name' + defaultMessage='Brief description of slash command to show in listings.' + /> + </div> + {addError} + </div> <div className='padding-top x2 padding-bottom'> <a diff --git a/webapp/components/user_settings/user_settings_advanced.jsx b/webapp/components/user_settings/user_settings_advanced.jsx index 40897e8c9..7c496f57b 100644 --- a/webapp/components/user_settings/user_settings_advanced.jsx +++ b/webapp/components/user_settings/user_settings_advanced.jsx @@ -51,10 +51,6 @@ const holders = defineMessages({ EMBED_TOGGLE: { id: 'user.settings.advance.embed_toggle', defaultMessage: 'Show toggle for all embed previews' - }, - SLASHCMD_AUTOCMP: { - id: 'user.settings.advance.slashCmd_autocmp', - defaultMessage: 'Enable external application to offer slash command autocomplete' } }); diff --git a/webapp/i18n/en.json b/webapp/i18n/en.json index 9a9477557..9b44f9abd 100644 --- a/webapp/i18n/en.json +++ b/webapp/i18n/en.json @@ -24,6 +24,39 @@ "activity_log_modal.iphoneNativeApp": "iPhone Native App", "admin.audits.reload": "Reload", "admin.audits.title": "User Activity", + "admin.compliance.directoryDescription": "Directory to which compliance reports are written. If blank, will be set to ./data/.", + "admin.compliance.directoryExample": "Ex \"./data/\"", + "admin.compliance.directoryTitle": "Compliance Directory Location:", + "admin.compliance.enableDailyTitle": "Enable Daily Report:", + "admin.compliance.enableDesc": "When true, Mattermost will generate a daily compliance report.", + "admin.compliance.enableTitle": "Enable Compliance:", + "admin.compliance.false": "false", + "admin.compliance.noLicense": "<h4 class=\"banner__heading\">Note:</h4><p>Compliance is an enterprise feature. Your current license does not support Compliance. Click <a href=\"http://mattermost.com\" target=\"_blank\">here</a> for information and pricing on enterprise licenses.</p>", + "admin.compliance.save": "Save", + "admin.compliance.saving": "Saving Config...", + "admin.compliance.title": "Compliance Settings", + "admin.compliance.true": "true", + "admin.compliance_reports.desc": "Job Name:", + "admin.compliance_reports.desc_placeholder": "Ex \"Audit 445 for HR\"", + "admin.compliance_reports.emails": "Emails:", + "admin.compliance_reports.emails_placeholder": "Ex \"bill@example.com, bob@example.com\"", + "admin.compliance_reports.from": "From:", + "admin.compliance_reports.from_placeholder": "Ex \"2016-03-11\"", + "admin.compliance_reports.keywords": "Keywords:", + "admin.compliance_reports.keywords_placeholder": "Ex \"shorting stock\"", + "admin.compliance_reports.reload": "Reload", + "admin.compliance_reports.run": "Run", + "admin.compliance_reports.title": "Compliance Reports", + "admin.compliance_reports.to": "To:", + "admin.compliance_reports.to_placeholder": "Ex \"2016-03-15\"", + "admin.compliance_table.desc": "Description", + "admin.compliance_table.download": "Download", + "admin.compliance_table.params": "Params", + "admin.compliance_table.records": "Records", + "admin.compliance_table.status": "Status", + "admin.compliance_table.timestamp": "Timestamp", + "admin.compliance_table.type": "Type", + "admin.compliance_table.userId": "Requested By", "admin.email.allowEmailSignInDescription": "When true, Mattermost allows users to sign in using their email and password.", "admin.email.allowEmailSignInTitle": "Allow Sign In With Email: ", "admin.email.allowSignupDescription": "When true, Mattermost allows team creation and account signup using email and password. This value should be false only when you want to limit signup to a single-sign-on service like OAuth or LDAP.", @@ -195,40 +228,6 @@ "admin.ldap.uernameAttrDesc": "The attribute in the LDAP server that will be used to populate the username field in Mattermost. This may be the same as the ID Attribute.", "admin.ldap.usernameAttrEx": "Ex \"sAMAccountName\"", "admin.ldap.usernameAttrTitle": "Username Attribute:", - "admin.compliance.saving": "Saving Config...", - "admin.compliance.directoryExample": "Ex \"./data/\"", - "admin.compliance.noLicense": "<h4 class=\"banner__heading\">Note:</h4><p>Compliance is an enterprise feature. Your current license does not support Compliance. Click <a href=\"http://mattermost.com\" target=\"_blank\">here</a> for information and pricing on enterprise licenses.</p>", - "admin.compliance.title": "Compliance Settings", - "admin.compliance.enableTitle": "Enable Compliance:", - "admin.compliance.true": "true", - "admin.compliance.false": "false", - "admin.compliance.enableDesc": "When true, Mattermost allows compliance reporting", - "admin.compliance.directoryTitle": "Compliance Directory Location:", - "admin.compliance.directoryDescription": "Directory to which compliance reports are written. If blank, will be set to ./data/.", - "admin.compliance.enableDailyTitle": "Enable Daily Report:", - "admin.compliance.enableDesc": "When true, Mattermost will generate a daily compliance report.", - "admin.compliance.save": "Save", - "admin.compliance_reports.from": "From:", - "admin.compliance_reports.to": "To:", - "admin.compliance_reports.emails": "Emails:", - "admin.compliance_reports.keywords": "Keywords:", - "admin.compliance_table.download": "Download", - "admin.compliance_table.timestamp": "Timestamp", - "admin.compliance_table.status": "Status", - "admin.compliance_table.records": "Records", - "admin.compliance_table.type": "Type", - "admin.compliance_table.desc": "Description", - "admin.compliance_table.userId": "Requested By", - "admin.compliance_table.params": "Params", - "admin.compliance_reports.title": "Compliance Reports", - "admin.compliance_reports.desc": "Job Name:", - "admin.compliance_reports.desc_placeholder": "Ex \"Audit 445 for HR\"", - "admin.compliance_reports.from_placeholder": "Ex \"2016-03-11\"", - "admin.compliance_reports.to_placeholder": "Ex \"2016-03-15\"", - "admin.compliance_reports.emails_placeholder": "Ex \"bill@example.com, bob@example.com\"", - "admin.compliance_reports.keywords_placeholder": "Ex \"shorting stock\"", - "admin.compliance_reports.run": "Run", - "admin.compliance_reports.reload": "Reload", "admin.licence.keyMigration": "If you’re migrating servers you may need to remove your license key from this server in order to install it on a new server. To start, <a href=\"http://mattermost.com\" target=\"_blank\">disable all Enterprise Edition features on this server</a>. This will enable the ability to remove the license key and downgrade this server from Enterprise Edition to Team Edition.", "admin.license.chooseFile": "Choose File", "admin.license.edition": "Edition: ", @@ -364,12 +363,12 @@ "admin.service.webhooksTitle": "Enable Incoming Webhooks: ", "admin.sidebar.addTeamSidebar": "Add team from sidebar menu", "admin.sidebar.audits": "Compliance and Auditing", + "admin.sidebar.compliance": "Compliance Settings", "admin.sidebar.email": "Email Settings", "admin.sidebar.file": "File Settings", "admin.sidebar.gitlab": "GitLab Settings", "admin.sidebar.ldap": "LDAP Settings", "admin.sidebar.license": "Edition and License", - "admin.sidebar.compliance": "Compliance Settings", "admin.sidebar.loading": "Loading", "admin.sidebar.log": "Log Settings", "admin.sidebar.logs": "Logs", @@ -426,6 +425,8 @@ "admin.support.termsDesc": "Link to Terms of Service available to users on desktop and on mobile. Leaving this blank will hide the option to display a notice.", "admin.support.termsTitle": "Terms of Service link:", "admin.support.title": "Legal and Support Settings", + "admin.support.noteTitle": "Note:", + "admin.support.noteDescription": "If linking to an external site, URLs should begin with http:// or https://.", "admin.system_analytics.activeUsers": "Active Users With Posts", "admin.system_analytics.title": "the System", "admin.system_analytics.totalPosts": "Total Posts", @@ -1130,7 +1131,6 @@ "tutorial_tip.seen": "Seen this before? ", "upload_overlay.info": "Drop a file to upload it.", "user.settings.advance.embed_preview": "Show preview snippet of links below message", - "user.settings.advance.slashCmd_autocmp": "Enable external application to offer slash command autocomplete", "user.settings.advance.embed_toggle": "Show toggle for all embed previews", "user.settings.advance.enabled": "enabled", "user.settings.advance.feature": " Feature ", @@ -1142,6 +1142,7 @@ "user.settings.advance.preReleaseTitle": "Preview pre-release features", "user.settings.advance.sendDesc": "If enabled 'Enter' inserts a new line and 'Ctrl + Enter' submits the message.", "user.settings.advance.sendTitle": "Send messages on Ctrl + Enter", + "user.settings.advance.slashCmd_autocmp": "Enable external application to offer slash command autocomplete", "user.settings.advance.title": "Advanced Settings", "user.settings.cmds.add": "Add", "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. View all slash commands configured on this team below.", @@ -1170,6 +1171,7 @@ "user.settings.cmds.request_type_desc": "The type of command request issued to the Request URL.", "user.settings.cmds.request_type_get": "GET", "user.settings.cmds.request_type_post": "POST", + "user.settings.cmds.slashCmd_autocmp": "Enable external application to offer autocomplete", "user.settings.cmds.token": "Token: ", "user.settings.cmds.trigger": "Command Trigger Word: ", "user.settings.cmds.trigger_desc": "Examples: /patient, /client, /employee Reserved: /echo, /join, /logout, /me, /shrug", @@ -1178,7 +1180,6 @@ "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.username": "Response Username: ", "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.slashCmd_autocmp": "Enable external application to offer autocomplete", "user.settings.custom_theme.awayIndicator": "Away Indicator", "user.settings.custom_theme.buttonBg": "Button BG", "user.settings.custom_theme.buttonColor": "Button Text", @@ -1354,4 +1355,4 @@ "web.footer.terms": "Terms", "web.header.back": "Back", "web.root.singup_info": "All team communication in one place, searchable and accessible anywhere" -}
\ No newline at end of file +} diff --git a/webapp/i18n/es.json b/webapp/i18n/es.json index 457752b64..606b4376d 100644 --- a/webapp/i18n/es.json +++ b/webapp/i18n/es.json @@ -24,6 +24,39 @@ "activity_log_modal.iphoneNativeApp": "iPhone App Nativa", "admin.audits.reload": "Recargar", "admin.audits.title": "Auditorías del Servidor", + "admin.compliance.directoryDescription": "Directorio en el que se escriben los informes de cumplimiento. Si se deja en blanco, se utilizará ./data/.", + "admin.compliance.directoryExample": "Ej \"./data/\"", + "admin.compliance.directoryTitle": "Ubicación del Directorio de Cumplimiento:", + "admin.compliance.enableDailyTitle": "Habilitar Informes Diarios:", + "admin.compliance.enableDesc": "Cuando es verdadero, Mattermost generará un informe diario de cumplimiento.", + "admin.compliance.enableTitle": "Habilitar el Cumplimiento:", + "admin.compliance.false": "falso", + "admin.compliance.noLicense": "<h4 class=\"banner__heading\">Nota:</h4><p>El Cumplimiento es una característica de la edición enterprise. Tu licencia actual no soporta Cumplimiento. Pincha <a href=\"http://mattermost.com\" target=\"_blank\">aquí</a> para información y precio de las licencias enterprise.</p>", + "admin.compliance.save": "Guardar", + "admin.compliance.saving": "Guardando...", + "admin.compliance.title": "Configuración de Cumplimiento", + "admin.compliance.true": "verdadero", + "admin.compliance_reports.desc": "Nombre del trabajo:", + "admin.compliance_reports.desc_placeholder": "Ej \"Auditoria 445 para RRHH\"", + "admin.compliance_reports.emails": "Correos electrónicos:", + "admin.compliance_reports.emails_placeholder": "Ej \"bill@ejemplo.com, bob@ejemplo.com\"", + "admin.compliance_reports.from": "Desde:", + "admin.compliance_reports.from_placeholder": "Ej \"2016-03-11\"", + "admin.compliance_reports.keywords": "Palabras clave:", + "admin.compliance_reports.keywords_placeholder": "Ej \"acortar inventario\"", + "admin.compliance_reports.reload": "Recargar", + "admin.compliance_reports.run": "Ejecutar", + "admin.compliance_reports.title": "Informes de Cumplimiento", + "admin.compliance_reports.to": "Hasta:", + "admin.compliance_reports.to_placeholder": "Ej \"2016-03-15\"", + "admin.compliance_table.desc": "Descripción", + "admin.compliance_table.download": "Descargar", + "admin.compliance_table.params": "Parámetros", + "admin.compliance_table.records": "Registros", + "admin.compliance_table.status": "Estado", + "admin.compliance_table.timestamp": "Marca de tiempo", + "admin.compliance_table.type": "Tipo", + "admin.compliance_table.userId": "Solicitado por", "admin.email.allowEmailSignInDescription": "Cuando es verdadero, Mattermost permite a los usuarios iniciar sesión utilizando el correo electrónico y contraseña.", "admin.email.allowEmailSignInTitle": "Permitir inicio de sesión con Correo electrónico: ", "admin.email.allowSignupDescription": "Cuando está en verdadero, Mattermost permite la creación de equipos y cuentas utilizando el correo electrónico y contraseña. Este valor debe estar en falso sólo cuando quieres limitar el inicio de sesión a través de servicios tipo OAuth o LDAP.", @@ -330,6 +363,7 @@ "admin.service.webhooksTitle": "Habilitar Webhooks de Entrada: ", "admin.sidebar.addTeamSidebar": "Agregar un equipo el menú lateral", "admin.sidebar.audits": "Auditorías", + "admin.sidebar.compliance": "Configuración de Cumplimiento", "admin.sidebar.email": "Configuración de correo", "admin.sidebar.file": "Configuracion de archivos", "admin.sidebar.gitlab": "Configuración de GitLab", @@ -1106,6 +1140,7 @@ "user.settings.advance.preReleaseTitle": "Previsualizar características de pre-lanzamiento", "user.settings.advance.sendDesc": "Si está habilitado 'Retorno' inserta una nueva linea y 'Ctrl + Retorno' envía el mensaje.", "user.settings.advance.sendTitle": "Enviar mensajes con Ctrl + Retorno", + "user.settings.advance.slashCmd_autocmp": "Habilitar que una aplicación externa ofrezca el autocompletado de los comandos de barra", "user.settings.advance.title": "Configuración Avanzada", "user.settings.cmds.add": "Agregar", "user.settings.cmds.add_desc": "Crea comandos de barra para enviar eventos a integraciones externas recibiendo una respuesta. Por ejemplo al escribir `/paciente Joe Smith` podría retornar los resultados de una búsqueda de los regístros de salud en tu sistema de administración para el nombre “Joe Smith”. Revisa la <a href=\"http://docs.mattermost.com/developer/slash-commands.html\">documentación de Comandos de Barra</a> para instrucciones detalladas. Ver todos los comandos de barra configurados para este equipo en la parte de abajo.", @@ -1134,6 +1169,7 @@ "user.settings.cmds.request_type_desc": "El tipo de comando que se utiliza al hacer una solicitud al URL.", "user.settings.cmds.request_type_get": "GET", "user.settings.cmds.request_type_post": "POST", + "user.settings.cmds.slashCmd_autocmp": "Habilitar que una aplicación externa ofrezca autocompletado", "user.settings.cmds.token": "Token: ", "user.settings.cmds.trigger": "Palabra Gatilladora del Comando: ", "user.settings.cmds.trigger_desc": "Ejemplos: /paciente, /cliente, /empleado Reservadas: /echo, /join, /logout, /me, /shrug", @@ -1317,4 +1353,4 @@ "web.footer.terms": "Términos", "web.header.back": "Atrás", "web.root.singup_info": "Todas las comunicaciones del equipo en un sólo lugar, con búsquedas y accesible desde cualquier parte" -}
\ No newline at end of file +} diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx index 2392b50b9..d3f91bb0e 100644 --- a/webapp/utils/async_client.jsx +++ b/webapp/utils/async_client.jsx @@ -781,12 +781,12 @@ export function savePreferences(preferences, success, error) { ); } -export function getSuggestedCommands(command, channelId, suggestionId, component) { - client.listCommands({command: command, channelId: channelId}, +export function getSuggestedCommands(command, suggestionId, component) { + client.listCommands( (data) => { var matches = []; data.forEach((cmd) => { - if (('/' + cmd.trigger).indexOf(command) === 0 || cmd.external_management) { + if (('/' + cmd.trigger).indexOf(command) === 0) { let s = '/' + cmd.trigger; let hint = ''; if (cmd.auto_complete_hint && cmd.auto_complete_hint.length !== 0) { diff --git a/webapp/utils/client.jsx b/webapp/utils/client.jsx index 69bda4303..e29cf71d3 100644 --- a/webapp/utils/client.jsx +++ b/webapp/utils/client.jsx @@ -1031,13 +1031,12 @@ export function regenCommandToken(data, success, error) { }); } -export function listCommands(data, success, error) { +export function listCommands(success, error) { $.ajax({ url: '/api/v1/commands/list', dataType: 'json', contentType: 'application/json', - type: 'POST', - data: JSON.stringify(data), + type: 'GET', success, error: function onError(xhr, status, err) { var e = handleError('listCommands', xhr, status, err); diff --git a/webapp/utils/constants.jsx b/webapp/utils/constants.jsx index 4ee934e11..a4aa7604c 100644 --- a/webapp/utils/constants.jsx +++ b/webapp/utils/constants.jsx @@ -595,10 +595,6 @@ export default { EMBED_TOGGLE: { label: 'embed_toggle', description: 'Show toggle for all embed previews' - }, - SLASHCMD_AUTOCMP: { - label: 'slashCmd_autocmp', - description: 'Enable external application to offer slash command autocomplete' } }, OVERLAY_TIME_DELAY: 400, diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx index 12a7ff50e..95a0f99d5 100644 --- a/webapp/utils/utils.jsx +++ b/webapp/utils/utils.jsx @@ -20,6 +20,7 @@ import React from 'react'; import {FormattedTime} from 'react-intl'; import icon50 from 'images/icon50x50.png'; +import bing from 'images/bing.mp3'; export function isEmail(email) { // writing a regex to match all valid email addresses is really, really hard (see http://stackoverflow.com/a/201378) @@ -187,7 +188,7 @@ var canDing = true; export function ding() { if (!isBrowserFirefox() && canDing) { - var audio = new Audio('/static/images/bing.mp3'); + var audio = new Audio(bing); audio.play(); canDing = false; setTimeout(() => { diff --git a/webapp/webpack.config.js b/webapp/webpack.config.js index 4a21d44c7..ee5c7e70b 100644 --- a/webapp/webpack.config.js +++ b/webapp/webpack.config.js @@ -52,7 +52,7 @@ var config = { loaders: ['style', 'css'] }, { - test: /\.(png|eot|tiff|svg|woff2|woff|ttf|gif)$/, + test: /\.(png|eot|tiff|svg|woff2|woff|ttf|gif|mp3)$/, loader: 'file', query: { name: 'files/[hash].[ext]' |