summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/react/components/access_history_modal.jsx3
-rw-r--r--web/react/components/admin_console/admin_controller.jsx2
-rw-r--r--web/react/components/admin_console/admin_sidebar.jsx4
-rw-r--r--web/react/components/admin_console/analytics.jsx37
-rw-r--r--web/react/components/admin_console/audits.jsx5
-rw-r--r--web/react/components/admin_console/email_settings.jsx26
-rw-r--r--web/react/components/admin_console/ldap_settings.jsx2
-rw-r--r--web/react/components/admin_console/license_settings.jsx18
-rw-r--r--web/react/components/admin_console/service_settings.jsx104
-rw-r--r--web/react/components/audio_video_preview.jsx4
-rw-r--r--web/react/components/audit_table.jsx655
-rw-r--r--web/react/components/center_panel.jsx9
-rw-r--r--web/react/components/channel_header.jsx2
-rw-r--r--web/react/components/channel_loader.jsx62
-rw-r--r--web/react/components/create_comment.jsx20
-rw-r--r--web/react/components/create_post.jsx92
-rw-r--r--web/react/components/delete_post_modal.jsx2
-rw-r--r--web/react/components/file_attachment.jsx16
-rw-r--r--web/react/components/file_info_preview.jsx19
-rw-r--r--web/react/components/file_upload.jsx8
-rw-r--r--web/react/components/login_username.jsx4
-rw-r--r--web/react/components/navbar.jsx89
-rw-r--r--web/react/components/post_attachment.jsx22
-rw-r--r--web/react/components/post_body.jsx75
-rw-r--r--web/react/components/post_focus_view.jsx9
-rw-r--r--web/react/components/post_info.jsx57
-rw-r--r--web/react/components/posts_view.jsx27
-rw-r--r--web/react/components/search_results_item.jsx118
-rw-r--r--web/react/components/suggestion/command_provider.jsx3
-rw-r--r--web/react/components/textbox.jsx12
-rw-r--r--web/react/components/time_since.jsx19
-rw-r--r--web/react/components/user_settings/manage_command_hooks.jsx673
-rw-r--r--web/react/components/user_settings/user_settings_display.jsx2
-rw-r--r--web/react/components/user_settings/user_settings_integrations.jsx43
-rw-r--r--web/react/components/user_settings/user_settings_notifications.jsx6
-rw-r--r--web/react/components/view_image.jsx28
-rw-r--r--web/react/components/view_image_popover_bar.jsx23
-rw-r--r--web/react/dispatcher/event_helpers.jsx25
-rw-r--r--web/react/stores/post_store.jsx89
-rw-r--r--web/react/stores/socket_store.jsx46
-rw-r--r--web/react/stores/suggestion_store.jsx4
-rw-r--r--web/react/utils/async_client.jsx35
-rw-r--r--web/react/utils/channel_intro_messages.jsx146
-rw-r--r--web/react/utils/client.jsx76
-rw-r--r--web/react/utils/constants.jsx5
-rw-r--r--web/react/utils/locales/en.js16
-rw-r--r--web/react/utils/locales/es.js10
-rw-r--r--web/react/utils/markdown.jsx2
-rw-r--r--web/react/utils/utils.jsx37
-rw-r--r--web/sass-files/sass/partials/_base.scss236
-rw-r--r--web/sass-files/sass/partials/_headers.scss8
-rw-r--r--web/sass-files/sass/partials/_markdown.scss10
-rw-r--r--web/sass-files/sass/partials/_post.scss36
-rw-r--r--web/sass-files/sass/partials/_responsive.scss12
-rw-r--r--web/sass-files/sass/partials/_search.scss29
-rw-r--r--web/static/i18n/en.json267
-rw-r--r--web/static/i18n/es.json268
-rw-r--r--web/web_test.go4
58 files changed, 2657 insertions, 1004 deletions
diff --git a/web/react/components/access_history_modal.jsx b/web/react/components/access_history_modal.jsx
index 98b1d7cc1..af4d3fb0f 100644
--- a/web/react/components/access_history_modal.jsx
+++ b/web/react/components/access_history_modal.jsx
@@ -73,7 +73,8 @@ class AccessHistoryModal extends React.Component {
content = (
<AuditTable
audits={this.state.audits}
- moreInfo={this.state.moreInfo}
+ showIp={true}
+ showSession={true}
/>
);
}
diff --git a/web/react/components/admin_console/admin_controller.jsx b/web/react/components/admin_console/admin_controller.jsx
index 360ae3ef3..695e2083a 100644
--- a/web/react/components/admin_console/admin_controller.jsx
+++ b/web/react/components/admin_console/admin_controller.jsx
@@ -160,7 +160,7 @@ export default class AdminController extends React.Component {
} else if (this.state.selected === 'ldap_settings') {
tab = <LdapSettingsTab config={this.state.config} />;
} else if (this.state.selected === 'license') {
- tab = <LicenseSettingsTab />;
+ tab = <LicenseSettingsTab config={this.state.config} />;
} else if (this.state.selected === 'team_users') {
if (this.state.teams) {
tab = <TeamUsersTab team={this.state.teams[this.state.selectedTeam]} />;
diff --git a/web/react/components/admin_console/admin_sidebar.jsx b/web/react/components/admin_console/admin_sidebar.jsx
index 642bfe9d7..eadd8d412 100644
--- a/web/react/components/admin_console/admin_sidebar.jsx
+++ b/web/react/components/admin_console/admin_sidebar.jsx
@@ -225,7 +225,7 @@ export default class AdminSidebar extends React.Component {
>
<FormattedMessage
id='admin.sidebar.audits'
- defaultMessage='Audits'
+ defaultMessage='Compliance and Auditing'
/>
</a>
</li>
@@ -454,6 +454,7 @@ export default class AdminSidebar extends React.Component {
</ul>
<ul className='nav nav__sub-menu padded'>
{licenseSettings}
+ {audits}
<li>
<a
href='#'
@@ -466,7 +467,6 @@ export default class AdminSidebar extends React.Component {
/>
</a>
</li>
- {audits}
</ul>
</li>
</ul>
diff --git a/web/react/components/admin_console/analytics.jsx b/web/react/components/admin_console/analytics.jsx
index 0a159d2e3..ec9ad4da0 100644
--- a/web/react/components/admin_console/analytics.jsx
+++ b/web/react/components/admin_console/analytics.jsx
@@ -1,7 +1,6 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
-import * as Utils from '../../utils/utils.jsx';
import Constants from '../../utils/constants.jsx';
import LineChart from './line_chart.jsx';
import DoughnutChart from './doughnut_chart.jsx';
@@ -10,7 +9,7 @@ import StatisticCount from './statistic_count.jsx';
var Tooltip = ReactBootstrap.Tooltip;
var OverlayTrigger = ReactBootstrap.OverlayTrigger;
-import {injectIntl, intlShape, defineMessages, FormattedMessage} from 'mm-intl';
+import {injectIntl, intlShape, defineMessages, FormattedMessage, FormattedDate} from 'mm-intl';
const holders = defineMessages({
analyticsTotalUsers: {
@@ -75,10 +74,12 @@ export default class Analytics extends React.Component {
}
let loading = (
- <FormattedMessage
- id='admin.analytics.loading'
- defaultMessage='Loading...'
- />
+ <h5>
+ <FormattedMessage
+ id='admin.analytics.loading'
+ defaultMessage='Loading...'
+ />
+ </h5>
);
let firstRow;
@@ -322,7 +323,17 @@ export default class Analytics extends React.Component {
</time>
</OverlayTrigger>
</td>
- <td>{Utils.displayDateTime(user.last_activity_at)}</td>
+ <td>
+ <FormattedDate
+ value={user.last_activity_at}
+ day='numeric'
+ month='long'
+ year='numeric'
+ hour12={true}
+ hour='2-digit'
+ minute='2-digit'
+ />
+ </td>
</tr>
);
})
@@ -378,7 +389,17 @@ export default class Analytics extends React.Component {
</time>
</OverlayTrigger>
</td>
- <td>{Utils.displayDateTime(user.create_at)}</td>
+ <td>
+ <FormattedDate
+ value={user.create_at}
+ day='numeric'
+ month='long'
+ year='numeric'
+ hour12={true}
+ hour='2-digit'
+ minute='2-digit'
+ />
+ </td>
</tr>
);
})
diff --git a/web/react/components/admin_console/audits.jsx b/web/react/components/admin_console/audits.jsx
index 866539b3d..173e63b45 100644
--- a/web/react/components/admin_console/audits.jsx
+++ b/web/react/components/admin_console/audits.jsx
@@ -60,8 +60,9 @@ export default class Audits extends React.Component {
<div style={{margin: '10px'}}>
<AuditTable
audits={this.state.audits}
- oneLine={true}
showUserId={true}
+ showIp={true}
+ showSession={true}
/>
</div>
);
@@ -72,7 +73,7 @@ export default class Audits extends React.Component {
<h3>
<FormattedMessage
id='admin.audits.title'
- defaultMessage='Server Audits'
+ defaultMessage='User Activity'
/>
</h3>
<button
diff --git a/web/react/components/admin_console/email_settings.jsx b/web/react/components/admin_console/email_settings.jsx
index 17f25a04c..1d8f9c1dc 100644
--- a/web/react/components/admin_console/email_settings.jsx
+++ b/web/react/components/admin_console/email_settings.jsx
@@ -54,7 +54,7 @@ var holders = defineMessages({
},
pushServerEx: {
id: 'admin.email.pushServerEx',
- defaultMessage: 'E.g.: "https://push-test.mattermost.com"'
+ defaultMessage: 'E.g.: "http://push-test.mattermost.com"'
},
testing: {
id: 'admin.email.testing',
@@ -339,7 +339,10 @@ class EmailSettings extends React.Component {
defaultChecked={this.props.config.EmailSettings.EnableSignInWithEmail}
onChange={this.handleChange.bind(this, 'allowSignInWithEmail_true')}
/>
- {'true'}
+ <FormattedMessage
+ id='admin.email.true'
+ defaultMessage='true'
+ />
</label>
<label className='radio-inline'>
<input
@@ -349,7 +352,10 @@ class EmailSettings extends React.Component {
defaultChecked={!this.props.config.EmailSettings.EnableSignInWithEmail}
onChange={this.handleChange.bind(this, 'allowSignInWithEmail_false')}
/>
- {'false'}
+ <FormattedMessage
+ id='admin.email.false'
+ defaultMessage='false'
+ />
</label>
<p className='help-text'>
<FormattedMessage
@@ -380,7 +386,10 @@ class EmailSettings extends React.Component {
defaultChecked={this.props.config.EmailSettings.EnableSignInWithUsername}
onChange={this.handleChange.bind(this, 'allowSignInWithUsername_true')}
/>
- {'true'}
+ <FormattedMessage
+ id='admin.email.true'
+ defaultMessage='true'
+ />
</label>
<label className='radio-inline'>
<input
@@ -390,7 +399,10 @@ class EmailSettings extends React.Component {
defaultChecked={!this.props.config.EmailSettings.EnableSignInWithUsername}
onChange={this.handleChange.bind(this, 'allowSignInWithUsername_false')}
/>
- {'false'}
+ <FormattedMessage
+ id='admin.email.false'
+ defaultMessage='false'
+ />
</label>
<p className='help-text'>
<FormattedMessage
@@ -906,7 +918,7 @@ class EmailSettings extends React.Component {
<p className='help-text'>
<FormattedMessage
id='admin.email.pushServerDesc'
- defaultMessage='Location of Mattermost push notification service you can set up behind your firewall using https://github.com/mattermost/push-proxy. For testing you can use https://push-test.mattermost.com, which connects to the sample Mattermost iOS app in the public Apple AppStore. Please do not use test service for production deployments.'
+ defaultMessage='Location of Mattermost push notification service you can set up behind your firewall using https://github.com/mattermost/push-proxy. For testing you can use http://push-test.mattermost.com, which connects to the sample Mattermost iOS app in the public Apple AppStore. Please do not use test service for production deployments.'
/>
</p>
</div>
@@ -942,4 +954,4 @@ EmailSettings.propTypes = {
config: React.PropTypes.object
};
-export default injectIntl(EmailSettings); \ No newline at end of file
+export default injectIntl(EmailSettings);
diff --git a/web/react/components/admin_console/ldap_settings.jsx b/web/react/components/admin_console/ldap_settings.jsx
index bc13b3bcd..535c264dd 100644
--- a/web/react/components/admin_console/ldap_settings.jsx
+++ b/web/react/components/admin_console/ldap_settings.jsx
@@ -164,7 +164,7 @@ class LdapSettings extends React.Component {
<div className='banner__content'>
<FormattedHTMLMessage
id='admin.ldap.noLicense'
- defaultMessage='<h4 className="banner__heading">Note:</h4><p>LDAP is an enterprise feature. Your current license does not support LDAP. Click <a href="http://mattermost.com"target="_blank">here</a> for information and pricing on enterprise licenses.</p>'
+ defaultMessage='<h4 class="banner__heading">Note:</h4><p>LDAP is an enterprise feature. Your current license does not support LDAP. Click <a href="http://mattermost.com"target="_blank">here</a> for information and pricing on enterprise licenses.</p>'
/>
</div>
</div>
diff --git a/web/react/components/admin_console/license_settings.jsx b/web/react/components/admin_console/license_settings.jsx
index 539acd869..3332f37ef 100644
--- a/web/react/components/admin_console/license_settings.jsx
+++ b/web/react/components/admin_console/license_settings.jsx
@@ -109,7 +109,17 @@ class LicenseSettings extends React.Component {
);
licenseType = (
<FormattedHTMLMessage
- id='admin.license.entrepriseType'
+ id='admin.license.enterpriseType'
+ values={{
+ terms: global.window.mm_config.TermsOfServiceLink,
+ name: global.window.mm_license.Name,
+ company: global.window.mm_license.Company,
+ users: global.window.mm_license.Users,
+ issued: Utils.displayDate(parseInt(global.window.mm_license.IssuedAt, 10)) + ' ' + Utils.displayTime(parseInt(global.window.mm_license.IssuedAt, 10), true),
+ start: Utils.displayDate(parseInt(global.window.mm_license.StartsAt, 10)),
+ expires: Utils.displayDate(parseInt(global.window.mm_license.ExpiresAt, 10)),
+ ldap: global.window.mm_license.LDAP
+ }}
defaultMessage='<div><p>This compiled release of Mattermost platform is provided under a <a href="http://mattermost.com" target="_blank">commercial license</a>
from Mattermost, Inc. based on your subscription level and is subject to the <a href="{terms}" target="_blank">Terms of Service.</a></p>
<p>Your subscription details are as follows:</p>
@@ -126,6 +136,7 @@ class LicenseSettings extends React.Component {
licenseKey = (
<div className='col-sm-8'>
<button
+ disabled={this.props.config.LdapSettings.Enable}
className='btn btn-danger'
onClick={this.handleRemove}
id='remove-button'
@@ -256,7 +267,8 @@ class LicenseSettings extends React.Component {
}
LicenseSettings.propTypes = {
- intl: intlShape.isRequired
+ intl: intlShape.isRequired,
+ config: React.PropTypes.object
};
-export default injectIntl(LicenseSettings); \ No newline at end of file
+export default injectIntl(LicenseSettings);
diff --git a/web/react/components/admin_console/service_settings.jsx b/web/react/components/admin_console/service_settings.jsx
index 7021900eb..2cc68d1ed 100644
--- a/web/react/components/admin_console/service_settings.jsx
+++ b/web/react/components/admin_console/service_settings.jsx
@@ -75,6 +75,8 @@ class ServiceSettings extends React.Component {
config.ServiceSettings.EnableTesting = ReactDOM.findDOMNode(this.refs.EnableTesting).checked;
config.ServiceSettings.EnableDeveloper = ReactDOM.findDOMNode(this.refs.EnableDeveloper).checked;
config.ServiceSettings.EnableSecurityFixAlert = ReactDOM.findDOMNode(this.refs.EnableSecurityFixAlert).checked;
+ config.ServiceSettings.EnableCommands = ReactDOM.findDOMNode(this.refs.EnableCommands).checked;
+ config.ServiceSettings.EnableOnlyAdminIntegrations = ReactDOM.findDOMNode(this.refs.EnableOnlyAdminIntegrations).checked;
//config.ServiceSettings.EnableOAuthServiceProvider = ReactDOM.findDOMNode(this.refs.EnableOAuthServiceProvider).checked;
@@ -389,11 +391,105 @@ class ServiceSettings extends React.Component {
<div className='form-group'>
<label
className='control-label col-sm-4'
+ htmlFor='EnableCommands'
+ >
+ <FormattedMessage
+ id='admin.service.cmdsTitle'
+ defaultMessage='Enable Slash Commands: '
+ />
+ </label>
+ <div className='col-sm-8'>
+ <label className='radio-inline'>
+ <input
+ type='radio'
+ name='EnableCommands'
+ value='true'
+ ref='EnableCommands'
+ defaultChecked={this.props.config.ServiceSettings.EnableCommands}
+ onChange={this.handleChange}
+ />
+ <FormattedMessage
+ id='admin.service.true'
+ defaultMessage='true'
+ />
+ </label>
+ <label className='radio-inline'>
+ <input
+ type='radio'
+ name='EnableCommands'
+ value='false'
+ defaultChecked={!this.props.config.ServiceSettings.EnableCommands}
+ onChange={this.handleChange}
+ />
+ <FormattedMessage
+ id='admin.service.false'
+ defaultMessage='false'
+ />
+ </label>
+ <p className='help-text'>
+ <FormattedMessage
+ id='admin.service.cmdsDesc'
+ defaultMessage='When true, user created slash commands will be allowed.'
+ />
+ </p>
+ </div>
+ </div>
+
+ <div className='form-group'>
+ <label
+ className='control-label col-sm-4'
+ htmlFor='EnableOnlyAdminIntegrations'
+ >
+ <FormattedMessage
+ id='admin.service.integrationAdmin'
+ defaultMessage='Enable Integrations for Admin Only: '
+ />
+ </label>
+ <div className='col-sm-8'>
+ <label className='radio-inline'>
+ <input
+ type='radio'
+ name='EnableOnlyAdminIntegrations'
+ value='true'
+ ref='EnableOnlyAdminIntegrations'
+ defaultChecked={this.props.config.ServiceSettings.EnableOnlyAdminIntegrations}
+ onChange={this.handleChange}
+ />
+ <FormattedMessage
+ id='admin.service.true'
+ defaultMessage='true'
+ />
+ </label>
+ <label className='radio-inline'>
+ <input
+ type='radio'
+ name='EnableOnlyAdminIntegrations'
+ value='false'
+ defaultChecked={!this.props.config.ServiceSettings.EnableOnlyAdminIntegrations}
+ onChange={this.handleChange}
+ />
+ <FormattedMessage
+ id='admin.service.false'
+ defaultMessage='false'
+ />
+ </label>
+ <p className='help-text'>
+ <FormattedMessage
+ id='admin.service.integrationAdminDesc'
+ defaultMessage='When true, user created integrations can only be created by admins.'
+ />
+ </p>
+ </div>
+ </div>
+
+ <div className='form-group'>
+ <label
+ className='control-label col-sm-4'
htmlFor='EnablePostUsernameOverride'
>
<FormattedMessage
id='admin.service.overrideTitle'
- defaultMessage='Enable Overriding Usernames from Webhooks: '
+ defaultMessage='Enable Overriding Usernames from Webhooks and Slash Commands: '
/>
</label>
<div className='col-sm-8'>
@@ -427,7 +523,7 @@ class ServiceSettings extends React.Component {
<p className='help-text'>
<FormattedMessage
id='admin.service.overrideDescription'
- defaultMessage='When true, webhooks will be allowed to change the username they are posting as. Note, combined with allowing icon overriding, this could open users up to phishing attacks.'
+ defaultMessage='When true, webhooks and slash commands will be allowed to change the username they are posting as. Note, combined with allowing icon overriding, this could open users up to phishing attacks.'
/>
</p>
</div>
@@ -440,7 +536,7 @@ class ServiceSettings extends React.Component {
>
<FormattedMessage
id='admin.service.iconTitle'
- defaultMessage='Enable Overriding Icon from Webhooks: '
+ defaultMessage='Enable Overriding Icon from Webhooks and Slash Commands: '
/>
</label>
<div className='col-sm-8'>
@@ -474,7 +570,7 @@ class ServiceSettings extends React.Component {
<p className='help-text'>
<FormattedMessage
id='admin.service.iconDescription'
- defaultMessage='When true, webhooks will be allowed to change the icon they post with. Note, combined with allowing username overriding, this could open users up to phishing attacks.'
+ defaultMessage='When true, webhooks and slash commands will be allowed to change the icon they post with. Note, combined with allowing username overriding, this could open users up to phishing attacks.'
/>
</p>
</div>
diff --git a/web/react/components/audio_video_preview.jsx b/web/react/components/audio_video_preview.jsx
index 7d00fbdaa..739c8c95e 100644
--- a/web/react/components/audio_video_preview.jsx
+++ b/web/react/components/audio_video_preview.jsx
@@ -75,6 +75,7 @@ export default class AudioVideoPreview extends React.Component {
filename={this.props.filename}
fileUrl={this.props.fileUrl}
fileInfo={this.props.fileInfo}
+ formatMessage={this.props.formatMessage}
/>
);
}
@@ -110,5 +111,6 @@ AudioVideoPreview.propTypes = {
filename: React.PropTypes.string.isRequired,
fileUrl: React.PropTypes.string.isRequired,
fileInfo: React.PropTypes.object.isRequired,
- maxHeight: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.number]).isRequired
+ maxHeight: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.number]).isRequired,
+ formatMessage: React.PropTypes.func.isRequired
};
diff --git a/web/react/components/audit_table.jsx b/web/react/components/audit_table.jsx
index cdca7e8d6..49892ff98 100644
--- a/web/react/components/audit_table.jsx
+++ b/web/react/components/audit_table.jsx
@@ -183,389 +183,388 @@ const holders = defineMessages({
loginFailure: {
id: 'audit_table.loginFailure',
defaultMessage: ' (Login failure)'
- },
- userId: {
- id: 'audit_table.userId',
- defaultMessage: 'User ID'
}
});
class AuditTable extends React.Component {
constructor(props) {
super(props);
-
- this.handleMoreInfo = this.handleMoreInfo.bind(this);
- this.formatAuditInfo = this.formatAuditInfo.bind(this);
- this.handleRevokedSession = this.handleRevokedSession.bind(this);
-
- this.state = {moreInfo: []};
- }
- handleMoreInfo(index) {
- var newMoreInfo = this.state.moreInfo;
- newMoreInfo[index] = true;
- this.setState({moreInfo: newMoreInfo});
}
- handleRevokedSession(sessionId) {
- return this.props.intl.formatMessage(holders.sessionRevoked, {sessionId: sessionId});
- }
- formatAuditInfo(currentAudit) {
- const currentActionURL = currentAudit.action.replace(/\/api\/v[1-9]/, '');
+ render() {
+ var accessList = [];
const {formatMessage} = this.props.intl;
- let currentAuditDesc = '';
-
- if (currentActionURL.indexOf('/channels') === 0) {
- const channelInfo = currentAudit.extra_info.split(' ');
- const channelNameField = channelInfo[0].split('=');
-
- let channelURL = '';
- let channelObj;
- let channelName = '';
- if (channelNameField.indexOf('name') >= 0) {
- channelURL = channelNameField[channelNameField.indexOf('name') + 1];
- channelObj = ChannelStore.getByName(channelURL);
- if (channelObj) {
- channelName = channelObj.display_name;
- } else {
- channelName = channelURL;
- }
- }
+ for (var i = 0; i < this.props.audits.length; i++) {
+ const audit = this.props.audits[i];
+ const auditInfo = formatAuditInfo(audit, formatMessage);
- switch (currentActionURL) {
- case '/channels/create':
- currentAuditDesc = formatMessage(holders.channelCreated, {channelName: channelName});
- break;
- case '/channels/create_direct':
- currentAuditDesc = formatMessage(holders.establishedDM, {username: Utils.getDirectTeammate(channelObj.id).username});
- break;
- case '/channels/update':
- currentAuditDesc = formatMessage(holders.nameUpdated, {channelName: channelName});
- break;
- case '/channels/update_desc': // support the old path
- case '/channels/update_header':
- currentAuditDesc = formatMessage(holders.headerUpdated, {channelName: channelName});
- break;
- default: {
- let userIdField = [];
- let userId = '';
- let username = '';
-
- if (channelInfo[1]) {
- userIdField = channelInfo[1].split('=');
-
- if (userIdField.indexOf('user_id') >= 0) {
- userId = userIdField[userIdField.indexOf('user_id') + 1];
- username = UserStore.getProfile(userId).username;
- }
- }
+ let uContent;
+ if (this.props.showUserId) {
+ uContent = <td>{auditInfo.userId}</td>;
+ }
- if (/\/channels\/[A-Za-z0-9]+\/delete/.test(currentActionURL)) {
- currentAuditDesc = formatMessage(holders.channelDeleted, {url: channelURL});
- } else if (/\/channels\/[A-Za-z0-9]+\/add/.test(currentActionURL)) {
- currentAuditDesc = formatMessage(holders.userAdded, {username: username, channelName: channelName});
- } else if (/\/channels\/[A-Za-z0-9]+\/remove/.test(currentActionURL)) {
- currentAuditDesc = formatMessage(holders.userRemoved, {username: username, channelName: channelName});
- }
+ let iContent;
+ if (this.props.showIp) {
+ iContent = <td>{auditInfo.ip}</td>;
+ }
- break;
+ let sContent;
+ if (this.props.showSession) {
+ sContent = <td>{auditInfo.sessionId}</td>;
}
+
+ let descStyle = {};
+ if (auditInfo.desc.toLowerCase().indexOf('fail') !== -1) {
+ descStyle.color = 'red';
}
- } else if (currentActionURL.indexOf('/oauth') === 0) {
- const oauthInfo = currentAudit.extra_info.split(' ');
- switch (currentActionURL) {
- case '/oauth/register': {
- const clientIdField = oauthInfo[0].split('=');
+ accessList[i] = (
+ <tr key={audit.id}>
+ <td>{auditInfo.timestamp}</td>
+ {uContent}
+ <td style={descStyle}>{auditInfo.desc}</td>
+ {iContent}
+ {sContent}
+ </tr>
+ );
+ }
- if (clientIdField[0] === 'client_id') {
- currentAuditDesc = formatMessage(holders.attemptedRegisterApp, {id: clientIdField[1]});
- }
+ let userIdContent;
+ if (this.props.showUserId) {
+ userIdContent = (
+ <th>
+ <FormattedMessage
+ id='audit_table.userId'
+ defaultMessage='User ID'
+ />
+ </th>
+ );
+ }
- break;
- }
- case '/oauth/allow':
- if (oauthInfo[0] === 'attempt') {
- currentAuditDesc = formatMessage(holders.attemptedAllowOAuthAccess);
- } else if (oauthInfo[0] === 'success') {
- currentAuditDesc = formatMessage(holders.successfullOAuthAccess);
- } else if (oauthInfo[0] === 'fail - redirect_uri did not match registered callback') {
- currentAuditDesc = formatMessage(holders.failedOAuthAccess);
- }
+ let ipContent;
+ if (this.props.showIp) {
+ ipContent = (
+ <th>
+ <FormattedMessage
+ id='audit_table.ip'
+ defaultMessage='IP Address'
+ />
+ </th>
+ );
+ }
- break;
- case '/oauth/access_token':
- if (oauthInfo[0] === 'attempt') {
- currentAuditDesc = formatMessage(holders.attemptedOAuthToken);
- } else if (oauthInfo[0] === 'success') {
- currentAuditDesc = formatMessage(holders.successfullOAuthToken);
- } else {
- const oauthTokenFailure = oauthInfo[0].split('-');
-
- if (oauthTokenFailure[0].trim() === 'fail' && oauthTokenFailure[1]) {
- currentAuditDesc = formatMessage(oauthTokenFailure, {token: oauthTokenFailure[1].trim()});
- }
- }
+ let sessionContent;
+ if (this.props.showSession) {
+ sessionContent = (
+ <th>
+ <FormattedMessage
+ id='audit_table.session'
+ defaultMessage='Session ID'
+ />
+ </th>
+ );
+ }
- break;
- default:
- break;
- }
- } else if (currentActionURL.indexOf('/users') === 0) {
- const userInfo = currentAudit.extra_info.split(' ');
-
- switch (currentActionURL) {
- case '/users/login':
- if (userInfo[0] === 'attempt') {
- currentAuditDesc = formatMessage(holders.attemptedLogin);
- } else if (userInfo[0] === 'success') {
- currentAuditDesc = formatMessage(holders.successfullLogin);
- } else if (userInfo[0]) {
- currentAuditDesc = formatMessage(holders.failedLogin);
- }
+ return (
+ <table className='table'>
+ <thead>
+ <tr>
+ <th>
+ <FormattedMessage
+ id='audit_table.timestamp'
+ defaultMessage='Timestamp'
+ />
+ </th>
+ {userIdContent}
+ <th>
+ <FormattedMessage
+ id='audit_table.action'
+ defaultMessage='Action'
+ />
+ </th>
+ {ipContent}
+ {sessionContent}
+ </tr>
+ </thead>
+ <tbody>
+ {accessList}
+ </tbody>
+ </table>
+ );
+ }
+}
- break;
- case '/users/revoke_session':
- currentAuditDesc = this.handleRevokedSession(userInfo[0].split('=')[1]);
- break;
- case '/users/newimage':
- currentAuditDesc = formatMessage(holders.updatePicture);
- break;
- case '/users/update':
- currentAuditDesc = formatMessage(holders.updateGeneral);
- break;
- case '/users/newpassword':
- if (userInfo[0] === 'attempted') {
- currentAuditDesc = formatMessage(holders.attemptedPassword);
- } else if (userInfo[0] === 'completed') {
- currentAuditDesc = formatMessage(holders.successfullPassword);
- } else if (userInfo[0] === 'failed - tried to update user password who was logged in through oauth') {
- currentAuditDesc = formatMessage(holders.failedPassword);
- }
+AuditTable.propTypes = {
+ intl: intlShape.isRequired,
+ audits: React.PropTypes.array.isRequired,
+ showUserId: React.PropTypes.bool,
+ showIp: React.PropTypes.bool,
+ showSession: React.PropTypes.bool
+};
- break;
- case '/users/update_roles': {
- const userRoles = userInfo[0].split('=')[1];
+export default injectIntl(AuditTable);
- currentAuditDesc = formatMessage(holders.updatedRol);
- if (userRoles.trim()) {
- currentAuditDesc += userRoles;
- } else {
- currentAuditDesc += formatMessage(holders.member);
+export function formatAuditInfo(audit, formatMessage) {
+ const actionURL = audit.action.replace(/\/api\/v[1-9]/, '');
+ let auditDesc = '';
+
+ if (actionURL.indexOf('/channels') === 0) {
+ const channelInfo = audit.extra_info.split(' ');
+ const channelNameField = channelInfo[0].split('=');
+
+ let channelURL = '';
+ let channelObj;
+ let channelName = '';
+ if (channelNameField.indexOf('name') >= 0) {
+ channelURL = channelNameField[channelNameField.indexOf('name') + 1];
+ channelObj = ChannelStore.getByName(channelURL);
+ if (channelObj) {
+ channelName = channelObj.display_name;
+ } else {
+ channelName = channelURL;
+ }
+ }
+
+ switch (actionURL) {
+ case '/channels/create':
+ auditDesc = formatMessage(holders.channelCreated, {channelName: channelName});
+ break;
+ case '/channels/create_direct':
+ auditDesc = formatMessage(holders.establishedDM, {username: Utils.getDirectTeammate(channelObj.id).username});
+ break;
+ case '/channels/update':
+ auditDesc = formatMessage(holders.nameUpdated, {channelName: channelName});
+ break;
+ case '/channels/update_desc': // support the old path
+ case '/channels/update_header':
+ auditDesc = formatMessage(holders.headerUpdated, {channelName: channelName});
+ break;
+ default: {
+ let userIdField = [];
+ let userId = '';
+ let username = '';
+
+ if (channelInfo[1]) {
+ userIdField = channelInfo[1].split('=');
+
+ if (userIdField.indexOf('user_id') >= 0) {
+ userId = userIdField[userIdField.indexOf('user_id') + 1];
+ username = UserStore.getProfile(userId).username;
}
+ }
- break;
+ if (/\/channels\/[A-Za-z0-9]+\/delete/.test(actionURL)) {
+ auditDesc = formatMessage(holders.channelDeleted, {url: channelURL});
+ } else if (/\/channels\/[A-Za-z0-9]+\/add/.test(actionURL)) {
+ auditDesc = formatMessage(holders.userAdded, {username: username, channelName: channelName});
+ } else if (/\/channels\/[A-Za-z0-9]+\/remove/.test(actionURL)) {
+ auditDesc = formatMessage(holders.userRemoved, {username: username, channelName: channelName});
}
- case '/users/update_active': {
- const updateType = userInfo[0].split('=')[0];
- const updateField = userInfo[0].split('=')[1];
-
- /* Either describes account activation/deactivation or a revoked session as part of an account deactivation */
- if (updateType === 'active') {
- if (updateField === 'true') {
- currentAuditDesc = formatMessage(holders.accountActive);
- } else if (updateField === 'false') {
- currentAuditDesc = formatMessage(holders.accountInactive);
- }
- const actingUserInfo = userInfo[1].split('=');
- if (actingUserInfo[0] === 'session_user') {
- const actingUser = UserStore.getProfile(actingUserInfo[1]);
- const currentUser = UserStore.getCurrentUser();
- if (currentUser && actingUser && (Utils.isAdmin(currentUser.roles) || Utils.isSystemAdmin(currentUser.roles))) {
- currentAuditDesc += formatMessage(holders.by, {username: actingUser.username});
- } else if (currentUser && actingUser) {
- currentAuditDesc += formatMessage(holders.byAdmin);
- }
- }
- } else if (updateType === 'session_id') {
- currentAuditDesc = this.handleRevokedSession(updateField);
- }
+ break;
+ }
+ }
+ } else if (actionURL.indexOf('/oauth') === 0) {
+ const oauthInfo = audit.extra_info.split(' ');
+
+ switch (actionURL) {
+ case '/oauth/register': {
+ const clientIdField = oauthInfo[0].split('=');
- break;
+ if (clientIdField[0] === 'client_id') {
+ auditDesc = formatMessage(holders.attemptedRegisterApp, {id: clientIdField[1]});
}
- case '/users/send_password_reset':
- currentAuditDesc = formatMessage(holders.sentEmail, {email: userInfo[0].split('=')[1]});
- break;
- case '/users/reset_password':
- if (userInfo[0] === 'attempt') {
- currentAuditDesc = formatMessage(holders.attemptedReset);
- } else if (userInfo[0] === 'success') {
- currentAuditDesc = formatMessage(holders.successfullReset);
- }
- break;
- case '/users/update_notify':
- currentAuditDesc = formatMessage(holders.updateGlobalNotifications);
- break;
- default:
- break;
+ break;
+ }
+ case '/oauth/allow':
+ if (oauthInfo[0] === 'attempt') {
+ auditDesc = formatMessage(holders.attemptedAllowOAuthAccess);
+ } else if (oauthInfo[0] === 'success') {
+ auditDesc = formatMessage(holders.successfullOAuthAccess);
+ } else if (oauthInfo[0] === 'fail - redirect_uri did not match registered callback') {
+ auditDesc = formatMessage(holders.failedOAuthAccess);
}
- } else if (currentActionURL.indexOf('/hooks') === 0) {
- const webhookInfo = currentAudit.extra_info.split(' ');
-
- switch (currentActionURL) {
- case '/hooks/incoming/create':
- if (webhookInfo[0] === 'attempt') {
- currentAuditDesc = formatMessage(holders.attemptedWebhookCreate);
- } else if (webhookInfo[0] === 'success') {
- currentAuditDesc = formatMessage(holders.succcessfullWebhookCreate);
- } else if (webhookInfo[0] === 'fail - bad channel permissions') {
- currentAuditDesc = formatMessage(holders.failedWebhookCreate);
- }
- break;
- case '/hooks/incoming/delete':
- if (webhookInfo[0] === 'attempt') {
- currentAuditDesc = formatMessage(holders.attemptedWebhookDelete);
- } else if (webhookInfo[0] === 'success') {
- currentAuditDesc = formatMessage(holders.successfullWebhookDelete);
- } else if (webhookInfo[0] === 'fail - inappropriate conditions') {
- currentAuditDesc = formatMessage(holders.failedWebhookDelete);
+ break;
+ case '/oauth/access_token':
+ if (oauthInfo[0] === 'attempt') {
+ auditDesc = formatMessage(holders.attemptedOAuthToken);
+ } else if (oauthInfo[0] === 'success') {
+ auditDesc = formatMessage(holders.successfullOAuthToken);
+ } else {
+ const oauthTokenFailure = oauthInfo[0].split('-');
+
+ if (oauthTokenFailure[0].trim() === 'fail' && oauthTokenFailure[1]) {
+ auditDesc = formatMessage(oauthTokenFailure, {token: oauthTokenFailure[1].trim()});
}
+ }
- break;
- default:
- break;
+ break;
+ default:
+ break;
+ }
+ } else if (actionURL.indexOf('/users') === 0) {
+ const userInfo = audit.extra_info.split(' ');
+
+ switch (actionURL) {
+ case '/users/login':
+ if (userInfo[0] === 'attempt') {
+ auditDesc = formatMessage(holders.attemptedLogin);
+ } else if (userInfo[0] === 'success') {
+ auditDesc = formatMessage(holders.successfullLogin);
+ } else if (userInfo[0]) {
+ auditDesc = formatMessage(holders.failedLogin);
}
- } else {
- switch (currentActionURL) {
- case '/logout':
- currentAuditDesc = formatMessage(holders.logout);
- break;
- case '/verify_email':
- currentAuditDesc = formatMessage(holders.verified);
- break;
- default:
- break;
+
+ break;
+ case '/users/revoke_session':
+ auditDesc = formatMessage(holders.sessionRevoked, {sessionId: userInfo[0].split('=')[1]});
+ break;
+ case '/users/newimage':
+ auditDesc = formatMessage(holders.updatePicture);
+ break;
+ case '/users/update':
+ auditDesc = formatMessage(holders.updateGeneral);
+ break;
+ case '/users/newpassword':
+ if (userInfo[0] === 'attempted') {
+ auditDesc = formatMessage(holders.attemptedPassword);
+ } else if (userInfo[0] === 'completed') {
+ auditDesc = formatMessage(holders.successfullPassword);
+ } else if (userInfo[0] === 'failed - tried to update user password who was logged in through oauth') {
+ auditDesc = formatMessage(holders.failedPassword);
}
- }
- /* If all else fails... */
- if (!currentAuditDesc) {
- /* Currently not called anywhere */
- if (currentAudit.extra_info.indexOf('revoked_all=') >= 0) {
- currentAuditDesc = formatMessage(holders.revokedAll);
+ break;
+ case '/users/update_roles': {
+ const userRoles = userInfo[0].split('=')[1];
+
+ auditDesc = formatMessage(holders.updatedRol);
+ if (userRoles.trim()) {
+ auditDesc += userRoles;
} else {
- let currentActionDesc = '';
- if (currentActionURL && currentActionURL.lastIndexOf('/') !== -1) {
- currentActionDesc = currentActionURL.substring(currentActionURL.lastIndexOf('/') + 1).replace('_', ' ');
- currentActionDesc = Utils.toTitleCase(currentActionDesc);
- }
+ auditDesc += formatMessage(holders.member);
+ }
- let currentExtraInfoDesc = '';
- if (currentAudit.extra_info) {
- currentExtraInfoDesc = currentAudit.extra_info;
+ break;
+ }
+ case '/users/update_active': {
+ const updateType = userInfo[0].split('=')[0];
+ const updateField = userInfo[0].split('=')[1];
+
+ /* Either describes account activation/deactivation or a revoked session as part of an account deactivation */
+ if (updateType === 'active') {
+ if (updateField === 'true') {
+ auditDesc = formatMessage(holders.accountActive);
+ } else if (updateField === 'false') {
+ auditDesc = formatMessage(holders.accountInactive);
+ }
- if (currentExtraInfoDesc.indexOf('=') !== -1) {
- currentExtraInfoDesc = currentExtraInfoDesc.substring(currentExtraInfoDesc.indexOf('=') + 1);
+ const actingUserInfo = userInfo[1].split('=');
+ if (actingUserInfo[0] === 'session_user') {
+ const actingUser = UserStore.getProfile(actingUserInfo[1]);
+ const user = UserStore.getCurrentUser();
+ if (user && actingUser && (Utils.isAdmin(user.roles) || Utils.isSystemAdmin(user.roles))) {
+ auditDesc += formatMessage(holders.by, {username: actingUser.username});
+ } else if (user && actingUser) {
+ auditDesc += formatMessage(holders.byAdmin);
}
}
- currentAuditDesc = currentActionDesc + ' ' + currentExtraInfoDesc;
+ } else if (updateType === 'session_id') {
+ auditDesc = formatMessage(holders.sessionRevoked, {sessionId: updateField});
}
- }
- const currentDate = new Date(currentAudit.create_at);
- let currentAuditInfo = currentDate.toLocaleDateString(global.window.mm_locale, {month: 'short', day: '2-digit', year: 'numeric'}) + ' - ' + currentDate.toLocaleTimeString(global.window.mm_locale, {hour: '2-digit', minute: '2-digit'});
+ break;
+ }
+ case '/users/send_password_reset':
+ auditDesc = formatMessage(holders.sentEmail, {email: userInfo[0].split('=')[1]});
+ break;
+ case '/users/reset_password':
+ if (userInfo[0] === 'attempt') {
+ auditDesc = formatMessage(holders.attemptedReset);
+ } else if (userInfo[0] === 'success') {
+ auditDesc = formatMessage(holders.successfullReset);
+ }
- if (this.props.showUserId) {
- currentAuditInfo += ' | ' + formatMessage(holders.userId) + ': ' + currentAudit.user_id;
+ break;
+ case '/users/update_notify':
+ auditDesc = formatMessage(holders.updateGlobalNotifications);
+ break;
+ default:
+ break;
}
+ } else if (actionURL.indexOf('/hooks') === 0) {
+ const webhookInfo = audit.extra_info.split(' ');
+
+ switch (actionURL) {
+ case '/hooks/incoming/create':
+ if (webhookInfo[0] === 'attempt') {
+ auditDesc = formatMessage(holders.attemptedWebhookCreate);
+ } else if (webhookInfo[0] === 'success') {
+ auditDesc = formatMessage(holders.succcessfullWebhookCreate);
+ } else if (webhookInfo[0] === 'fail - bad channel permissions') {
+ auditDesc = formatMessage(holders.failedWebhookCreate);
+ }
- currentAuditInfo += ' | ' + currentAuditDesc;
+ break;
+ case '/hooks/incoming/delete':
+ if (webhookInfo[0] === 'attempt') {
+ auditDesc = formatMessage(holders.attemptedWebhookDelete);
+ } else if (webhookInfo[0] === 'success') {
+ auditDesc = formatMessage(holders.successfullWebhookDelete);
+ } else if (webhookInfo[0] === 'fail - inappropriate conditions') {
+ auditDesc = formatMessage(holders.failedWebhookDelete);
+ }
- return currentAuditInfo;
+ break;
+ default:
+ break;
+ }
+ } else {
+ switch (actionURL) {
+ case '/logout':
+ auditDesc = formatMessage(holders.logout);
+ break;
+ case '/verify_email':
+ auditDesc = formatMessage(holders.verified);
+ break;
+ default:
+ break;
+ }
}
- render() {
- var accessList = [];
- const {formatMessage} = this.props.intl;
- for (var i = 0; i < this.props.audits.length; i++) {
- const currentAudit = this.props.audits[i];
- const currentAuditInfo = this.formatAuditInfo(currentAudit);
-
- let moreInfo;
- if (!this.props.oneLine) {
- moreInfo = (
- <a
- href='#'
- className='theme'
- onClick={this.handleMoreInfo.bind(this, i)}
- >
- <FormattedMessage
- id='audit_table.moreInfo'
- defaultMessage='More info'
- />
- </a>
- );
+ /* If all else fails... */
+ if (!auditDesc) {
+ /* Currently not called anywhere */
+ if (audit.extra_info.indexOf('revoked_all=') >= 0) {
+ auditDesc = formatMessage(holders.revokedAll);
+ } else {
+ let actionDesc = '';
+ if (actionURL && actionURL.lastIndexOf('/') !== -1) {
+ actionDesc = actionURL.substring(actionURL.lastIndexOf('/') + 1).replace('_', ' ');
+ actionDesc = Utils.toTitleCase(actionDesc);
}
- if (this.state.moreInfo[i]) {
- if (!currentAudit.session_id) {
- currentAudit.session_id = 'N/A';
+ let extraInfoDesc = '';
+ if (audit.extra_info) {
+ extraInfoDesc = audit.extra_info;
- if (currentAudit.action.search('/users/login') >= 0) {
- if (currentAudit.extra_info === 'attempt') {
- currentAudit.session_id += formatMessage(holders.loginAttempt);
- } else {
- currentAudit.session_id += formatMessage(holders.loginFailure);
- }
- }
+ if (extraInfoDesc.indexOf('=') !== -1) {
+ extraInfoDesc = extraInfoDesc.substring(extraInfoDesc.indexOf('=') + 1);
}
-
- moreInfo = (
- <div>
- <div>
- <FormattedMessage
- id='audit_table.ip'
- defaultMessage='IP: {ip}'
- values={{
- ip: currentAudit.ip_address
- }}
- />
- </div>
- <div>
- <FormattedMessage
- id='audit_table.session'
- defaultMessage='Session ID: {id}'
- values={{
- id: currentAudit.session_id
- }}
- />
- </div>
- </div>
- );
}
-
- var divider = null;
- if (i < this.props.audits.length - 1) {
- divider = (<div className='divider-light'></div>);
- }
-
- accessList[i] = (
- <div
- key={'accessHistoryEntryKey' + i}
- className='access-history__table'
- >
- <div className='access__report'>
- <div className='report__time'>{currentAuditInfo}</div>
- <div className='report__info'>
- {moreInfo}
- </div>
- {divider}
- </div>
- </div>
- );
+ auditDesc = actionDesc + ' ' + extraInfoDesc;
}
-
- return <form role='form'>{accessList}</form>;
}
-}
-AuditTable.propTypes = {
- intl: intlShape.isRequired,
- audits: React.PropTypes.array.isRequired,
- oneLine: React.PropTypes.bool,
- showUserId: React.PropTypes.bool
-};
+ const date = new Date(audit.create_at);
+ let auditInfo = {};
+ auditInfo.timestamp = date.toLocaleDateString(global.window.mm_locale, {month: 'short', day: '2-digit', year: 'numeric'}) + ' - ' + date.toLocaleTimeString(global.window.mm_locale, {hour: '2-digit', minute: '2-digit'});
+ auditInfo.userId = audit.user_id;
+ auditInfo.desc = auditDesc;
+ auditInfo.ip = audit.ip_address;
+ auditInfo.sessionId = audit.session_id;
-export default injectIntl(AuditTable);
+ return auditInfo;
+}
diff --git a/web/react/components/center_panel.jsx b/web/react/components/center_panel.jsx
index 443ecefde..7d2be04d6 100644
--- a/web/react/components/center_panel.jsx
+++ b/web/react/components/center_panel.jsx
@@ -15,6 +15,8 @@ import UserStore from '../stores/user_store.jsx';
import * as Utils from '../utils/utils.jsx';
+import {FormattedMessage} from 'mm-intl';
+
import Constants from '../utils/constants.jsx';
const TutorialSteps = Constants.TutorialSteps;
const Preferences = Constants.Preferences;
@@ -69,8 +71,11 @@ export default class CenterPanel extends React.Component {
onClick={handleClick}
>
<a href=''>
- {'Click here to jump to recent messages. '}
- {<i className='fa fa-arrow-down'></i>}
+ <FormattedMessage
+ id='center_panel.recent'
+ defaultMessage='Click here to jump to recent messages. '
+ />
+ <i className='fa fa-arrow-down'></i>
</a>
</div>
);
diff --git a/web/react/components/channel_header.jsx b/web/react/components/channel_header.jsx
index 005a82209..8fc3cd63d 100644
--- a/web/react/components/channel_header.jsx
+++ b/web/react/components/channel_header.jsx
@@ -419,7 +419,7 @@ export default class ChannelHeader extends React.Component {
</ul>
</div>
<OverlayTrigger
- trigger={['hover', 'focus']}
+ trigger={'click'}
placement='bottom'
overlay={popoverContent}
ref='headerOverlay'
diff --git a/web/react/components/channel_loader.jsx b/web/react/components/channel_loader.jsx
index 712d6885f..174c8c4e1 100644
--- a/web/react/components/channel_loader.jsx
+++ b/web/react/components/channel_loader.jsx
@@ -15,7 +15,40 @@ import PreferenceStore from '../stores/preference_store.jsx';
import * as Utils from '../utils/utils.jsx';
import Constants from '../utils/constants.jsx';
-export default class ChannelLoader extends React.Component {
+import {intlShape, injectIntl, defineMessages} from 'mm-intl';
+
+const holders = defineMessages({
+ socketError: {
+ id: 'channel_loader.socketError',
+ defaultMessage: 'Please check connection, Mattermost unreachable. If issue persists, ask administrator to check WebSocket port.'
+ },
+ someone: {
+ id: 'channel_loader.someone',
+ defaultMessage: 'Someone'
+ },
+ posted: {
+ id: 'channel_loader.posted',
+ defaultMessage: 'Posted'
+ },
+ uploadedImage: {
+ id: 'channel_loader.uploadedImage',
+ defaultMessage: ' uploaded an image'
+ },
+ uploadedFile: {
+ id: 'channel_loader.uploadedFile',
+ defaultMessage: ' uploaded a file'
+ },
+ something: {
+ id: 'channel_loader.something',
+ defaultMessage: ' did something new'
+ },
+ wrote: {
+ id: 'channel_loader.wrote',
+ defaultMessage: ' wrote: '
+ }
+});
+
+class ChannelLoader extends React.Component {
constructor(props) {
super(props);
@@ -23,6 +56,17 @@ export default class ChannelLoader extends React.Component {
this.onSocketChange = this.onSocketChange.bind(this);
+ const {formatMessage} = this.props.intl;
+ SocketStore.setTranslations({
+ socketError: formatMessage(holders.socketError),
+ someone: formatMessage(holders.someone),
+ posted: formatMessage(holders.posted),
+ uploadedImage: formatMessage(holders.uploadedImage),
+ uploadedFile: formatMessage(holders.uploadedFile),
+ something: formatMessage(holders.something),
+ wrote: formatMessage(holders.wrote)
+ });
+
this.state = {};
}
componentDidMount() {
@@ -84,6 +128,16 @@ export default class ChannelLoader extends React.Component {
}
});
+ $('body').on('mouseenter mouseleave', '.search-item__container .post', function mouseOver(ev) {
+ if (ev.type === 'mouseenter') {
+ $(this).closest('.search-item__container').find('.date-separator').addClass('hovered--after');
+ $(this).closest('.search-item__container').next('div').find('.date-separator').addClass('hovered--before');
+ } else {
+ $(this).closest('.search-item__container').find('.date-separator').removeClass('hovered--after');
+ $(this).closest('.search-item__container').next('div').find('.date-separator').removeClass('hovered--before');
+ }
+ });
+
$('body').on('mouseenter mouseleave', '.post.post--comment.same--root', function mouseOver(ev) {
if (ev.type === 'mouseenter') {
$(this).parent('div').prev('.date-separator, .new-separator').addClass('hovered--comment');
@@ -126,3 +180,9 @@ export default class ChannelLoader extends React.Component {
return <div/>;
}
}
+
+ChannelLoader.propTypes = {
+ intl: intlShape.isRequired
+};
+
+export default injectIntl(ChannelLoader); \ No newline at end of file
diff --git a/web/react/components/create_comment.jsx b/web/react/components/create_comment.jsx
index 1b552838a..9e7c67515 100644
--- a/web/react/components/create_comment.jsx
+++ b/web/react/components/create_comment.jsx
@@ -51,6 +51,7 @@ class CreateComment extends React.Component {
this.commentMsgKeyPress = this.commentMsgKeyPress.bind(this);
this.handleUserInput = this.handleUserInput.bind(this);
this.handleKeyDown = this.handleKeyDown.bind(this);
+ this.handleUploadClick = this.handleUploadClick.bind(this);
this.handleUploadStart = this.handleUploadStart.bind(this);
this.handleFileUploadComplete = this.handleFileUploadComplete.bind(this);
this.handleUploadError = this.handleUploadError.bind(this);
@@ -74,6 +75,8 @@ class CreateComment extends React.Component {
componentDidMount() {
PreferenceStore.addChangeListener(this.onPreferenceChange);
window.addEventListener('resize', this.handleResize);
+
+ this.refs.textbox.focus();
}
componentWillUnmount() {
PreferenceStore.removeChangeListener(this.onPreferenceChange);
@@ -94,6 +97,10 @@ class CreateComment extends React.Component {
$('.post-right__scroll').perfectScrollbar('update');
}
}
+
+ if (prevProps.rootId !== this.props.rootId) {
+ this.refs.textbox.focus();
+ }
}
handleSubmit(e) {
e.preventDefault();
@@ -202,8 +209,7 @@ class CreateComment extends React.Component {
if (e.keyCode === KeyCodes.UP && this.state.messageText === '') {
e.preventDefault();
- const channelId = ChannelStore.getCurrentId();
- const lastPost = PostStore.getCurrentUsersLatestPost(channelId, this.props.rootId);
+ const lastPost = PostStore.getCurrentUsersLatestPost(this.props.channelId, this.props.rootId);
if (!lastPost) {
return;
}
@@ -219,6 +225,9 @@ class CreateComment extends React.Component {
});
}
}
+ handleUploadClick() {
+ this.refs.textbox.focus();
+ }
handleUploadStart(clientIds) {
let draft = PostStore.getCommentDraft(this.props.rootId);
@@ -226,6 +235,10 @@ class CreateComment extends React.Component {
PostStore.storeCommentDraft(this.props.rootId, draft);
this.setState({uploadsInProgress: draft.uploadsInProgress});
+
+ // this is a bit redundant with the code that sets focus when the file input is clicked,
+ // but this also resets the focus after a drag and drop
+ this.refs.textbox.focus();
}
handleFileUploadComplete(filenames, clientIds) {
let draft = PostStore.getCommentDraft(this.props.rootId);
@@ -366,6 +379,7 @@ class CreateComment extends React.Component {
<FileUpload
ref='fileUpload'
getFileCount={this.getFileCount}
+ onClick={this.handleUploadClick}
onUploadStart={this.handleUploadStart}
onFileUpload={this.handleFileUploadComplete}
onUploadError={this.handleUploadError}
@@ -402,4 +416,4 @@ CreateComment.propTypes = {
rootId: React.PropTypes.string.isRequired
};
-export default injectIntl(CreateComment); \ No newline at end of file
+export default injectIntl(CreateComment);
diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx
index de971c43f..6ea80cd13 100644
--- a/web/react/components/create_post.jsx
+++ b/web/react/components/create_post.jsx
@@ -21,12 +21,29 @@ import SocketStore from '../stores/socket_store.jsx';
import Constants from '../utils/constants.jsx';
+import {intlShape, injectIntl, defineMessages, FormattedHTMLMessage} from 'mm-intl';
+
const Preferences = Constants.Preferences;
const TutorialSteps = Constants.TutorialSteps;
const ActionTypes = Constants.ActionTypes;
const KeyCodes = Constants.KeyCodes;
-export default class CreatePost extends React.Component {
+const holders = defineMessages({
+ comment: {
+ id: 'create_post.comment',
+ defaultMessage: 'Comment'
+ },
+ post: {
+ id: 'create_post.post',
+ defaultMessage: 'Post'
+ },
+ write: {
+ id: 'create_post.write',
+ defaultMessage: 'Write a message...'
+ }
+});
+
+class CreatePost extends React.Component {
constructor(props) {
super(props);
@@ -36,7 +53,7 @@ export default class CreatePost extends React.Component {
this.handleSubmit = this.handleSubmit.bind(this);
this.postMsgKeyPress = this.postMsgKeyPress.bind(this);
this.handleUserInput = this.handleUserInput.bind(this);
- this.resizePostHolder = this.resizePostHolder.bind(this);
+ this.handleUploadClick = this.handleUploadClick.bind(this);
this.handleUploadStart = this.handleUploadStart.bind(this);
this.handleFileUploadComplete = this.handleFileUploadComplete.bind(this);
this.handleUploadError = this.handleUploadError.bind(this);
@@ -45,7 +62,6 @@ export default class CreatePost extends React.Component {
this.onPreferenceChange = this.onPreferenceChange.bind(this);
this.getFileCount = this.getFileCount.bind(this);
this.handleKeyDown = this.handleKeyDown.bind(this);
- this.handleResize = this.handleResize.bind(this);
this.sendMessage = this.sendMessage.bind(this);
PostStore.clearDraftUploads();
@@ -59,34 +75,10 @@ export default class CreatePost extends React.Component {
previews: draft.previews,
submitting: false,
initialText: draft.messageText,
- windowWidth: Utils.windowWidth(),
- windowHeight: Utils.windowHeight(),
ctrlSend: false,
showTutorialTip: false
};
}
- handleResize() {
- this.setState({
- windowWidth: Utils.windowWidth(),
- windowHeight: Utils.windowHeight()
- });
- }
- componentDidUpdate(prevProps, prevState) {
- if (prevState.previews.length !== this.state.previews.length) {
- this.resizePostHolder();
- return;
- }
-
- if (prevState.uploadsInProgress !== this.state.uploadsInProgress) {
- this.resizePostHolder();
- return;
- }
-
- if (prevState.windowWidth !== this.state.windowWidth || prevState.windowHeight !== this.state.windowHeight) {
- this.resizePostHolder();
- return;
- }
- }
getCurrentDraft() {
const draft = PostStore.getCurrentDraft();
const safeDraft = {previews: [], messageText: '', uploadsInProgress: []};
@@ -133,15 +125,10 @@ export default class CreatePost extends React.Component {
post.message,
false,
(data) => {
- if (data.response === 'not implemented') {
- this.sendMessage(post);
- return;
- }
-
PostStore.storeDraft(data.channel_id, null);
this.setState({messageText: '', submitting: false, postError: null, previews: [], serverError: null});
- if (data.goto_location.length > 0) {
+ if (data.goto_location && data.goto_location.length > 0) {
window.location.href = data.goto_location;
}
},
@@ -228,10 +215,8 @@ export default class CreatePost extends React.Component {
draft.message = messageText;
PostStore.storeCurrentDraft(draft);
}
- resizePostHolder() {
- if (this.state.windowWidth > 960) {
- $('#post_textbox').focus();
- }
+ handleUploadClick() {
+ this.refs.textbox.focus();
}
handleUploadStart(clientIds, channelId) {
const draft = PostStore.getDraft(channelId);
@@ -240,6 +225,10 @@ export default class CreatePost extends React.Component {
PostStore.storeDraft(channelId, draft);
this.setState({uploadsInProgress: draft.uploadsInProgress});
+
+ // this is a bit redundant with the code that sets focus when the file input is clicked,
+ // but this also resets the focus after a drag and drop
+ this.refs.textbox.focus();
}
handleFileUploadComplete(filenames, clientIds, channelId) {
const draft = PostStore.getDraft(channelId);
@@ -316,13 +305,16 @@ export default class CreatePost extends React.Component {
componentDidMount() {
ChannelStore.addChangeListener(this.onChange);
PreferenceStore.addChangeListener(this.onPreferenceChange);
- this.resizePostHolder();
- window.addEventListener('resize', this.handleResize);
+ this.refs.textbox.focus();
+ }
+ componentDidUpdate(prevProps, prevState) {
+ if (prevState.channelId !== this.state.channelId) {
+ this.refs.textbox.focus();
+ }
}
componentWillUnmount() {
ChannelStore.removeChangeListener(this.onChange);
PreferenceStore.removeChangeListener(this.onPreferenceChange);
- window.removeEventListener('resize', this.handleResize);
}
onChange() {
const channelId = ChannelStore.getCurrentId();
@@ -361,7 +353,8 @@ export default class CreatePost extends React.Component {
if (!lastPost) {
return;
}
- var type = (lastPost.root_id && lastPost.root_id.length > 0) ? 'Comment' : 'Post';
+ const {formatMessage} = this.props.intl;
+ var type = (lastPost.root_id && lastPost.root_id.length > 0) ? formatMessage(holders.comment) : formatMessage(holders.post);
AppDispatcher.handleViewAction({
type: ActionTypes.RECIEVED_EDIT_POST,
@@ -379,9 +372,10 @@ export default class CreatePost extends React.Component {
screens.push(
<div>
- <h4>{'Sending Messages'}</h4>
- <p>{'Type here to write a message and press '}<strong>{'Enter'}</strong>{' to post it.'}</p>
- <p>{'Click the '}<strong>{'Attachment'}</strong>{' button to upload an image or a file.'}</p>
+ <FormattedHTMLMessage
+ id='create_post.tutorialTip'
+ defaultMessage='<h4>Sending Messages</h4><p>Type here to write a message and press <strong>Enter</strong> to post it.</p><p>Click the <strong>Attachment</strong> button to upload an image or a file.</p>'
+ />
</div>
);
@@ -443,9 +437,8 @@ export default class CreatePost extends React.Component {
onUserInput={this.handleUserInput}
onKeyPress={this.postMsgKeyPress}
onKeyDown={this.handleKeyDown}
- onHeightChange={this.resizePostHolder}
messageText={this.state.messageText}
- createMessage='Write a message...'
+ createMessage={this.props.intl.formatMessage(holders.write)}
channelId={this.state.channelId}
id='post_textbox'
ref='textbox'
@@ -453,6 +446,7 @@ export default class CreatePost extends React.Component {
<FileUpload
ref='fileUpload'
getFileCount={this.getFileCount}
+ onClick={this.handleUploadClick}
onUploadStart={this.handleUploadStart}
onFileUpload={this.handleFileUploadComplete}
onUploadError={this.handleUploadError}
@@ -482,3 +476,9 @@ export default class CreatePost extends React.Component {
);
}
}
+
+CreatePost.propTypes = {
+ intl: intlShape.isRequired
+};
+
+export default injectIntl(CreatePost);
diff --git a/web/react/components/delete_post_modal.jsx b/web/react/components/delete_post_modal.jsx
index 34fd724f5..9d7dcb3e5 100644
--- a/web/react/components/delete_post_modal.jsx
+++ b/web/react/components/delete_post_modal.jsx
@@ -88,7 +88,7 @@ export default class DeletePostModal extends React.Component {
}
}
- PostStore.removePost(this.state.post.id, this.state.post.channel_id);
+ PostStore.deletePost(this.state.post);
AsyncClient.getPosts(this.state.post.channel_id);
},
(err) => {
diff --git a/web/react/components/file_attachment.jsx b/web/react/components/file_attachment.jsx
index eeb218bfe..776394828 100644
--- a/web/react/components/file_attachment.jsx
+++ b/web/react/components/file_attachment.jsx
@@ -5,7 +5,16 @@ import * as utils from '../utils/utils.jsx';
import * as Client from '../utils/client.jsx';
import Constants from '../utils/constants.jsx';
-export default class FileAttachment extends React.Component {
+import {intlShape, injectIntl, defineMessages} from 'mm-intl';
+
+const holders = defineMessages({
+ download: {
+ id: 'file_attachment.download',
+ defaultMessage: 'Download'
+ }
+});
+
+class FileAttachment extends React.Component {
constructor(props) {
super(props);
@@ -266,7 +275,7 @@ export default class FileAttachment extends React.Component {
href={fileUrl}
download={filenameString}
data-toggle='tooltip'
- title={'Download \"' + filenameString + '\"'}
+ title={this.props.intl.formatMessage(holders.download) + ' \"' + filenameString + '\"'}
className='post-image__name'
>
{trimmedFilename}
@@ -291,6 +300,7 @@ export default class FileAttachment extends React.Component {
}
FileAttachment.propTypes = {
+ intl: intlShape.isRequired,
// a list of file pathes displayed by the parent FileAttachmentList
filename: React.PropTypes.string.isRequired,
@@ -301,3 +311,5 @@ FileAttachment.propTypes = {
// handler for when the thumbnail is clicked passed the index above
handleImageClick: React.PropTypes.func
};
+
+export default injectIntl(FileAttachment); \ No newline at end of file
diff --git a/web/react/components/file_info_preview.jsx b/web/react/components/file_info_preview.jsx
index 45d89007f..1dac140c9 100644
--- a/web/react/components/file_info_preview.jsx
+++ b/web/react/components/file_info_preview.jsx
@@ -3,15 +3,28 @@
import * as Utils from '../utils/utils.jsx';
-export default function FileInfoPreview({filename, fileUrl, fileInfo}) {
+import {defineMessages} from 'mm-intl';
+
+const holders = defineMessages({
+ type: {
+ id: 'file_info_preview.type',
+ defaultMessage: 'File type '
+ },
+ size: {
+ id: 'file_info_preview.size',
+ defaultMessage: 'Size '
+ }
+});
+
+export default function FileInfoPreview({filename, fileUrl, fileInfo, formatMessage}) {
// non-image files include a section providing details about the file
const infoParts = [];
if (fileInfo.extension !== '') {
- infoParts.push('File type ' + fileInfo.extension.toUpperCase());
+ infoParts.push(formatMessage(holders.type) + fileInfo.extension.toUpperCase());
}
- infoParts.push('Size ' + Utils.fileSizeToString(fileInfo.size));
+ infoParts.push(formatMessage(holders.size) + Utils.fileSizeToString(fileInfo.size));
const infoString = infoParts.join(', ');
diff --git a/web/react/components/file_upload.jsx b/web/react/components/file_upload.jsx
index 626dbc5b3..f5c32c825 100644
--- a/web/react/components/file_upload.jsx
+++ b/web/react/components/file_upload.jsx
@@ -101,9 +101,9 @@ class FileUpload extends React.Component {
} else if (tooLargeFiles.length > 1) {
var tooLargeFilenames = tooLargeFiles.map((file) => file.name).join(', ');
- this.props.onUploadError(formatMessage(holders.filesAbove, {max: (Constants.MAX_FILE_SIZE / 1000000), files: tooLargeFilenames}));
+ this.props.onUploadError(formatMessage(holders.filesAbove, {max: (Constants.MAX_FILE_SIZE / 1000000), filenames: tooLargeFilenames}));
} else if (tooLargeFiles.length > 0) {
- this.props.onUploadError(formatMessage(holders.fileAbove, {max: (Constants.MAX_FILE_SIZE / 1000000), file: tooLargeFiles[0].name}));
+ this.props.onUploadError(formatMessage(holders.fileAbove, {max: (Constants.MAX_FILE_SIZE / 1000000), filename: tooLargeFiles[0].name}));
}
}
@@ -310,6 +310,7 @@ class FileUpload extends React.Component {
ref='fileInput'
type='file'
onChange={this.handleChange}
+ onClick={this.props.onClick}
multiple={multiple}
accept={accept}
/>
@@ -322,6 +323,7 @@ FileUpload.propTypes = {
intl: intlShape.isRequired,
onUploadError: React.PropTypes.func,
getFileCount: React.PropTypes.func,
+ onClick: React.PropTypes.func,
onFileUpload: React.PropTypes.func,
onUploadStart: React.PropTypes.func,
onTextDrop: React.PropTypes.func,
@@ -329,4 +331,4 @@ FileUpload.propTypes = {
postType: React.PropTypes.string
};
-export default injectIntl(FileUpload); \ No newline at end of file
+export default injectIntl(FileUpload);
diff --git a/web/react/components/login_username.jsx b/web/react/components/login_username.jsx
index f787490fa..4bd9254c6 100644
--- a/web/react/components/login_username.jsx
+++ b/web/react/components/login_username.jsx
@@ -89,9 +89,9 @@ export default class LoginUsername extends React.Component {
}
},
(err) => {
- if (err.message === 'api.user.login.not_verified.app_error') {
+ if (err.id === 'api.user.login.not_verified.app_error') {
state.serverError = formatMessage(holders.verifyEmailError);
- } else if (err.message === 'store.sql_user.get_by_username.app_error') {
+ } else if (err.id === 'store.sql_user.get_by_username.app_error') {
state.serverError = formatMessage(holders.userNotFoundError);
} else {
state.serverError = err.message;
diff --git a/web/react/components/navbar.jsx b/web/react/components/navbar.jsx
index 7326a9ef8..8005678a2 100644
--- a/web/react/components/navbar.jsx
+++ b/web/react/components/navbar.jsx
@@ -24,6 +24,8 @@ import Constants from '../utils/constants.jsx';
const ActionTypes = Constants.ActionTypes;
import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
+import {FormattedMessage} from 'mm-intl';
+
const Popover = ReactBootstrap.Popover;
const OverlayTrigger = ReactBootstrap.OverlayTrigger;
@@ -133,7 +135,10 @@ export default class Navbar extends React.Component {
dialogType={ChannelInfoModal}
dialogProps={{channel}}
>
- {'View Info'}
+ <FormattedMessage
+ id='navbar.viewInfo'
+ defaultMessage='View Info'
+ />
</ToggleModalButton>
</li>
);
@@ -145,7 +150,10 @@ export default class Navbar extends React.Component {
href='#'
onClick={this.showEditChannelHeaderModal}
>
- {'Set Channel Header...'}
+ <FormattedMessage
+ id='navbar.setHeader'
+ defaultMessage='Set Channel Header...'
+ />
</a>
</li>
);
@@ -159,7 +167,10 @@ export default class Navbar extends React.Component {
href='#'
onClick={() => this.setState({showEditChannelPurposeModal: true})}
>
- {'Set Channel Purpose...'}
+ <FormattedMessage
+ id='navbar.setPurpose'
+ defaultMessage='Set Channel Purpose...'
+ />
</a>
</li>
);
@@ -175,7 +186,10 @@ export default class Navbar extends React.Component {
dialogType={ChannelInviteModal}
dialogProps={{channel}}
>
- {'Add Members'}
+ <FormattedMessage
+ id='navbar.addMembers'
+ defaultMessage='Add Members'
+ />
</ToggleModalButton>
</li>
);
@@ -187,7 +201,10 @@ export default class Navbar extends React.Component {
href='#'
onClick={this.handleLeave}
>
- {'Leave Channel'}
+ <FormattedMessage
+ id='navbar.leave'
+ defaultMessage='Leave Channel'
+ />
</a>
</li>
);
@@ -205,7 +222,10 @@ export default class Navbar extends React.Component {
href='#'
onClick={() => this.setState({showMembersModal: true})}
>
- {'Manage Members'}
+ <FormattedMessage
+ id='navbar.manageMembers'
+ defaultMessage='Manage Members'
+ />
</a>
</li>
);
@@ -217,7 +237,10 @@ export default class Navbar extends React.Component {
dialogType={DeleteChannelModal}
dialogProps={{channel}}
>
- {'Delete Channel...'}
+ <FormattedMessage
+ id='navbar.delete'
+ defaultMessage='Delete Channel...'
+ />
</ToggleModalButton>
</li>
);
@@ -234,7 +257,10 @@ export default class Navbar extends React.Component {
data-name={channel.name}
data-channelid={channel.id}
>
- {'Rename Channel...'}
+ <FormattedMessage
+ id='navbar.rename'
+ defaultMessage='Rename Channel...'
+ />
</a>
</li>
);
@@ -249,7 +275,10 @@ export default class Navbar extends React.Component {
dialogType={ChannelNotificationsModal}
dialogProps={{channel}}
>
- {'Notification Preferences'}
+ <FormattedMessage
+ id='navbar.preferences'
+ defaultMessage='Notification Preferences'
+ />
</ToggleModalButton>
</li>
);
@@ -319,7 +348,12 @@ export default class Navbar extends React.Component {
data-toggle='collapse'
data-target='#navbar-collapse-1'
>
- <span className='sr-only'>{'Toggle sidebar'}</span>
+ <span className='sr-only'>
+ <FormattedMessage
+ id='navbar.toggle1'
+ defaultMessage='Toggle sidebar'
+ />
+ </span>
<span className='icon-bar'></span>
<span className='icon-bar'></span>
<span className='icon-bar'></span>
@@ -335,7 +369,12 @@ export default class Navbar extends React.Component {
data-target='#sidebar-nav'
onClick={this.toggleLeftSidebar}
>
- <span className='sr-only'>{'Toggle sidebar'}</span>
+ <span className='sr-only'>
+ <FormattedMessage
+ id='navbar.toggle2'
+ defaultMessage='Toggle sidebar'
+ />
+ </span>
<span className='icon-bar'></span>
<span className='icon-bar'></span>
<span className='icon-bar'></span>
@@ -405,6 +444,17 @@ export default class Navbar extends React.Component {
}
if (channel.header.length === 0) {
+ const link = (
+ <a
+ href='#'
+ onClick={this.showEditChannelHeaderModal}
+ >
+ <FormattedMessage
+ id='navbar.click'
+ defaultMessage='Click here'
+ />
+ </a>
+ );
popoverContent = (
<Popover
bsStyle='info'
@@ -412,15 +462,14 @@ export default class Navbar extends React.Component {
id='header-popover'
>
<div>
- {'No channel header yet.'}
- <br/>
- <a
- href='#'
- onClick={this.showEditChannelHeaderModal}
- >
- {'Click here'}
- </a>
- {' to add one.'}
+ <FormattedMessage
+ id='navbar.noHeader'
+ defaultMessage='No channel header yet.{newline}{link} to add one.'
+ values={{
+ newline: (<br/>),
+ link: (link)
+ }}
+ />
</div>
</Popover>
);
diff --git a/web/react/components/post_attachment.jsx b/web/react/components/post_attachment.jsx
index 676bc91af..2eedfb7c1 100644
--- a/web/react/components/post_attachment.jsx
+++ b/web/react/components/post_attachment.jsx
@@ -3,7 +3,20 @@
import * as TextFormatting from '../utils/text_formatting.jsx';
-export default class PostAttachment extends React.Component {
+import {intlShape, injectIntl, defineMessages} from 'mm-intl';
+
+const holders = defineMessages({
+ collapse: {
+ id: 'post_attachment.collapse',
+ defaultMessage: '▲ collapse text'
+ },
+ more: {
+ id: 'post_attachment.more',
+ defaultMessage: '▼ read more'
+ }
+});
+
+class PostAttachment extends React.Component {
constructor(props) {
super(props);
@@ -28,7 +41,7 @@ export default class PostAttachment extends React.Component {
getInitState() {
const shouldCollapse = this.shouldCollapse();
const text = TextFormatting.formatText(this.props.attachment.text || '');
- const uncollapsedText = text + (shouldCollapse ? '<a class="attachment-link-more" href="#">▲ collapse text</a>' : '');
+ const uncollapsedText = text + (shouldCollapse ? `<a class="attachment-link-more" href="#">${this.props.intl.formatMessage(holders.collapse)}</a>` : '');
const collapsedText = shouldCollapse ? this.getCollapsedText() : text;
return {
@@ -62,7 +75,7 @@ export default class PostAttachment extends React.Component {
text = text.substr(0, 700);
}
- return TextFormatting.formatText(text) + '<a class="attachment-link-more" href="#">▼ read more</a>';
+ return TextFormatting.formatText(text) + `<a class="attachment-link-more" href="#">${this.props.intl.formatMessage(holders.more)}</a>`;
}
getFieldsTable() {
@@ -292,5 +305,8 @@ export default class PostAttachment extends React.Component {
}
PostAttachment.propTypes = {
+ intl: intlShape.isRequired,
attachment: React.PropTypes.object.isRequired
};
+
+export default injectIntl(PostAttachment);
diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx
index b1657f0eb..d71ac6ec7 100644
--- a/web/react/components/post_body.jsx
+++ b/web/react/components/post_body.jsx
@@ -14,7 +14,20 @@ import YoutubeVideo from './youtube_video.jsx';
import providers from './providers.json';
-export default class PostBody extends React.Component {
+import {intlShape, injectIntl, defineMessages, FormattedMessage} from 'mm-intl';
+
+const holders = defineMessages({
+ plusOne: {
+ id: 'post_body.plusOne',
+ defaultMessage: ' plus 1 other file'
+ },
+ plusMore: {
+ id: 'post_body.plusMore',
+ defaultMessage: ' plus {count} other files'
+ }
+});
+
+class PostBody extends React.Component {
constructor(props) {
super(props);
@@ -31,7 +44,6 @@ export default class PostBody extends React.Component {
this.state = {
links: linkData.links,
- message: linkData.text,
post: this.props.post,
hasUserProfiles: profiles && Object.keys(profiles).length > 1
};
@@ -93,7 +105,9 @@ export default class PostBody extends React.Component {
if (this.props.post.filenames.length === 0 && this.state.links && this.state.links.length > 0) {
this.embed = this.createEmbed(linkData.links[0]);
}
- this.setState({links: linkData.links, message: linkData.text});
+ this.setState({
+ links: linkData.links
+ });
}
createEmbed(link) {
@@ -187,6 +201,7 @@ export default class PostBody extends React.Component {
}
render() {
+ const {formatMessage} = this.props.intl;
const post = this.props.post;
const filenames = this.props.post.filenames;
const parentPost = this.props.parentPost;
@@ -208,10 +223,12 @@ export default class PostBody extends React.Component {
username = parentPost.props.override_username;
}
- if (username.slice(-1) === 's') {
- apostrophe = '\'';
- } else {
- apostrophe = '\'s';
+ if (global.window.mm_locale === 'en') {
+ if (username.slice(-1) === 's') {
+ apostrophe = '\'';
+ } else {
+ apostrophe = '\'s';
+ }
}
name = (
<a
@@ -230,16 +247,23 @@ export default class PostBody extends React.Component {
message = parentPost.filenames[0].split('/').pop();
if (parentPost.filenames.length === 2) {
- message += ' plus 1 other file';
+ message += formatMessage(holders.plusOne);
} else if (parentPost.filenames.length > 2) {
- message += ` plus ${parentPost.filenames.length - 1} other files`;
+ message += formatMessage(holders.plusMore, {count: (parentPost.filenames.length - 1)});
}
}
comment = (
<div className='post__link'>
<span>
- {'Commented on '}{name}{apostrophe}{' message: '}
+ <FormattedMessage
+ id='post_body.commentedOn'
+ defaultMessage='Commented on {name}{apostrophe} message: '
+ values={{
+ name: (name),
+ apostrophe: apostrophe
+ }}
+ />
<a
className='theme'
onClick={this.props.handleCommentClick}
@@ -260,7 +284,10 @@ export default class PostBody extends React.Component {
href='#'
onClick={this.props.retryPost}
>
- {'Retry'}
+ <FormattedMessage
+ id='post_body.retry'
+ defaultMessage='Retry'
+ />
</a>
);
} else if (post.state === Constants.POST_LOADING) {
@@ -284,6 +311,23 @@ export default class PostBody extends React.Component {
);
}
+ let message;
+ if (this.props.post.state === Constants.POST_DELETED) {
+ message = (
+ <FormattedMessage
+ id='post_body.deleted'
+ defaultMessage='(message deleted)'
+ />
+ );
+ } else {
+ message = (
+ <span
+ onClick={TextFormatting.handleClick}
+ dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.props.post.message)}}
+ />
+ );
+ }
+
return (
<div>
{comment}
@@ -294,11 +338,7 @@ export default class PostBody extends React.Component {
className={postClass}
>
{loading}
- <span
- ref='message_span'
- onClick={TextFormatting.handleClick}
- dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.state.message)}}
- />
+ {message}
</div>
<PostBodyAdditionalContent
post={this.state.post}
@@ -313,8 +353,11 @@ export default class PostBody extends React.Component {
}
PostBody.propTypes = {
+ intl: intlShape.isRequired,
post: React.PropTypes.object.isRequired,
parentPost: React.PropTypes.object,
retryPost: React.PropTypes.func.isRequired,
handleCommentClick: React.PropTypes.func.isRequired
};
+
+export default injectIntl(PostBody);
diff --git a/web/react/components/post_focus_view.jsx b/web/react/components/post_focus_view.jsx
index adcd78839..b9b6acd5f 100644
--- a/web/react/components/post_focus_view.jsx
+++ b/web/react/components/post_focus_view.jsx
@@ -7,6 +7,8 @@ import PostStore from '../stores/post_store.jsx';
import ChannelStore from '../stores/channel_store.jsx';
import * as EventHelpers from '../dispatcher/event_helpers.jsx';
+import {FormattedMessage} from 'mm-intl';
+
export default class PostFocusView extends React.Component {
constructor(props) {
super(props);
@@ -73,7 +75,12 @@ export default class PostFocusView extends React.Component {
getIntroMessage() {
return (
<div className='channel-intro'>
- <h4 className='channel-intro__title'>{'Beginning of Channel Archives'}</h4>
+ <h4 className='channel-intro__title'>
+ <FormattedMessage
+ id='post_focus_view.beginning'
+ defaultMessage='Beginning of Channel Archives'
+ />
+ </h4>
</div>
);
}
diff --git a/web/react/components/post_info.jsx b/web/react/components/post_info.jsx
index 0fb9d7f4a..b1bc8ca14 100644
--- a/web/react/components/post_info.jsx
+++ b/web/react/components/post_info.jsx
@@ -9,6 +9,8 @@ import * as EventHelpers from '../dispatcher/event_helpers.jsx';
import Constants from '../utils/constants.jsx';
+import {FormattedMessage} from 'mm-intl';
+
const Overlay = ReactBootstrap.Overlay;
const Popover = ReactBootstrap.Popover;
@@ -21,13 +23,14 @@ export default class PostInfo extends React.Component {
};
this.handlePermalinkCopy = this.handlePermalinkCopy.bind(this);
+ this.removePost = this.removePost.bind(this);
}
createDropdown() {
var post = this.props.post;
var isOwner = UserStore.getCurrentId() === post.user_id;
var isAdmin = Utils.isAdmin(UserStore.getCurrentUser().roles);
- if (post.state === Constants.POST_FAILED || post.state === Constants.POST_LOADING || post.state === Constants.POST_DELETED) {
+ if (post.state === Constants.POST_FAILED || post.state === Constants.POST_LOADING || Utils.isPostEphemeral(post)) {
return '';
}
@@ -53,7 +56,10 @@ export default class PostInfo extends React.Component {
href='#'
onClick={this.props.handleCommentClick}
>
- {'Reply'}
+ <FormattedMessage
+ id='post_info.reply'
+ defaultMessage='Reply'
+ />
</a>
</li>
);
@@ -68,7 +74,10 @@ export default class PostInfo extends React.Component {
href='#'
onClick={(e) => this.setState({target: e.target, show: !this.state.show})}
>
- {'Permalink'}
+ <FormattedMessage
+ id='post_info.permalink'
+ defaultMessage='Permalink'
+ />
</a>
</li>
);
@@ -84,7 +93,10 @@ export default class PostInfo extends React.Component {
role='menuitem'
onClick={() => EventHelpers.showDeletePostModal(post, dataComments)}
>
- {'Delete'}
+ <FormattedMessage
+ id='post_info.del'
+ defaultMessage='Delete'
+ />
</a>
</li>
);
@@ -108,7 +120,10 @@ export default class PostInfo extends React.Component {
data-channelid={post.channel_id}
data-comments={dataComments}
>
- {'Edit'}
+ <FormattedMessage
+ id='post_info.edit'
+ defaultMessage='Edit'
+ />
</a>
</li>
);
@@ -152,6 +167,25 @@ export default class PostInfo extends React.Component {
this.setState({copiedLink: false});
}
}
+ removePost() {
+ EventHelpers.emitRemovePost(this.props.post);
+ }
+ createRemovePostButton(post) {
+ if (!Utils.isPostEphemeral(post)) {
+ return null;
+ }
+
+ return (
+ <a
+ href='#'
+ className='post__remove theme'
+ type='button'
+ onClick={this.removePost}
+ >
+ {'×'}
+ </a>
+ );
+ }
render() {
var post = this.props.post;
var comments = '';
@@ -164,7 +198,7 @@ export default class PostInfo extends React.Component {
commentCountText = '';
}
- if (post.state !== Constants.POST_FAILED && post.state !== Constants.POST_LOADING && post.state !== Constants.POST_DELETED) {
+ if (post.state !== Constants.POST_FAILED && post.state !== Constants.POST_LOADING && !Utils.isPostEphemeral(post)) {
comments = (
<a
href='#'
@@ -183,7 +217,15 @@ export default class PostInfo extends React.Component {
var dropdown = this.createDropdown();
const permalink = TeamStore.getCurrentTeamUrl() + '/pl/' + post.id;
- const copyButtonText = this.state.copiedLink ? (<div>{'Copy '}<i className='fa fa-check'/></div>) : 'Copy';
+ const copyButtonText = this.state.copiedLink ? (
+ <div>
+ <FormattedMessage
+ id='post_info.copy'
+ defaultMessage='Copy '
+ />
+ <i className='fa fa-check'/></div>
+ ) : (<FormattedMessage id='post_info.copy' />);
+
const permalinkOverlay = (
<Popover
id='permalink-overlay'
@@ -242,6 +284,7 @@ export default class PostInfo extends React.Component {
>
{permalinkOverlay}
</Overlay>
+ {this.createRemovePostButton(post)}
</li>
</ul>
);
diff --git a/web/react/components/posts_view.jsx b/web/react/components/posts_view.jsx
index 856403af5..f108ace2e 100644
--- a/web/react/components/posts_view.jsx
+++ b/web/react/components/posts_view.jsx
@@ -8,6 +8,9 @@ import * as Utils from '../utils/utils.jsx';
import Post from './post.jsx';
import Constants from '../utils/constants.jsx';
import DelayedAction from '../utils/delayed_action.jsx';
+
+import {FormattedDate, FormattedMessage} from 'mm-intl';
+
const Preferences = Constants.Preferences;
export default class PostsView extends React.Component {
@@ -250,7 +253,15 @@ export default class PostsView extends React.Component {
className='date-separator'
>
<hr className='separator__hr' />
- <div className='separator__text'>{currentPostDay.toDateString()}</div>
+ <div className='separator__text'>
+ <FormattedDate
+ value={currentPostDay}
+ weekday='short'
+ month='short'
+ day='2-digit'
+ year='numeric'
+ />
+ </div>
</div>
);
}
@@ -276,7 +287,12 @@ export default class PostsView extends React.Component {
<hr
className='separator__hr'
/>
- <div className='separator__text'>{'New Messages'}</div>
+ <div className='separator__text'>
+ <FormattedMessage
+ id='posts_view.newMsg'
+ defaultMessage='New Messages'
+ />
+ </div>
</div>
);
}
@@ -420,7 +436,10 @@ export default class PostsView extends React.Component {
href='#'
onClick={this.loadMorePostsTop}
>
- {'Load more messages'}
+ <FormattedMessage
+ id='posts_view.loadMore'
+ defaultMessage='Load more messages'
+ />
</a>
);
} else {
@@ -436,7 +455,7 @@ export default class PostsView extends React.Component {
href='#'
onClick={this.loadMorePostsBottom}
>
- {'Load more messages'}
+ <FormattedMessage id='posts_view.loadMore' />
</a>
);
} else {
diff --git a/web/react/components/search_results_item.jsx b/web/react/components/search_results_item.jsx
index 0ad091d5b..544ba920a 100644
--- a/web/react/components/search_results_item.jsx
+++ b/web/react/components/search_results_item.jsx
@@ -59,64 +59,74 @@ export default class SearchResultsItem extends React.Component {
};
return (
- <div
- className='search-item-container post'
- >
- <div className='search-channel__name'>{channelName}</div>
- <div className='post__content'>
- <div className='post__img'>
- <img
- src={'/api/v1/users/' + this.props.post.user_id + '/image?time=' + timestamp + '&' + utils.getSessionIndex()}
- height='36'
- width='36'
+ <div className='search-item__container'>
+ <div className='date-separator'>
+ <hr className='separator__hr' />
+ <div className='separator__text'>
+ <FormattedDate
+ value={this.props.post.create_at}
+ day='numeric'
+ month='long'
+ year='numeric'
/>
</div>
- <div>
- <ul className='post__header'>
- <li className='col__name'><strong><UserProfile userId={this.props.post.user_id} /></strong></li>
- <li className='col'>
- <time className='search-item-time'>
- <FormattedDate
- value={this.props.post.create_at}
- day='numeric'
- month='long'
- year='numeric'
- hour12={true}
- hour='2-digit'
- minute='2-digit'
- />
- </time>
- </li>
- <li>
- <a
- href='#'
- className='search-item__jump'
- onClick={this.handleClick}
- >
- <FormattedMessage
- id='search_item.jump'
- defaultMessage='Jump'
- />
- </a>
- </li>
- <li>
- <a
- href='#'
- className='comment-icon__container search-item__comment'
- onClick={this.handleFocusRHSClick}
- >
- <span
- className='comment-icon'
- dangerouslySetInnerHTML={{__html: Constants.REPLY_ICON}}
- />
- </a>
- </li>
- </ul>
- <div className='search-item-snippet'>
- <span
- dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.props.post.message, formattingOptions)}}
+ </div>
+ <div
+ className='post'
+ >
+ <div className='search-channel__name'>{channelName}</div>
+ <div className='post__content'>
+ <div className='post__img'>
+ <img
+ src={'/api/v1/users/' + this.props.post.user_id + '/image?time=' + timestamp + '&' + utils.getSessionIndex()}
+ height='36'
+ width='36'
/>
</div>
+ <div>
+ <ul className='post__header'>
+ <li className='col__name'><strong><UserProfile userId={this.props.post.user_id} /></strong></li>
+ <li className='col'>
+ <time className='search-item-time'>
+ <FormattedDate
+ value={this.props.post.create_at}
+ hour12={true}
+ hour='2-digit'
+ minute='2-digit'
+ />
+ </time>
+ </li>
+ <li>
+ <a
+ href='#'
+ className='search-item__jump'
+ onClick={this.handleClick}
+ >
+ <FormattedMessage
+ id='search_item.jump'
+ defaultMessage='Jump'
+ />
+ </a>
+ </li>
+ <li>
+ <a
+ href='#'
+ className='comment-icon__container search-item__comment'
+ onClick={this.handleFocusRHSClick}
+ >
+ <span
+ className='comment-icon'
+ dangerouslySetInnerHTML={{__html: Constants.REPLY_ICON}}
+ />
+ </a>
+ </li>
+ </ul>
+ <div className='search-item-snippet'>
+ <span
+ dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.props.post.message, formattingOptions)}}
+ />
+ </div>
+ </div>
</div>
</div>
</div>
diff --git a/web/react/components/suggestion/command_provider.jsx b/web/react/components/suggestion/command_provider.jsx
index 91d556bb9..09c9b9982 100644
--- a/web/react/components/suggestion/command_provider.jsx
+++ b/web/react/components/suggestion/command_provider.jsx
@@ -2,7 +2,6 @@
// See License.txt for license information.
import * as AsyncClient from '../../utils/async_client.jsx';
-import SuggestionStore from '../../stores/suggestion_store.jsx';
class CommandSuggestion extends React.Component {
render() {
@@ -38,8 +37,6 @@ CommandSuggestion.propTypes = {
export default class CommandProvider {
handlePretextChanged(suggestionId, pretext) {
if (pretext.startsWith('/')) {
- SuggestionStore.setMatchedPretext(suggestionId, pretext);
-
AsyncClient.getSuggestedCommands(pretext, suggestionId, CommandSuggestion);
}
}
diff --git a/web/react/components/textbox.jsx b/web/react/components/textbox.jsx
index 00e5ace98..ec299087d 100644
--- a/web/react/components/textbox.jsx
+++ b/web/react/components/textbox.jsx
@@ -20,6 +20,7 @@ export default class Textbox extends React.Component {
constructor(props) {
super(props);
+ this.focus = this.focus.bind(this);
this.getStateFromStores = this.getStateFromStores.bind(this);
this.onRecievedError = this.onRecievedError.bind(this);
this.handleKeyPress = this.handleKeyPress.bind(this);
@@ -81,6 +82,10 @@ export default class Textbox extends React.Component {
}
}
+ focus() {
+ this.refs.message.getTextbox().focus();
+ }
+
resize() {
const textbox = this.refs.message.getTextbox();
const $textbox = $(textbox);
@@ -90,8 +95,6 @@ export default class Textbox extends React.Component {
const borders = parseInt($textbox.css('border-bottom-width'), 10) + parseInt($textbox.css('border-top-width'), 10);
const maxHeight = parseInt($textbox.css('max-height'), 10) - borders;
- const prevHeight = $textbox.height();
-
// set the height to auto and remove the scrollbar so we can get the actual size of the contents
$textbox.css('height', 'auto').css('overflow-y', 'hidden');
@@ -116,10 +119,6 @@ export default class Textbox extends React.Component {
if (this.state.preview) {
$(ReactDOM.findDOMNode(this.refs.preview)).height(height + borders);
}
-
- if (height !== prevHeight && this.props.onHeightChange) {
- this.props.onHeightChange();
- }
}
showPreview(e) {
@@ -211,7 +210,6 @@ Textbox.propTypes = {
messageText: React.PropTypes.string.isRequired,
onUserInput: React.PropTypes.func.isRequired,
onKeyPress: React.PropTypes.func.isRequired,
- onHeightChange: React.PropTypes.func,
createMessage: React.PropTypes.string.isRequired,
onKeyDown: React.PropTypes.func,
supportsCommands: React.PropTypes.bool.isRequired
diff --git a/web/react/components/time_since.jsx b/web/react/components/time_since.jsx
index 0b549b1e6..1560d2469 100644
--- a/web/react/components/time_since.jsx
+++ b/web/react/components/time_since.jsx
@@ -4,6 +4,8 @@
import Constants from '../utils/constants.jsx';
import * as Utils from '../utils/utils.jsx';
+import {FormattedRelative, FormattedDate} from 'mm-intl';
+
var Tooltip = ReactBootstrap.Tooltip;
var OverlayTrigger = ReactBootstrap.OverlayTrigger;
@@ -20,20 +22,25 @@ export default class TimeSince extends React.Component {
clearInterval(this.intervalId);
}
render() {
- const displayDate = Utils.displayDate(this.props.eventTime);
- const displayTime = Utils.displayTime(this.props.eventTime);
-
if (this.props.sameUser) {
return (
<time className='post__time'>
- {Utils.displayTime(this.props.eventTime)}
+ {Utils.displayTimeFormatted(this.props.eventTime)}
</time>
);
}
const tooltip = (
<Tooltip id={'time-since-tooltip-' + this.props.eventTime}>
- {displayDate + ' at ' + displayTime}
+ <FormattedDate
+ value={this.props.eventTime}
+ month='long'
+ day='numeric'
+ year='numeric'
+ hour12={true}
+ hour='numeric'
+ minute='2-digit'
+ />
</Tooltip>
);
@@ -44,7 +51,7 @@ export default class TimeSince extends React.Component {
overlay={tooltip}
>
<time className='post__time'>
- {Utils.displayDateTime(this.props.eventTime)}
+ <FormattedRelative value={this.props.eventTime} />
</time>
</OverlayTrigger>
);
diff --git a/web/react/components/user_settings/manage_command_hooks.jsx b/web/react/components/user_settings/manage_command_hooks.jsx
new file mode 100644
index 000000000..b2fc0a4e1
--- /dev/null
+++ b/web/react/components/user_settings/manage_command_hooks.jsx
@@ -0,0 +1,673 @@
+// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+import LoadingScreen from '../loading_screen.jsx';
+
+import * as Client from '../../utils/client.jsx';
+
+import {intlShape, injectIntl, defineMessages, FormattedMessage, FormattedHTMLMessage} from 'mm-intl';
+
+const holders = defineMessages({
+ requestTypePost: {
+ id: 'user.settings.cmds.request_type_post',
+ defaultMessage: 'POST'
+ },
+ requestTypeGet: {
+ id: 'user.settings.cmds.request_type_get',
+ defaultMessage: 'GET'
+ },
+ addDisplayNamePlaceholder: {
+ id: 'user.settings.cmds.add_display_name.placeholder',
+ defaultMessage: 'Display Name'
+ },
+ addUsernamePlaceholder: {
+ id: 'user.settings.cmds.add_username.placeholder',
+ defaultMessage: 'Username'
+ },
+ addTriggerPlaceholder: {
+ id: 'user.settings.cmds.add_trigger.placeholder',
+ defaultMessage: 'Command trigger e.g. "hello" not including the slash'
+ },
+ addAutoCompleteDescPlaceholder: {
+ id: 'user.settings.cmds.auto_complete_desc.placeholder',
+ defaultMessage: 'A short description of what this commands does.'
+ },
+ addAutoCompleteHintPlaceholder: {
+ id: 'user.settings.cmds.auto_complete_hint.placeholder',
+ defaultMessage: '[zipcode]'
+ },
+ adUrlPlaceholder: {
+ id: 'user.settings.cmds.url.placeholder',
+ defaultMessage: 'Must start with http:// or https://'
+ },
+ autocompleteYes: {
+ id: 'user.settings.cmds.auto_complete.yes',
+ defaultMessage: 'yes'
+ },
+ autocompleteNo: {
+ id: 'user.settings.cmds.auto_complete.no',
+ defaultMessage: 'no'
+ }
+});
+
+export default class ManageCommandCmds extends React.Component {
+ constructor() {
+ super();
+
+ this.getCmds = this.getCmds.bind(this);
+ this.addNewCmd = this.addNewCmd.bind(this);
+ this.emptyCmd = this.emptyCmd.bind(this);
+ this.updateTrigger = this.updateTrigger.bind(this);
+ this.updateURL = this.updateURL.bind(this);
+ this.updateMethod = this.updateMethod.bind(this);
+ this.updateUsername = this.updateUsername.bind(this);
+ this.updateIconURL = this.updateIconURL.bind(this);
+ this.updateDisplayName = this.updateDisplayName.bind(this);
+ this.updateAutoComplete = this.updateAutoComplete.bind(this);
+ this.updateAutoCompleteDesc = this.updateAutoCompleteDesc.bind(this);
+ this.updateAutoCompleteHint = this.updateAutoCompleteHint.bind(this);
+
+ this.state = {cmds: [], cmd: this.emptyCmd(), getCmdsComplete: false};
+ }
+
+ static propTypes() {
+ return {
+ intl: intlShape.isRequired
+ };
+ }
+
+ emptyCmd() {
+ var cmd = {};
+ cmd.url = '';
+ cmd.trigger = '';
+ cmd.method = 'P';
+ cmd.username = '';
+ cmd.icon_url = '';
+ cmd.auto_complete = false;
+ cmd.auto_complete_desc = '';
+ cmd.auto_complete_hint = '';
+ cmd.display_name = '';
+ return cmd;
+ }
+
+ componentDidMount() {
+ this.getCmds();
+ }
+
+ addNewCmd(e) {
+ e.preventDefault();
+
+ if (this.state.cmd.trigger === '' || this.state.cmd.url === '') {
+ return;
+ }
+
+ var cmd = this.state.cmd;
+ if (cmd.trigger.length !== 0) {
+ cmd.trigger = cmd.trigger.trim();
+ }
+ cmd.url = cmd.url.trim();
+
+ Client.addCommand(
+ cmd,
+ (data) => {
+ let cmds = Object.assign([], this.state.cmds);
+ if (!cmds) {
+ cmds = [];
+ }
+ cmds.push(data);
+ this.setState({cmds, addError: null, cmd: this.emptyCmd()});
+ },
+ (err) => {
+ this.setState({addError: err.message});
+ }
+ );
+ }
+
+ removeCmd(id) {
+ const data = {};
+ data.id = id;
+
+ Client.deleteCommand(
+ data,
+ () => {
+ const cmds = this.state.cmds;
+ let index = -1;
+ for (let i = 0; i < cmds.length; i++) {
+ if (cmds[i].id === id) {
+ index = i;
+ break;
+ }
+ }
+
+ if (index !== -1) {
+ cmds.splice(index, 1);
+ }
+
+ this.setState({cmds});
+ },
+ (err) => {
+ this.setState({editError: err.message});
+ }
+ );
+ }
+
+ regenToken(id) {
+ const regenData = {};
+ regenData.id = id;
+
+ Client.regenCommandToken(
+ regenData,
+ (data) => {
+ const cmds = Object.assign([], this.state.cmds);
+ for (let i = 0; i < cmds.length; i++) {
+ if (cmds[i].id === id) {
+ cmds[i] = data;
+ break;
+ }
+ }
+
+ this.setState({cmds, editError: null});
+ },
+ (err) => {
+ this.setState({editError: err.message});
+ }
+ );
+ }
+
+ getCmds() {
+ Client.listTeamCommands(
+ (data) => {
+ if (data) {
+ this.setState({cmds: data, getCmdsComplete: true, editError: null});
+ }
+ },
+ (err) => {
+ this.setState({editError: err.message});
+ }
+ );
+ }
+
+ updateTrigger(e) {
+ var cmd = this.state.cmd;
+ cmd.trigger = e.target.value;
+ this.setState(cmd);
+ }
+
+ updateURL(e) {
+ var cmd = this.state.cmd;
+ cmd.url = e.target.value;
+ this.setState(cmd);
+ }
+
+ updateMethod(e) {
+ var cmd = this.state.cmd;
+ cmd.method = e.target.value;
+ this.setState(cmd);
+ }
+
+ updateUsername(e) {
+ var cmd = this.state.cmd;
+ cmd.username = e.target.value;
+ this.setState(cmd);
+ }
+
+ updateIconURL(e) {
+ var cmd = this.state.cmd;
+ cmd.icon_url = e.target.value;
+ this.setState(cmd);
+ }
+
+ updateDisplayName(e) {
+ var cmd = this.state.cmd;
+ cmd.display_name = e.target.value;
+ this.setState(cmd);
+ }
+
+ updateAutoComplete(e) {
+ var cmd = this.state.cmd;
+ cmd.auto_complete = e.target.checked;
+ this.setState(cmd);
+ }
+
+ updateAutoCompleteDesc(e) {
+ var cmd = this.state.cmd;
+ cmd.auto_complete_desc = e.target.value;
+ this.setState(cmd);
+ }
+
+ updateAutoCompleteHint(e) {
+ var cmd = this.state.cmd;
+ cmd.auto_complete_hint = e.target.value;
+ this.setState(cmd);
+ }
+
+ render() {
+ let addError;
+ if (this.state.addError) {
+ addError = <label className='has-error'>{this.state.addError}</label>;
+ }
+
+ let editError;
+ if (this.state.editError) {
+ addError = <label className='has-error'>{this.state.editError}</label>;
+ }
+
+ const cmds = [];
+ this.state.cmds.forEach((cmd) => {
+ let triggerDiv;
+ if (cmd.trigger && cmd.trigger.length !== 0) {
+ triggerDiv = (
+ <div className='padding-top'>
+ <strong>
+ <FormattedMessage
+ id='user.settings.cmds.trigger'
+ defaultMessage='Trigger: '
+ />
+ </strong>{cmd.trigger}
+ </div>
+ );
+ }
+
+ cmds.push(
+ <div
+ key={cmd.id}
+ className='webcmd__item'
+ >
+ <div className='padding-top x2'>
+ <strong>
+ <FormattedMessage
+ id='user.settings.cmds.display_name'
+ defaultMessage='Display Name: '
+ />
+ </strong><span className='word-break--all'>{cmd.display_name}</span>
+ </div>
+ <div className='padding-top x2'>
+ <strong>
+ <FormattedMessage
+ id='user.settings.cmds.username'
+ defaultMessage='Username: '
+ />
+ </strong><span className='word-break--all'>{cmd.username}</span>
+ </div>
+ <div className='padding-top x2'>
+ <strong>
+ <FormattedMessage
+ id='user.settings.cmds.icon_url'
+ defaultMessage='Icon URL: '
+ />
+ </strong><span className='word-break--all'>{cmd.icon_url}</span>
+ </div>
+ <div className='padding-top x2'>
+ <strong>
+ <FormattedMessage
+ id='user.settings.cmds.auto_complete'
+ defaultMessage='Auto Complete: '
+ />
+ </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: '
+ />
+ </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: '
+ />
+ </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 webcmd__url'>
+ <strong>
+ <FormattedMessage
+ id='user.settings.cmds.url'
+ defaultMessage='URL: '
+ />
+ </strong><span className='word-break--all'>{cmd.url}</span>
+ </div>
+ {triggerDiv}
+ <div className='padding-top'>
+ <strong>
+ <FormattedMessage
+ id='user.settings.cmds.token'
+ defaultMessage='Token: '
+ />
+ </strong>{cmd.token}
+ </div>
+ <div className='padding-top'>
+ <a
+ className='text-danger'
+ href='#'
+ onClick={this.regenToken.bind(this, cmd.id)}
+ >
+ <FormattedMessage
+ id='user.settings.cmds.regen'
+ defaultMessage='Regen Token'
+ />
+ </a>
+ <a
+ className='webcmd__remove'
+ href='#'
+ onClick={this.removeCmd.bind(this, cmd.id)}
+ >
+ <span aria-hidden='true'>{'×'}</span>
+ </a>
+ </div>
+ <div className='padding-top x2 divider-light'></div>
+ </div>
+ );
+ });
+
+ let displayCmds;
+ if (!this.state.getCmdsComplete) {
+ displayCmds = <LoadingScreen/>;
+ } else if (cmds.length > 0) {
+ displayCmds = cmds;
+ } else {
+ displayCmds = (
+ <div className='padding-top x2'>
+ <FormattedMessage
+ id='user.settings.cmds.none'
+ defaultMessage='None'
+ />
+ </div>
+ );
+ }
+
+ const existingCmds = (
+ <div className='webcmds__container'>
+ <label className='control-label padding-top x2'>
+ <FormattedMessage
+ id='user.settings.cmds.existing'
+ defaultMessage='Existing commands'
+ />
+ </label>
+ <div className='padding-top divider-light'></div>
+ <div className='webcmds__list'>
+ {displayCmds}
+ </div>
+ </div>
+ );
+
+ const disableButton = this.state.cmd.trigger === '' || this.state.cmd.url === '';
+
+ return (
+ <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.'
+ />
+ <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='Display Name: '
+ />
+ </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='Command display name.'
+ />
+ </div>
+ </div>
+ <div className='padding-top x2'>
+ <label className='control-label'>
+ <FormattedMessage
+ id='user.settings.cmds.username'
+ defaultMessage='Username: '
+ />
+ </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)}
+ />
+ </div>
+ <div className='padding-top'>
+ <FormattedMessage
+ id='user.settings.cmds.username_desc'
+ defaultMessage='The username to use when overriding the post.'
+ />
+ </div>
+ </div>
+ <div className='padding-top x2'>
+ <label className='control-label'>
+ <FormattedMessage
+ id='user.settings.cmds.icon_url'
+ defaultMessage='Icon URL: '
+ />
+ </label>
+ <div className='padding-top'>
+ <input
+ ref='iconURL'
+ className='form-control'
+ 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.icon_url_desc'
+ defaultMessage='URL to an icon'
+ />
+ </div>
+ </div>
+ <div className='padding-top x2'>
+ <label className='control-label'>
+ <FormattedMessage
+ id='user.settings.cmds.trigger'
+ defaultMessage='Trigger: '
+ />
+ </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='Word to trigger on'
+ />
+ {''}</div>
+ </div>
+ <div className='padding-top x2'>
+ <label className='control-label'>
+ <FormattedMessage
+ id='user.settings.cmds.auto_complete'
+ defaultMessage='Auto Complete: '
+ />
+ </label>
+ <div className='padding-top'>
+ <label>
+ <input
+ type='checkbox'
+ checked={this.state.cmd.auto_complete}
+ onChange={this.updateAutoComplete}
+ />
+ <FormattedMessage
+ id='user.settings.cmds.auto_complete_desc_desc'
+ defaultMessage='A short description of what this commands does'
+ />
+ </label>
+ </div>
+ <div className='padding-top'>
+ <FormattedMessage
+ id='user.settings.cmds.auto_complete_help'
+ defaultMessage='Show this command in autocomplete list.'
+ />
+ </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 className='padding-top'>
+ <FormattedMessage
+ id='user.settings.cmds.auto_complete_desc_desc'
+ defaultMessage='A short description of what this commands does'
+ />
+ </div>
+ </div>
+ <div className='padding-top x2'>
+ <label className='control-label'>
+ <FormattedMessage
+ id='user.settings.cmds.auto_complete_hint'
+ defaultMessage='Auto Complete 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='List parameters to be passed to the command.'
+ />
+ </div>
+ </div>
+ <div className='padding-top x2'>
+ <label className='control-label'>
+ <FormattedMessage
+ id='user.settings.cmds.request_type'
+ defaultMessage='Request Type: '
+ />
+ </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.request_type_desc'
+ defaultMessage='Command request type issued to the callback URL.'
+ />
+ </div>
+ </div>
+ <div className='padding-top x2'>
+ <label className='control-label'>
+ <FormattedMessage
+ id='user.settings.cmds.url'
+ defaultMessage='URL: '
+ />
+ </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)}
+ />
+ </div>
+ <div className='padding-top'>
+ <FormattedMessage
+ id='user.settings.cmds.url_desc'
+ defaultMessage='URL that will receive the HTTP POST or GET event'
+ />
+ </div>
+ {addError}
+ </div>
+ <div className='padding-top padding-bottom'>
+ <a
+ className={'btn btn-sm btn-primary'}
+ href='#'
+ disabled={disableButton}
+ onClick={this.addNewCmd}
+ >
+ <FormattedMessage
+ id='user.settings.cmds.add'
+ defaultMessage='Add'
+ />
+ </a>
+ </div>
+ </div>
+ {existingCmds}
+ {editError}
+ </div>
+ );
+ }
+}
+
+export default injectIntl(ManageCommandCmds);
diff --git a/web/react/components/user_settings/user_settings_display.jsx b/web/react/components/user_settings/user_settings_display.jsx
index 3b2a2065b..776bde442 100644
--- a/web/react/components/user_settings/user_settings_display.jsx
+++ b/web/react/components/user_settings/user_settings_display.jsx
@@ -297,7 +297,7 @@ class UserSettingsDisplay extends React.Component {
if (this.state.nameFormat === 'username') {
describe = formatMessage(holders.showUsername);
} else if (this.state.nameFormat === 'full_name') {
- describe = formatMessage(holders.showFullName);
+ describe = formatMessage(holders.showFullname);
} else {
describe = formatMessage(holders.showNickname);
}
diff --git a/web/react/components/user_settings/user_settings_integrations.jsx b/web/react/components/user_settings/user_settings_integrations.jsx
index abd04a301..1a9edab03 100644
--- a/web/react/components/user_settings/user_settings_integrations.jsx
+++ b/web/react/components/user_settings/user_settings_integrations.jsx
@@ -5,6 +5,7 @@ import SettingItemMin from '../setting_item_min.jsx';
import SettingItemMax from '../setting_item_max.jsx';
import ManageIncomingHooks from './manage_incoming_hooks.jsx';
import ManageOutgoingHooks from './manage_outgoing_hooks.jsx';
+import ManageCommandHooks from './manage_command_hooks.jsx';
import {intlShape, injectIntl, defineMessages, FormattedMessage} from 'mm-intl';
@@ -24,6 +25,14 @@ const holders = defineMessages({
outDesc: {
id: 'user.settings.integrations.outWebhooksDescription',
defaultMessage: 'Manage your outgoing webhooks'
+ },
+ cmdName: {
+ id: 'user.settings.integrations.commands',
+ defaultMessage: 'Commands'
+ },
+ cmdDesc: {
+ id: 'user.settings.integrations.commandsDescription',
+ defaultMessage: 'Manage your commands'
}
});
@@ -41,6 +50,7 @@ class UserSettingsIntegrationsTab extends React.Component {
render() {
let incomingHooksSection;
let outgoingHooksSection;
+ let commandHooksSection;
var inputs = [];
const {formatMessage} = this.props.intl;
@@ -106,6 +116,37 @@ class UserSettingsIntegrationsTab extends React.Component {
}
}
+ if (global.window.mm_config.EnableCommands === 'true') {
+ if (this.props.activeSection === 'command-hooks') {
+ inputs.push(
+ <ManageCommandHooks key='command-hook-ui' />
+ );
+
+ commandHooksSection = (
+ <SettingItemMax
+ title={formatMessage(holders.cmdName)}
+ width='medium'
+ inputs={inputs}
+ updateSection={(e) => {
+ this.updateSection('');
+ e.preventDefault();
+ }}
+ />
+ );
+ } else {
+ commandHooksSection = (
+ <SettingItemMin
+ title={formatMessage(holders.cmdName)}
+ width='medium'
+ describe={formatMessage(holders.cmdDesc)}
+ updateSection={() => {
+ this.updateSection('command-hooks');
+ }}
+ />
+ );
+ }
+ }
+
return (
<div>
<div className='modal-header'>
@@ -144,6 +185,8 @@ class UserSettingsIntegrationsTab extends React.Component {
<div className='divider-light'/>
{outgoingHooksSection}
<div className='divider-dark'/>
+ {commandHooksSection}
+ <div className='divider-dark'/>
</div>
</div>
);
diff --git a/web/react/components/user_settings/user_settings_notifications.jsx b/web/react/components/user_settings/user_settings_notifications.jsx
index 91a03eb70..786e53f10 100644
--- a/web/react/components/user_settings/user_settings_notifications.jsx
+++ b/web/react/components/user_settings/user_settings_notifications.jsx
@@ -294,7 +294,7 @@ class NotificationsTab extends React.Component {
<span>
<FormattedMessage
id='user.settings.notifications.info'
- defaultMessage='Desktop notification sounds are available on Firefox, Safari, Chrome, Internet Explorer, and Edge.'
+ defaultMessage='Desktop notifications are available on Firefox, Safari, Chrome, Internet Explorer, and Edge.'
/>
</span>
);
@@ -395,8 +395,8 @@ class NotificationsTab extends React.Component {
const extraInfo = (
<span>
<FormattedMessage
- id='user.settings.notifications.info'
- defaultMessage='Desktop notification sounds are available on Firefox, Safari, Chrome, Internet Explorer, and Edge.'
+ id='user.settings.notifications.sounds_info'
+ defaultMessage='Desktop notifications sounds are available on Firefox, Safari, Chrome, Internet Explorer, and Edge.'
/>
</span>
);
diff --git a/web/react/components/view_image.jsx b/web/react/components/view_image.jsx
index d11f8a21c..90885e495 100644
--- a/web/react/components/view_image.jsx
+++ b/web/react/components/view_image.jsx
@@ -9,10 +9,20 @@ import Constants from '../utils/constants.jsx';
import FileInfoPreview from './file_info_preview.jsx';
import FileStore from '../stores/file_store.jsx';
import ViewImagePopoverBar from './view_image_popover_bar.jsx';
+
+import {intlShape, injectIntl, defineMessages} from 'mm-intl';
+
const Modal = ReactBootstrap.Modal;
const KeyCodes = Constants.KeyCodes;
-export default class ViewImageModal extends React.Component {
+const holders = defineMessages({
+ loading: {
+ id: 'view_image.loading',
+ defaultMessage: 'Loading '
+ }
+});
+
+class ViewImageModal extends React.Component {
constructor(props) {
super(props);
@@ -235,6 +245,7 @@ export default class ViewImageModal extends React.Component {
fileUrl={fileUrl}
fileInfo={this.state.fileInfo}
maxHeight={this.state.imgHeight}
+ formatMessage={this.props.intl.formatMessage}
/>
);
} else {
@@ -243,6 +254,7 @@ export default class ViewImageModal extends React.Component {
filename={filename}
fileUrl={fileUrl}
fileInfo={fileInfo}
+ formatMessage={this.props.intl.formatMessage}
/>
);
}
@@ -250,7 +262,12 @@ export default class ViewImageModal extends React.Component {
// display a progress indicator when the preview for an image is still loading
const progress = Math.floor(this.state.progress[this.state.imgId]);
- content = <LoadingImagePreview progress={progress} />;
+ content = (
+ <LoadingImagePreview
+ progress={progress}
+ loading={this.props.intl.formatMessage(holders.loading)}
+ />
+ );
}
let leftArrow = null;
@@ -335,6 +352,7 @@ ViewImageModal.defaultProps = {
startId: 0
};
ViewImageModal.propTypes = {
+ intl: intlShape.isRequired,
show: React.PropTypes.bool.isRequired,
onModalDismissed: React.PropTypes.func.isRequired,
filenames: React.PropTypes.array,
@@ -344,12 +362,12 @@ ViewImageModal.propTypes = {
startId: React.PropTypes.number
};
-function LoadingImagePreview({progress}) {
+function LoadingImagePreview({progress, loading}) {
let progressView = null;
if (progress) {
progressView = (
<span className='loader-percent'>
- {'Loading ' + progress + '%'}
+ {loading + progress + '%'}
</span>
);
}
@@ -386,3 +404,5 @@ function ImagePreview({filename, fileUrl, fileInfo, maxHeight}) {
</a>
);
}
+
+export default injectIntl(ViewImageModal); \ No newline at end of file
diff --git a/web/react/components/view_image_popover_bar.jsx b/web/react/components/view_image_popover_bar.jsx
index 1287f4fba..97671b845 100644
--- a/web/react/components/view_image_popover_bar.jsx
+++ b/web/react/components/view_image_popover_bar.jsx
@@ -1,6 +1,8 @@
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
+import {FormattedMessage} from 'mm-intl';
+
export default class ViewImagePopoverBar extends React.Component {
constructor(props) {
super(props);
@@ -16,7 +18,10 @@ export default class ViewImagePopoverBar extends React.Component {
data-title='Public Image'
onClick={this.props.getPublicLink}
>
- {'Get Public Link'}
+ <FormattedMessage
+ id='view_image_popover.publicLink'
+ defaultMessage='Get Public Link'
+ />
</a>
<span className='text'>{' | '}</span>
</div>
@@ -33,7 +38,16 @@ export default class ViewImagePopoverBar extends React.Component {
ref='imageFooter'
className={footerClass}
>
- <span className='pull-left text'>{'File ' + (this.props.fileId + 1) + ' of ' + this.props.totalFiles}</span>
+ <span className='pull-left text'>
+ <FormattedMessage
+ id='view_image_popover.file'
+ defaultMessage='File {count} of {total}'
+ values={{
+ count: (this.props.fileId + 1),
+ total: this.props.totalFiles
+ }}
+ />
+ </span>
<div className='image-links'>
{publicLink}
<a
@@ -41,7 +55,10 @@ export default class ViewImagePopoverBar extends React.Component {
download={this.props.filename}
className='text'
>
- {'Download'}
+ <FormattedMessage
+ id='view_image_popover.download'
+ defaultMessage='Download'
+ />
</a>
</div>
</div>
diff --git a/web/react/dispatcher/event_helpers.jsx b/web/react/dispatcher/event_helpers.jsx
index 5eb319320..c1041e438 100644
--- a/web/react/dispatcher/event_helpers.jsx
+++ b/web/react/dispatcher/event_helpers.jsx
@@ -9,6 +9,7 @@ import Constants from '../utils/constants.jsx';
const ActionTypes = Constants.ActionTypes;
import * as AsyncClient from '../utils/async_client.jsx';
import * as Client from '../utils/client.jsx';
+import * as Utils from '../utils/utils.jsx';
export function emitChannelClickEvent(channel) {
AsyncClient.getChannels(true);
@@ -180,3 +181,27 @@ export function emitPreferenceChangedEvent(preference) {
preference
});
}
+
+export function emitRemovePost(post) {
+ AppDispatcher.handleViewAction({
+ type: Constants.ActionTypes.REMOVE_POST,
+ post
+ });
+}
+
+export function sendEphemeralPost(message, channelId) {
+ const timestamp = Utils.getTimestamp();
+ const post = {
+ id: Utils.generateId(),
+ user_id: '0',
+ channel_id: channelId || ChannelStore.getCurrentId(),
+ message,
+ type: Constants.POST_TYPE_EPHEMERAL,
+ create_at: timestamp,
+ update_at: timestamp,
+ filenames: [],
+ props: {}
+ };
+
+ emitPostRecievedEvent(post);
+}
diff --git a/web/react/stores/post_store.jsx b/web/react/stores/post_store.jsx
index 7abadf2b1..8ff58f685 100644
--- a/web/react/stores/post_store.jsx
+++ b/web/react/stores/post_store.jsx
@@ -57,6 +57,7 @@ class PostStoreClass extends EventEmitter {
this.clearFocusedPost = this.clearFocusedPost.bind(this);
this.clearChannelVisibility = this.clearChannelVisibility.bind(this);
+ this.deletePost = this.deletePost.bind(this);
this.removePost = this.removePost.bind(this);
this.getPendingPosts = this.getPendingPosts.bind(this);
@@ -65,10 +66,6 @@ class PostStoreClass extends EventEmitter {
this.clearPendingPosts = this.clearPendingPosts.bind(this);
this.updatePendingPost = this.updatePendingPost.bind(this);
- this.storeUnseenDeletedPost = this.storeUnseenDeletedPost.bind(this);
- this.getUnseenDeletedPosts = this.getUnseenDeletedPosts.bind(this);
- this.clearUnseenDeletedPosts = this.clearUnseenDeletedPosts.bind(this);
-
// These functions are bad and work should be done to remove this system when the RHS dies
this.storeSelectedPost = this.storeSelectedPost.bind(this);
this.getSelectedPost = this.getSelectedPost.bind(this);
@@ -211,28 +208,6 @@ class PostStoreClass extends EventEmitter {
postList.order = this.postsInfo[id].pendingPosts.order.concat(postList.order);
}
- // Add deleted posts
- if (this.postsInfo[id].hasOwnProperty('deletedPosts')) {
- Object.assign(postList.posts, this.postsInfo[id].deletedPosts);
-
- for (const postID in this.postsInfo[id].deletedPosts) {
- if (this.postsInfo[id].deletedPosts.hasOwnProperty(postID)) {
- postList.order.push(postID);
- }
- }
-
- // Merge would be faster
- postList.order.sort((a, b) => {
- if (postList.posts[a].create_at > postList.posts[b].create_at) {
- return -1;
- }
- if (postList.posts[a].create_at < postList.posts[b].create_at) {
- return 1;
- }
- return 0;
- });
- }
-
return postList;
}
@@ -286,15 +261,6 @@ class PostStoreClass extends EventEmitter {
if (combinedPosts.order.indexOf(pid) === -1) {
combinedPosts.order.push(pid);
}
- } else {
- if (pid in combinedPosts.posts) {
- Reflect.deleteProperty(combinedPosts.posts, pid);
- }
-
- const index = combinedPosts.order.indexOf(pid);
- if (index !== -1) {
- combinedPosts.order.splice(index, 1);
- }
}
}
}
@@ -365,6 +331,22 @@ class PostStoreClass extends EventEmitter {
this.postsInfo[id].atBottom = atBottom;
}
+ deletePost(post) {
+ const postList = this.postsInfo[post.channel_id].postList;
+
+ if (isPostListNull(postList)) {
+ return;
+ }
+
+ if (post.id in postList.posts) {
+ // make sure to copy the post so that component state changes work properly
+ postList.posts[post.id] = Object.assign({}, post, {
+ state: Constants.POST_DELETED,
+ filenames: []
+ });
+ }
+ }
+
removePost(post) {
const channelId = post.channel_id;
this.makePostsInfo(channelId);
@@ -439,37 +421,6 @@ class PostStoreClass extends EventEmitter {
this.emitChange();
}
- storeUnseenDeletedPost(post) {
- let posts = this.getUnseenDeletedPosts(post.channel_id);
-
- if (!posts) {
- posts = {};
- }
-
- post.message = '(message deleted)';
- post.state = Constants.POST_DELETED;
- post.filenames = [];
-
- posts[post.id] = post;
-
- this.makePostsInfo(post.channel_id);
- this.postsInfo[post.channel_id].deletedPosts = posts;
- }
-
- getUnseenDeletedPosts(channelId) {
- if (this.postsInfo.hasOwnProperty(channelId)) {
- return this.postsInfo[channelId].deletedPosts;
- }
-
- return null;
- }
-
- clearUnseenDeletedPosts(channelId) {
- if (this.postsInfo.hasOwnProperty(channelId)) {
- Reflect.deleteProperty(this.postsInfo[channelId], 'deletedPosts');
- }
- }
-
storeSelectedPost(postList) {
this.selectedPost = postList;
}
@@ -612,7 +563,6 @@ PostStore.dispatchToken = AppDispatcher.register((payload) => {
case ActionTypes.CLICK_CHANNEL:
PostStore.clearFocusedPost();
PostStore.clearChannelVisibility(action.id, true);
- PostStore.clearUnseenDeletedPosts(action.prev);
break;
case ActionTypes.CREATE_POST:
PostStore.storePendingPost(action.post);
@@ -620,7 +570,10 @@ PostStore.dispatchToken = AppDispatcher.register((payload) => {
PostStore.jumpPostsViewToBottom();
break;
case ActionTypes.POST_DELETED:
- PostStore.storeUnseenDeletedPost(action.post);
+ PostStore.deletePost(action.post);
+ PostStore.emitChange();
+ break;
+ case ActionTypes.REMOVE_POST:
PostStore.removePost(action.post);
PostStore.emitChange();
break;
diff --git a/web/react/stores/socket_store.jsx b/web/react/stores/socket_store.jsx
index 736b0ca27..9c3270f68 100644
--- a/web/react/stores/socket_store.jsx
+++ b/web/react/stores/socket_store.jsx
@@ -64,6 +64,9 @@ class SocketStoreClass extends EventEmitter {
ErrorStore.storeLastError(null);
ErrorStore.emitChange();
}
+
+ AsyncClient.getChannels();
+ AsyncClient.getPosts(ChannelStore.getCurrentId());
}
this.failCount = 0;
@@ -71,6 +74,16 @@ class SocketStoreClass extends EventEmitter {
conn.onclose = () => {
conn = null;
+
+ if (this.failCount === 0) {
+ console.log('websocket closed'); //eslint-disable-line no-console
+ }
+
+ this.failCount = this.failCount + 1;
+
+ ErrorStore.storeLastError({connErrorCount: this.failCount, message: this.translations.socketError});
+ ErrorStore.emitChange();
+
setTimeout(
() => {
this.initialize();
@@ -80,14 +93,10 @@ class SocketStoreClass extends EventEmitter {
};
conn.onerror = (evt) => {
- if (this.failCount === 0) {
- console.log('websocket error ' + evt); //eslint-disable-line no-console
+ if (this.failCount <= 1) {
+ console.log('websocket error'); //eslint-disable-line no-console
+ console.log(evt); //eslint-disable-line no-console
}
-
- this.failCount = this.failCount + 1;
-
- ErrorStore.storeLastError({connErrorCount: this.failCount, message: 'Please check connection, Mattermost unreachable. If issue persists, ask administrator to check WebSocket port.'});
- ErrorStore.emitChange();
};
conn.onmessage = (evt) => {
@@ -109,7 +118,8 @@ class SocketStoreClass extends EventEmitter {
handleMessage(msg) {
switch (msg.action) {
case SocketEvents.POSTED:
- handleNewPostEvent(msg);
+ case SocketEvents.EPHEMERAL_MESSAGE:
+ handleNewPostEvent(msg, this.translations);
break;
case SocketEvents.POST_EDITED:
@@ -151,9 +161,12 @@ class SocketStoreClass extends EventEmitter {
this.initialize();
}
}
+ setTranslations(messages) {
+ this.translations = messages;
+ }
}
-function handleNewPostEvent(msg) {
+function handleNewPostEvent(msg, translations) {
// Store post
const post = JSON.parse(msg.props.post);
EventHelpers.emitPostRecievedEvent(post);
@@ -176,7 +189,6 @@ function handleNewPostEvent(msg) {
mentions = JSON.parse(msg.props.mentions);
}
- const channelType = msgProps.channel_type;
const channel = ChannelStore.get(msg.channel_id);
const user = UserStore.getCurrentUser();
const member = ChannelStore.getMember(msg.channel_id);
@@ -188,18 +200,18 @@ function handleNewPostEvent(msg) {
if (notifyLevel === 'none') {
return;
- } else if (notifyLevel === 'mention' && mentions.indexOf(user.id) === -1 && channelType !== Constants.DM_CHANNEL) {
+ } else if (notifyLevel === 'mention' && mentions.indexOf(user.id) === -1 && channel.type !== Constants.DM_CHANNEL) {
return;
}
- let username = 'Someone';
+ let username = translations.someone;
if (post.props.override_username && global.window.mm_config.EnablePostUsernameOverride === 'true') {
username = post.props.override_username;
} else if (UserStore.hasProfile(msg.user_id)) {
username = UserStore.getProfile(msg.user_id).username;
}
- let title = 'Posted';
+ let title = translations.posted;
if (channel) {
title = channel.display_name;
}
@@ -211,14 +223,14 @@ function handleNewPostEvent(msg) {
if (notifyText.length === 0) {
if (msgProps.image) {
- Utils.notifyMe(title, username + ' uploaded an image', channel);
+ Utils.notifyMe(title, username + translations.uploadedImage, channel);
} else if (msgProps.otherFile) {
- Utils.notifyMe(title, username + ' uploaded a file', channel);
+ Utils.notifyMe(title, username + translations.uploadedFile, channel);
} else {
- Utils.notifyMe(title, username + ' did something new', channel);
+ Utils.notifyMe(title, username + translations.something, channel);
}
} else {
- Utils.notifyMe(title, username + ' wrote: ' + notifyText, channel);
+ Utils.notifyMe(title, username + translations.wrote + notifyText, channel);
}
if (!user.notify_props || user.notify_props.desktop_sound === 'true') {
Utils.ding();
diff --git a/web/react/stores/suggestion_store.jsx b/web/react/stores/suggestion_store.jsx
index 9cd566c22..dd5c107e0 100644
--- a/web/react/stores/suggestion_store.jsx
+++ b/web/react/stores/suggestion_store.jsx
@@ -223,7 +223,9 @@ class SuggestionStore extends EventEmitter {
this.emitSuggestionsChanged(id);
break;
case ActionTypes.SUGGESTION_RECEIVED_SUGGESTIONS:
- if (other.matchedPretext === this.getMatchedPretext(id)) {
+ if (this.getMatchedPretext(id) === '') {
+ this.setMatchedPretext(id, other.matchedPretext);
+
// ensure the matched pretext hasn't changed so that we don't receive suggestions for outdated pretext
this.addSuggestions(id, other.terms, other.items, other.component);
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx
index d615e02c7..c5957e8cc 100644
--- a/web/react/utils/async_client.jsx
+++ b/web/react/utils/async_client.jsx
@@ -774,22 +774,31 @@ export function savePreferences(preferences, success, error) {
}
export function getSuggestedCommands(command, suggestionId, component) {
- client.executeCommand(
- '',
- command,
- true,
+ client.listCommands(
(data) => {
+ var matches = [];
+ data.forEach((cmd) => {
+ if (('/' + cmd.trigger).indexOf(command) === 0) {
+ matches.push({
+ suggestion: '/' + cmd.trigger + ' ' + cmd.auto_complete_hint,
+ description: cmd.auto_complete_desc
+ });
+ }
+ });
+
// pull out the suggested commands from the returned data
- const terms = data.suggestions.map((suggestion) => suggestion.suggestion);
+ const terms = matches.map((suggestion) => suggestion.suggestion);
- AppDispatcher.handleServerAction({
- type: ActionTypes.SUGGESTION_RECEIVED_SUGGESTIONS,
- id: suggestionId,
- matchedPretext: command,
- terms,
- items: data.suggestions,
- component
- });
+ if (terms.length > 0) {
+ AppDispatcher.handleServerAction({
+ type: ActionTypes.SUGGESTION_RECEIVED_SUGGESTIONS,
+ id: suggestionId,
+ matchedPretext: command,
+ terms,
+ items: matches,
+ component
+ });
+ }
},
(err) => {
dispatchError(err, 'getCommandSuggestions');
diff --git a/web/react/utils/channel_intro_messages.jsx b/web/react/utils/channel_intro_messages.jsx
index 9685f94b0..69e08f143 100644
--- a/web/react/utils/channel_intro_messages.jsx
+++ b/web/react/utils/channel_intro_messages.jsx
@@ -11,6 +11,8 @@ import Constants from '../utils/constants.jsx';
import TeamStore from '../stores/team_store.jsx';
import * as EventHelpers from '../dispatcher/event_helpers.jsx';
+import {FormattedMessage, FormattedHTMLMessage, FormattedDate} from 'mm-intl';
+
export function createChannelIntroMessage(channel) {
if (channel.type === 'D') {
return createDMIntroMessage(channel);
@@ -48,8 +50,13 @@ export function createDMIntroMessage(channel) {
</strong>
</div>
<p className='channel-intro-text'>
- {'This is the start of your direct message history with ' + teammateName + '.'}<br/>
- {'Direct messages and files shared here are not shown to people outside this area.'}
+ <FormattedHTMLMessage
+ id='intro_messages.DM'
+ defaultMessage='This is the start of your direct message history with {teammate}.<br />Direct messages and files shared here are not shown to people outside this area.'
+ values={{
+ teammate: teammateName
+ }}
+ />
</p>
{createSetHeaderButton(channel)}
</div>
@@ -58,7 +65,12 @@ export function createDMIntroMessage(channel) {
return (
<div className='channel-intro'>
- <p className='channel-intro-text'>{'This is the start of your direct message history with this teammate. Direct messages and files shared here are not shown to people outside this area.'}</p>
+ <p className='channel-intro-text'>
+ <FormattedMessage
+ id='intro_messages.teammate'
+ defaultMessage='This is the start of your direct message history with this teammate. Direct messages and files shared here are not shown to people outside this area.'
+ />
+ </p>
</div>
);
}
@@ -66,11 +78,13 @@ export function createDMIntroMessage(channel) {
export function createOffTopicIntroMessage(channel) {
return (
<div className='channel-intro'>
- <h4 className='channel-intro__title'>{'Beginning of ' + channel.display_name}</h4>
- <p className='channel-intro__content'>
- {'This is the start of ' + channel.display_name + ', a channel for non-work-related conversations.'}
- <br/>
- </p>
+ <FormattedHTMLMessage
+ id='intro_messages.offTopic'
+ defaultMessage='<h4 class="channel-intro__title">Beginning of {display_name}</h4><p class="channel-intro__content">This is the start of {display_name}, a channel for non-work-related conversations.<br/></p>'
+ values={{
+ display_name: channel.display_name
+ }}
+ />
{createSetHeaderButton(channel)}
{createInviteChannelMemberButton(channel, 'channel')}
</div>
@@ -87,7 +101,11 @@ export function createDefaultIntroMessage(channel) {
href='#'
onClick={EventHelpers.showInviteMemberModal}
>
- <i className='fa fa-user-plus'></i>{'Invite others to this team'}
+ <i className='fa fa-user-plus'></i>
+ <FormattedMessage
+ id='intro_messages.inviteOthers'
+ defaultMessage='Invite others to this team'
+ />
</a>
);
} else {
@@ -97,19 +115,24 @@ export function createDefaultIntroMessage(channel) {
href='#'
onClick={EventHelpers.showGetTeamInviteLinkModal}
>
- <i className='fa fa-user-plus'></i>{'Invite others to this team'}
+ <i className='fa fa-user-plus'></i>
+ <FormattedMessage
+ id='intro_messages.inviteOthers'
+ defaultMessage='Invite others to this team'
+ />
</a>
);
}
return (
<div className='channel-intro'>
- <h4 className='channel-intro__title'>{'Beginning of ' + channel.display_name}</h4>
- <p className='channel-intro__content'>
- <strong>{'Welcome to ' + channel.display_name + '!'}</strong>
- <br/><br/>
- {'This is the first channel teammates see when they sign up - use it for posting updates everyone needs to know.'}
- </p>
+ <FormattedHTMLMessage
+ id='intro_messages.default'
+ defaultMessage="<h4 class='channel-intro__title'>Beginning of {display_name}</h4><p class='channel-intro__content'><strong>Welcome to {display_name}!'</strong><br/><br/>This is the first channel teammates see when they sign up - use it for posting updates everyone needs to know.</p>"
+ values={{
+ display_name: channel.display_name
+ }}
+ />
{inviteModalLink}
{createSetHeaderButton(channel)}
<br/>
@@ -124,33 +147,83 @@ export function createStandardIntroMessage(channel) {
var uiType;
var memberMessage;
if (channel.type === 'P') {
- uiType = 'private group';
- memberMessage = ' Only invited members can see this private group.';
+ uiType = (
+ <FormattedMessage
+ id='intro_messages.group'
+ defaultMessage='private group'
+ />
+ );
+ memberMessage = (
+ <FormattedMessage
+ id='intro_messages.onlyInvited'
+ defaultMessage=' Only invited members can see this private group.'
+ />
+ );
} else {
- uiType = 'channel';
- memberMessage = ' Any member can join and read this channel.';
+ uiType = (
+ <FormattedMessage
+ id='intro_messages.channel'
+ defaultMessage='channel'
+ />
+ );
+ memberMessage = (
+ <FormattedMessage
+ id='intro_messages.anyMember'
+ defaultMessage=' Any member can join and read this channel.'
+ />
+ );
}
+ const date = (
+ <FormattedDate
+ value={channel.create_at}
+ month='long'
+ day='2-digit'
+ year='numeric'
+ />
+ );
+
var createMessage;
if (creatorName === '') {
- createMessage = 'This is the start of the ' + uiName + ' ' + uiType + ', created on ' + Utils.displayDate(channel.create_at) + '.';
+ createMessage = (
+ <FormattedMessage
+ id='intro_messages.noCreator'
+ defaultMessage='This is the start of the {name} {type}, created on {date}.'
+ values={{
+ name: (uiName),
+ type: (uiType),
+ date: (date)
+ }}
+ />
+ );
} else {
createMessage = (
<span>
- {'This is the start of the '}
- <strong>{uiName}</strong>
- {' '}
- {uiType}{', created by '}
- <strong>{creatorName}</strong>
- {' on '}
- <strong>{Utils.displayDate(channel.create_at)}</strong>
+ <FormattedHTMLMessage
+ id='intro_messages.creator'
+ defaultMessage='This is the start of the <strong>{name}</strong> {type}, created by <strong>{creator}</strong> on <strong>{date}</strong>'
+ values={{
+ name: (uiName),
+ type: (uiType),
+ date: (date),
+ creator: creatorName
+ }}
+ />
</span>
);
}
return (
<div className='channel-intro'>
- <h4 className='channel-intro__title'>{'Beginning of ' + uiName}</h4>
+ <h4 className='channel-intro__title'>
+ <FormattedMessage
+ id='intro_messages.beginning'
+ defaultMessage='Beginning of {name}'
+ values={{
+ name: (uiName)
+ }}
+ />
+ </h4>
<p className='channel-intro__content'>
{createMessage}
{memberMessage}
@@ -169,7 +242,14 @@ function createInviteChannelMemberButton(channel, uiType) {
dialogType={ChannelInviteModal}
dialogProps={{channel}}
>
- <i className='fa fa-user-plus'></i>{'Invite others to this ' + uiType}
+ <i className='fa fa-user-plus'></i>
+ <FormattedMessage
+ id='intro_messages.invite'
+ defaultMessage='Invite others to this {type}'
+ values={{
+ type: (uiType)
+ }}
+ />
</ToggleModalButton>
);
}
@@ -181,7 +261,11 @@ function createSetHeaderButton(channel) {
dialogType={EditChannelHeaderModal}
dialogProps={{channel}}
>
- <i className='fa fa-pencil'></i>{'Set a header'}
+ <i className='fa fa-pencil'></i>
+ <FormattedMessage
+ id='intro_messages.setHeader'
+ defaultMessage='Set a Header'
+ />
</ToggleModalButton>
);
}
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx
index 33eb4cd47..992337671 100644
--- a/web/react/utils/client.jsx
+++ b/web/react/utils/client.jsx
@@ -908,11 +908,11 @@ export function getChannelExtraInfo(id, memberLimit, success, error) {
export function executeCommand(channelId, command, suggest, success, error) {
$.ajax({
- url: '/api/v1/command',
+ url: '/api/v1/commands/execute',
dataType: 'json',
contentType: 'application/json',
type: 'POST',
- data: JSON.stringify({channelId: channelId, command: command, suggest: '' + suggest}),
+ data: JSON.stringify({channelId, command, suggest: '' + suggest}),
success,
error: function onError(xhr, status, err) {
var e = handleError('executeCommand', xhr, status, err);
@@ -921,6 +921,78 @@ export function executeCommand(channelId, command, suggest, success, error) {
});
}
+export function addCommand(cmd, success, error) {
+ $.ajax({
+ url: '/api/v1/commands/create',
+ dataType: 'json',
+ contentType: 'application/json',
+ type: 'POST',
+ data: JSON.stringify(cmd),
+ success,
+ error: (xhr, status, err) => {
+ var e = handleError('addCommand', xhr, status, err);
+ error(e);
+ }
+ });
+}
+
+export function deleteCommand(data, success, error) {
+ $.ajax({
+ url: '/api/v1/commands/delete',
+ dataType: 'json',
+ contentType: 'application/json',
+ type: 'POST',
+ data: JSON.stringify(data),
+ success,
+ error: (xhr, status, err) => {
+ var e = handleError('deleteCommand', xhr, status, err);
+ error(e);
+ }
+ });
+}
+
+export function listTeamCommands(success, error) {
+ $.ajax({
+ url: '/api/v1/commands/list_team_commands',
+ dataType: 'json',
+ type: 'GET',
+ success,
+ error: (xhr, status, err) => {
+ var e = handleError('listTeamCommands', xhr, status, err);
+ error(e);
+ }
+ });
+}
+
+export function regenCommandToken(data, success, error) {
+ $.ajax({
+ url: '/api/v1/commands/regen_token',
+ dataType: 'json',
+ contentType: 'application/json',
+ type: 'POST',
+ data: JSON.stringify(data),
+ success,
+ error: (xhr, status, err) => {
+ var e = handleError('regenCommandToken', xhr, status, err);
+ error(e);
+ }
+ });
+}
+
+export function listCommands(success, error) {
+ $.ajax({
+ url: '/api/v1/commands/list',
+ dataType: 'json',
+ contentType: 'application/json',
+ type: 'GET',
+ success,
+ error: function onError(xhr, status, err) {
+ var e = handleError('listCommands', xhr, status, err);
+ error(e);
+ }
+ });
+}
+
export function getPostsPage(channelId, offset, limit, success, error, complete) {
$.ajax({
cache: false,
diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx
index 17f6f8fe5..64d4ea8a1 100644
--- a/web/react/utils/constants.jsx
+++ b/web/react/utils/constants.jsx
@@ -12,6 +12,7 @@ export default {
LEAVE_CHANNEL: null,
CREATE_POST: null,
POST_DELETED: null,
+ REMOVE_POST: null,
RECIEVED_CHANNELS: null,
RECIEVED_CHANNEL: null,
@@ -78,7 +79,8 @@ export default {
USER_ADDED: 'user_added',
USER_REMOVED: 'user_removed',
TYPING: 'typing',
- PREFERENCE_CHANGED: 'preference_changed'
+ PREFERENCE_CHANGED: 'preference_changed',
+ EPHEMERAL_MESSAGE: 'ephemeral_message'
},
//SPECIAL_MENTIONS: ['all', 'channel'],
@@ -126,6 +128,7 @@ export default {
POST_LOADING: 'loading',
POST_FAILED: 'failed',
POST_DELETED: 'deleted',
+ POST_TYPE_EPHEMERAL: 'system_ephemeral',
POST_TYPE_JOIN_LEAVE: 'system_join_leave',
SYSTEM_MESSAGE_PREFIX: 'system_',
SYSTEM_MESSAGE_PROFILE_NAME: 'System',
diff --git a/web/react/utils/locales/en.js b/web/react/utils/locales/en.js
deleted file mode 100644
index 08d41225a..000000000
--- a/web/react/utils/locales/en.js
+++ /dev/null
@@ -1,16 +0,0 @@
-// GENERATED FILE
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports["default"] = [{ "locale": "en", "pluralRuleFunction": function pluralRuleFunction(n, ord) {
- var s = String(n).split("."),
- v0 = !s[1],
- t0 = Number(s[0]) == n,
- n10 = t0 && s[0].slice(-1),
- n100 = t0 && s[0].slice(-2);if (ord) return n10 == 1 && n100 != 11 ? "one" : n10 == 2 && n100 != 12 ? "two" : n10 == 3 && n100 != 13 ? "few" : "other";return n == 1 && v0 ? "one" : "other";
-}, "fields": { "year": { "displayName": "Year", "relative": { "0": "this year", "1": "next year", "-1": "last year" }, "relativeTime": { "future": { "one": "in {0} year", "other": "in {0} years" }, "past": { "one": "{0} year ago", "other": "{0} years ago" } } }, "month": { "displayName": "Month", "relative": { "0": "this month", "1": "next month", "-1": "last month" }, "relativeTime": { "future": { "one": "in {0} month", "other": "in {0} months" }, "past": { "one": "{0} month ago", "other": "{0} months ago" } } }, "day": { "displayName": "Day", "relative": { "0": "today", "1": "tomorrow", "-1": "yesterday" }, "relativeTime": { "future": { "one": "in {0} day", "other": "in {0} days" }, "past": { "one": "{0} day ago", "other": "{0} days ago" } } }, "hour": { "displayName": "Hour", "relativeTime": { "future": { "one": "in {0} hour", "other": "in {0} hours" }, "past": { "one": "{0} hour ago", "other": "{0} hours ago" } } }, "minute": { "displayName": "Minute", "relativeTime": { "future": { "one": "in {0} minute", "other": "in {0} minutes" }, "past": { "one": "{0} minute ago", "other": "{0} minutes ago" } } }, "second": { "displayName": "Second", "relative": { "0": "now" }, "relativeTime": { "future": { "one": "in {0} second", "other": "in {0} seconds" }, "past": { "one": "{0} second ago", "other": "{0} seconds ago" } } } } }, { "locale": "en-001", "parentLocale": "en" }, { "locale": "en-150", "parentLocale": "en-GB" }, { "locale": "en-GB", "parentLocale": "en-001" }, { "locale": "en-AG", "parentLocale": "en-001" }, { "locale": "en-AI", "parentLocale": "en-001" }, { "locale": "en-AS", "parentLocale": "en" }, { "locale": "en-AU", "parentLocale": "en-GB", "fields": { "year": { "displayName": "Year", "relative": { "0": "This year", "1": "Next year", "-1": "Last year" }, "relativeTime": { "future": { "one": "in {0} year", "other": "in {0} years" }, "past": { "one": "{0} year ago", "other": "{0} years ago" } } }, "month": { "displayName": "Month", "relative": { "0": "This month", "1": "Next month", "-1": "Last month" }, "relativeTime": { "future": { "one": "in {0} month", "other": "in {0} months" }, "past": { "one": "{0} month ago", "other": "{0} months ago" } } }, "day": { "displayName": "Day", "relative": { "0": "today", "1": "tomorrow", "-1": "yesterday" }, "relativeTime": { "future": { "one": "in {0} day", "other": "in {0} days" }, "past": { "one": "{0} day ago", "other": "{0} days ago" } } }, "hour": { "displayName": "Hour", "relativeTime": { "future": { "one": "in {0} hour", "other": "in {0} hours" }, "past": { "one": "{0} hour ago", "other": "{0} hours ago" } } }, "minute": { "displayName": "Minute", "relativeTime": { "future": { "one": "in {0} minute", "other": "in {0} minutes" }, "past": { "one": "{0} minute ago", "other": "{0} minutes ago" } } }, "second": { "displayName": "Second", "relative": { "0": "now" }, "relativeTime": { "future": { "one": "in {0} second", "other": "in {0} seconds" }, "past": { "one": "{0} second ago", "other": "{0} seconds ago" } } } } }, { "locale": "en-BB", "parentLocale": "en-001" }, { "locale": "en-BE", "parentLocale": "en-GB" }, { "locale": "en-BM", "parentLocale": "en-001" }, { "locale": "en-BS", "parentLocale": "en-001" }, { "locale": "en-BW", "parentLocale": "en-001" }, { "locale": "en-BZ", "parentLocale": "en-001" }, { "locale": "en-CA", "parentLocale": "en" }, { "locale": "en-CC", "parentLocale": "en-001" }, { "locale": "en-CK", "parentLocale": "en-001" }, { "locale": "en-CM", "parentLocale": "en-001" }, { "locale": "en-CX", "parentLocale": "en-001" }, { "locale": "en-DG", "parentLocale": "en-GB" }, { "locale": "en-DM", "parentLocale": "en-001" }, { "locale": "en-Dsrt", "pluralRuleFunction": function pluralRuleFunction(n, ord) {
- if (ord) return "other";return "other";
-}, "fields": { "year": { "displayName": "Year", "relative": { "0": "this year", "1": "next year", "-1": "last year" }, "relativeTime": { "future": { "other": "+{0} y" }, "past": { "other": "-{0} y" } } }, "month": { "displayName": "Month", "relative": { "0": "this month", "1": "next month", "-1": "last month" }, "relativeTime": { "future": { "other": "+{0} m" }, "past": { "other": "-{0} m" } } }, "day": { "displayName": "Day", "relative": { "0": "today", "1": "tomorrow", "-1": "yesterday" }, "relativeTime": { "future": { "other": "+{0} d" }, "past": { "other": "-{0} d" } } }, "hour": { "displayName": "Hour", "relativeTime": { "future": { "other": "+{0} h" }, "past": { "other": "-{0} h" } } }, "minute": { "displayName": "Minute", "relativeTime": { "future": { "other": "+{0} min" }, "past": { "other": "-{0} min" } } }, "second": { "displayName": "Second", "relative": { "0": "now" }, "relativeTime": { "future": { "other": "+{0} s" }, "past": { "other": "-{0} s" } } } } }, { "locale": "en-ER", "parentLocale": "en-001" }, { "locale": "en-FJ", "parentLocale": "en-001" }, { "locale": "en-FK", "parentLocale": "en-GB" }, { "locale": "en-FM", "parentLocale": "en-001" }, { "locale": "en-GD", "parentLocale": "en-001" }, { "locale": "en-GG", "parentLocale": "en-GB" }, { "locale": "en-GH", "parentLocale": "en-001" }, { "locale": "en-GI", "parentLocale": "en-GB" }, { "locale": "en-GM", "parentLocale": "en-001" }, { "locale": "en-GU", "parentLocale": "en" }, { "locale": "en-GY", "parentLocale": "en-001" }, { "locale": "en-HK", "parentLocale": "en-GB" }, { "locale": "en-IE", "parentLocale": "en-GB" }, { "locale": "en-IM", "parentLocale": "en-GB" }, { "locale": "en-IN", "parentLocale": "en-GB" }, { "locale": "en-IO", "parentLocale": "en-GB" }, { "locale": "en-JE", "parentLocale": "en-GB" }, { "locale": "en-JM", "parentLocale": "en-001" }, { "locale": "en-KE", "parentLocale": "en-001" }, { "locale": "en-KI", "parentLocale": "en-001" }, { "locale": "en-KN", "parentLocale": "en-001" }, { "locale": "en-KY", "parentLocale": "en-001" }, { "locale": "en-LC", "parentLocale": "en-001" }, { "locale": "en-LR", "parentLocale": "en-001" }, { "locale": "en-LS", "parentLocale": "en-001" }, { "locale": "en-MG", "parentLocale": "en-001" }, { "locale": "en-MH", "parentLocale": "en" }, { "locale": "en-MO", "parentLocale": "en-GB" }, { "locale": "en-MP", "parentLocale": "en" }, { "locale": "en-MS", "parentLocale": "en-001" }, { "locale": "en-MT", "parentLocale": "en-GB" }, { "locale": "en-MU", "parentLocale": "en-001" }, { "locale": "en-MW", "parentLocale": "en-001" }, { "locale": "en-MY", "parentLocale": "en-001" }, { "locale": "en-NA", "parentLocale": "en-001" }, { "locale": "en-NF", "parentLocale": "en-001" }, { "locale": "en-NG", "parentLocale": "en-001" }, { "locale": "en-NR", "parentLocale": "en-001" }, { "locale": "en-NU", "parentLocale": "en-001" }, { "locale": "en-NZ", "parentLocale": "en-GB" }, { "locale": "en-PG", "parentLocale": "en-001" }, { "locale": "en-PH", "parentLocale": "en-001" }, { "locale": "en-PK", "parentLocale": "en-GB" }, { "locale": "en-PN", "parentLocale": "en-001" }, { "locale": "en-PR", "parentLocale": "en" }, { "locale": "en-PW", "parentLocale": "en-001" }, { "locale": "en-RW", "parentLocale": "en-001" }, { "locale": "en-SB", "parentLocale": "en-001" }, { "locale": "en-SC", "parentLocale": "en-001" }, { "locale": "en-SD", "parentLocale": "en-001" }, { "locale": "en-SG", "parentLocale": "en-GB" }, { "locale": "en-SH", "parentLocale": "en-GB" }, { "locale": "en-SL", "parentLocale": "en-001" }, { "locale": "en-SS", "parentLocale": "en-001" }, { "locale": "en-SX", "parentLocale": "en-001" }, { "locale": "en-SZ", "parentLocale": "en-001" }, { "locale": "en-TC", "parentLocale": "en-001" }, { "locale": "en-TK", "parentLocale": "en-001" }, { "locale": "en-TO", "parentLocale": "en-001" }, { "locale": "en-TT", "parentLocale": "en-001" }, { "locale": "en-TV", "parentLocale": "en-001" }, { "locale": "en-TZ", "parentLocale": "en-001" }, { "locale": "en-UG", "parentLocale": "en-001" }, { "locale": "en-UM", "parentLocale": "en" }, { "locale": "en-US", "parentLocale": "en" }, { "locale": "en-US-POSIX", "parentLocale": "en-US" }, { "locale": "en-VC", "parentLocale": "en-001" }, { "locale": "en-VG", "parentLocale": "en-GB" }, { "locale": "en-VI", "parentLocale": "en" }, { "locale": "en-VU", "parentLocale": "en-001" }, { "locale": "en-WS", "parentLocale": "en-001" }, { "locale": "en-ZA", "parentLocale": "en-001" }, { "locale": "en-ZM", "parentLocale": "en-001" }, { "locale": "en-ZW", "parentLocale": "en-001" }];
-module.exports = exports["default"]; \ No newline at end of file
diff --git a/web/react/utils/locales/es.js b/web/react/utils/locales/es.js
deleted file mode 100644
index 8591950ca..000000000
--- a/web/react/utils/locales/es.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// GENERATED FILE
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports["default"] = [{ "locale": "es", "pluralRuleFunction": function pluralRuleFunction(n, ord) {
- if (ord) return "other";return n == 1 ? "one" : "other";
-}, "fields": { "year": { "displayName": "Año", "relative": { "0": "este año", "1": "el próximo año", "-1": "el año pasado" }, "relativeTime": { "future": { "one": "dentro de {0} año", "other": "dentro de {0} años" }, "past": { "one": "hace {0} año", "other": "hace {0} años" } } }, "month": { "displayName": "Mes", "relative": { "0": "este mes", "1": "el próximo mes", "-1": "el mes pasado" }, "relativeTime": { "future": { "one": "dentro de {0} mes", "other": "dentro de {0} meses" }, "past": { "one": "hace {0} mes", "other": "hace {0} meses" } } }, "day": { "displayName": "Día", "relative": { "0": "hoy", "1": "mañana", "2": "pasado mañana", "-1": "ayer", "-2": "antes de ayer" }, "relativeTime": { "future": { "one": "dentro de {0} día", "other": "dentro de {0} días" }, "past": { "one": "hace {0} día", "other": "hace {0} días" } } }, "hour": { "displayName": "Hora", "relativeTime": { "future": { "one": "dentro de {0} hora", "other": "dentro de {0} horas" }, "past": { "one": "hace {0} hora", "other": "hace {0} horas" } } }, "minute": { "displayName": "Minuto", "relativeTime": { "future": { "one": "dentro de {0} minuto", "other": "dentro de {0} minutos" }, "past": { "one": "hace {0} minuto", "other": "hace {0} minutos" } } }, "second": { "displayName": "Segundo", "relative": { "0": "ahora" }, "relativeTime": { "future": { "one": "dentro de {0} segundo", "other": "dentro de {0} segundos" }, "past": { "one": "hace {0} segundo", "other": "hace {0} segundos" } } } } }, { "locale": "es-419", "parentLocale": "es", "fields": { "year": { "displayName": "Año", "relative": { "0": "Este año", "1": "Año próximo", "-1": "Año pasado" }, "relativeTime": { "future": { "one": "En {0} año", "other": "En {0} años" }, "past": { "one": "hace {0} año", "other": "hace {0} años" } } }, "month": { "displayName": "Mes", "relative": { "0": "Este mes", "1": "Mes próximo", "-1": "El mes pasado" }, "relativeTime": { "future": { "one": "En {0} mes", "other": "En {0} meses" }, "past": { "one": "hace {0} mes", "other": "hace {0} meses" } } }, "day": { "displayName": "Día", "relative": { "0": "hoy", "1": "mañana", "2": "pasado mañana", "-1": "ayer", "-2": "antes de ayer" }, "relativeTime": { "future": { "one": "En {0} día", "other": "En {0} días" }, "past": { "one": "hace {0} día", "other": "hace {0} días" } } }, "hour": { "displayName": "Hora", "relativeTime": { "future": { "one": "En {0} hora", "other": "En {0} horas" }, "past": { "one": "hace {0} hora", "other": "hace {0} horas" } } }, "minute": { "displayName": "Minuto", "relativeTime": { "future": { "one": "En {0} minuto", "other": "En {0} minutos" }, "past": { "one": "hace {0} minuto", "other": "hace {0} minutos" } } }, "second": { "displayName": "Segundo", "relative": { "0": "ahora" }, "relativeTime": { "future": { "one": "En {0} segundo", "other": "En {0} segundos" }, "past": { "one": "hace {0} segundo", "other": "hace {0} segundos" } } } } }, { "locale": "es-AR", "parentLocale": "es-419" }, { "locale": "es-BO", "parentLocale": "es-419" }, { "locale": "es-CL", "parentLocale": "es-419" }, { "locale": "es-CO", "parentLocale": "es-419" }, { "locale": "es-CR", "parentLocale": "es-419" }, { "locale": "es-CU", "parentLocale": "es-419" }, { "locale": "es-DO", "parentLocale": "es-419" }, { "locale": "es-EA", "parentLocale": "es" }, { "locale": "es-EC", "parentLocale": "es-419" }, { "locale": "es-ES", "parentLocale": "es" }, { "locale": "es-GQ", "parentLocale": "es" }, { "locale": "es-GT", "parentLocale": "es-419" }, { "locale": "es-HN", "parentLocale": "es-419" }, { "locale": "es-IC", "parentLocale": "es" }, { "locale": "es-MX", "parentLocale": "es-419", "fields": { "year": { "displayName": "Año", "relative": { "0": "este año", "1": "el año próximo", "-1": "el año pasado" }, "relativeTime": { "future": { "one": "En {0} año", "other": "En {0} años" }, "past": { "one": "hace {0} año", "other": "hace {0} años" } } }, "month": { "displayName": "Mes", "relative": { "0": "este mes", "1": "el mes próximo", "-1": "el mes pasado" }, "relativeTime": { "future": { "one": "en {0} mes", "other": "en {0} meses" }, "past": { "one": "hace {0} mes", "other": "hace {0} meses" } } }, "day": { "displayName": "Día", "relative": { "0": "hoy", "1": "mañana", "2": "pasado mañana", "-1": "ayer", "-2": "antes de ayer" }, "relativeTime": { "future": { "one": "En {0} día", "other": "En {0} días" }, "past": { "one": "hace {0} día", "other": "hace {0} días" } } }, "hour": { "displayName": "Hora", "relativeTime": { "future": { "one": "En {0} hora", "other": "En {0} horas" }, "past": { "one": "hace {0} hora", "other": "hace {0} horas" } } }, "minute": { "displayName": "Minuto", "relativeTime": { "future": { "one": "En {0} minuto", "other": "En {0} minutos" }, "past": { "one": "hace {0} minuto", "other": "hace {0} minutos" } } }, "second": { "displayName": "Segundo", "relative": { "0": "ahora" }, "relativeTime": { "future": { "one": "En {0} segundo", "other": "En {0} segundos" }, "past": { "one": "hace {0} segundo", "other": "hace {0} segundos" } } } } }, { "locale": "es-NI", "parentLocale": "es-419" }, { "locale": "es-PA", "parentLocale": "es-419" }, { "locale": "es-PE", "parentLocale": "es-419" }, { "locale": "es-PH", "parentLocale": "es" }, { "locale": "es-PR", "parentLocale": "es-419" }, { "locale": "es-PY", "parentLocale": "es-419" }, { "locale": "es-SV", "parentLocale": "es-419" }, { "locale": "es-US", "parentLocale": "es-419" }, { "locale": "es-UY", "parentLocale": "es-419" }, { "locale": "es-VE", "parentLocale": "es-419" }];
-module.exports = exports["default"]; \ No newline at end of file
diff --git a/web/react/utils/markdown.jsx b/web/react/utils/markdown.jsx
index 826b87d08..47b3a9a66 100644
--- a/web/react/utils/markdown.jsx
+++ b/web/react/utils/markdown.jsx
@@ -134,7 +134,7 @@ class MattermostMarkdownRenderer extends marked.Renderer {
);
} else if (usedLanguage === 'tex' || usedLanguage === 'latex') {
try {
- const html = katex.renderToString(TextFormatting.sanitizeHtml(code), {throwOnError: false, displayMode: true});
+ const html = katex.renderToString(code, {throwOnError: false, displayMode: true});
return '<div class="post-body--code tex">' + html + '</div>';
} catch (e) {
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 494c38bdb..4beec8d64 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -14,6 +14,8 @@ import * as AsyncClient from './async_client.jsx';
import * as client from './client.jsx';
import Autolinker from 'autolinker';
+import {FormattedTime} from 'mm-intl';
+
export function isEmail(email) {
// writing a regex to match all valid email addresses is really, really hard (see http://stackoverflow.com/a/201378)
// so we just do a simple check and rely on a verification email to tell if it's a real address
@@ -142,16 +144,24 @@ export function getCookie(name) {
}
}
+var requestedNotificationPermission = false;
+
export function notifyMe(title, body, channel) {
- if ('Notification' in window && Notification.permission !== 'denied') {
- Notification.requestPermission(function onRequestPermission(permission) {
+ if (!('Notification' in window)) {
+ return;
+ }
+
+ if (Notification.permission === 'granted' || (Notification.permission === 'default' && !requestedNotificationPermission)) {
+ requestedNotificationPermission = true;
+
+ Notification.requestPermission((permission) => {
if (Notification.permission !== permission) {
Notification.permission = permission;
}
if (permission === 'granted') {
- var notification = new Notification(title, {body: body, tag: body, icon: '/static/images/icon50x50.png'});
- notification.onclick = function onClick() {
+ var notification = new Notification(title, {body, tag: body, icon: '/static/images/icon50x50.png'});
+ notification.onclick = () => {
window.focus();
if (channel) {
switchChannel(channel);
@@ -159,7 +169,7 @@ export function notifyMe(title, body, channel) {
window.location.href = TeamStore.getCurrentTeamUrl() + '/channels/town-square';
}
};
- setTimeout(function closeNotificationOnTimeout() {
+ setTimeout(() => {
notification.close();
}, 5000);
}
@@ -237,6 +247,19 @@ export function displayTime(ticks, utc) {
return hours + ':' + minutes + ampm + timezone;
}
+export function displayTimeFormatted(ticks) {
+ const useMilitaryTime = PreferenceStore.getBool(Constants.Preferences.CATEGORY_DISPLAY_SETTINGS, 'use_military_time');
+
+ return (
+ <FormattedTime
+ value={ticks}
+ hour='numeric'
+ minute='numeric'
+ hour12={!useMilitaryTime}
+ />
+ );
+}
+
export function displayDateTime(ticks) {
var seconds = Math.floor((Date.now() - ticks) / 1000);
@@ -1355,3 +1378,7 @@ export function languages() {
]
);
}
+
+export function isPostEphemeral(post) {
+ return post.type === Constants.POST_TYPE_EPHEMERAL || post.state === Constants.POST_DELETED;
+}
diff --git a/web/sass-files/sass/partials/_base.scss b/web/sass-files/sass/partials/_base.scss
index 04ba9c51e..a13689382 100644
--- a/web/sass-files/sass/partials/_base.scss
+++ b/web/sass-files/sass/partials/_base.scss
@@ -1,28 +1,28 @@
@charset "UTF-8";
html, body {
- height: 100%;
+ height: 100%;
}
body {
- font-family: 'Open Sans', sans-serif;
- -webkit-font-smoothing: antialiased;
- background: $body-bg;
- position: relative;
- width: 100%;
- height: 100%;
- &.white {
- background: #fff;
- > .container-fluid {
- overflow: auto;
- }
- .inner__wrap {
- > .row.content {
- min-height: 100%;
- margin-bottom: -89px;
- }
- }
- }
+ font-family: 'Open Sans', sans-serif;
+ -webkit-font-smoothing: antialiased;
+ background: $body-bg;
+ position: relative;
+ width: 100%;
+ height: 100%;
+ &.white {
+ background: #fff;
+ > .container-fluid {
+ overflow: auto;
+ }
+ .inner__wrap {
+ > .row.content {
+ min-height: 100%;
+ margin-bottom: -89px;
+ }
+ }
+ }
}
.inner__wrap {
@@ -46,175 +46,177 @@ body {
}
img {
- max-width: 100%;
- height: auto;
- &.rounded {
- @include border-radius(100%);
- }
+ max-width: 100%;
+ height: auto;
+ &.rounded {
+ @include border-radius(100%);
+ }
}
.popover {
- @include border-radius(3px);
- color: #333;
- &.bottom, &.right, &.top, &.left {
- >.arrow:after {
- border-color: transparent;
+ @include border-radius(3px);
+ color: #333;
+ &.bottom, &.right, &.top, &.left {
+ >.arrow:after {
+ border-color: transparent;
+ }
+ }
+ .popover-title {
+ background: rgba(black, 0.05);
+ }
+ .popover-content {
+ p:last-child {
+ margin-bottom: 5px;
+ }
}
- }
- .popover-title {
- background: rgba(black, 0.05);
- }
- .popover-content {
- white-space: pre-wrap;
- }
}
.dropdown-menu {
- .divider {
- @include opacity(0.15);
- }
- > li > a {
- color: inherit;
- &:focus, &:hover {
- color: inherit;
+ .divider {
+ @include opacity(0.15);
+ }
+ > li > a {
+ color: inherit;
+ &:focus, &:hover {
+ color: inherit;
+ }
}
- }
}
.word-break--all {
- word-break: break-all;
+ word-break: break-all;
}
a {
- word-break: break-word;
- color: $primary-color;
- cursor: pointer;
+ word-break: break-word;
+ color: $primary-color;
+ cursor: pointer;
}
a:focus, a:hover {
- color: $primary-color;
+ color: $primary-color;
}
.tooltip {
- .tooltip-inner {
- word-break: break-word;
- font-size: 13px;
- padding: 3px 10px 4px;
- font-weight: 500;
- }
+ .tooltip-inner {
+ word-break: break-word;
+ font-size: 13px;
+ padding: 3px 10px 4px;
+ font-weight: 500;
+ }
}
.nopadding {
- padding: 0;
- margin: 0;
+ padding: 0;
+ margin: 0;
}
.text-danger, a.text-danger {
- color: #E05F5D;
- &:hover, &:focus {
color: #E05F5D;
- }
+ &:hover, &:focus {
+ color: #E05F5D;
+ }
}
.btn {
- &.btn-danger {
- color: #fff;
- &:hover, &:active, &:focus {
- color: #fff;
+ &.btn-danger {
+ color: #fff;
+ &:hover, &:active, &:focus {
+ color: #fff;
+ }
}
- }
}
.form-control {
- @include border-radius(2px);
- &:focus {
- @include box-shadow(none);
- }
- &.no-padding {
- line-height: 32px;
- padding: 0;
- }
- &.no-resize {
- resize: none;
- }
+ @include border-radius(2px);
+ &:focus {
+ @include box-shadow(none);
+ }
+ &.no-padding {
+ line-height: 32px;
+ padding: 0;
+ }
+ &.no-resize {
+ resize: none;
+ }
}
.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control {
- cursor: auto;
- background: rgba(#fff, 0.1);
- color: inherit;
+ cursor: auto;
+ background: rgba(#fff, 0.1);
+ color: inherit;
}
.form-group {
- &.form-group--small {
- margin-bottom: 10px;
- }
+ &.form-group--small {
+ margin-bottom: 10px;
+ }
}
.error-panel {
- max-width: 275px;
- position: absolute;
- right: 10px;
- top: 40px;
- z-index: 100;
+ max-width: 275px;
+ position: absolute;
+ right: 10px;
+ top: 40px;
+ z-index: 100;
}
.nav>li>a:focus, .nav>li>a:hover {
- background: transparent;
+ background: transparent;
}
.btn {
- @include single-transition(all, 0.25s, ease-in);
- @include border-radius(1px);
- &.btn-primary {
- border-color: transparent;
- background: $primary-color;
- &:hover, &:focus, &:active {
- background: $primary-color--hover;
- }
- }
- &.btn-inactive {
- border-color: transparent;
- background: #707070;
- color: #fff;
- }
+ @include single-transition(all, 0.25s, ease-in);
+ @include border-radius(1px);
+ &.btn-primary {
+ border-color: transparent;
+ background: $primary-color;
+ &:hover, &:focus, &:active {
+ background: $primary-color--hover;
+ }
+ }
+ &.btn-inactive {
+ border-color: transparent;
+ background: #707070;
+ color: #fff;
+ }
}
.relative-div {
- position:relative;
+ position:relative;
}
@-webkit-keyframes spin2 {
- from { -webkit-transform: rotate(0deg);}
- to { -webkit-transform: rotate(360deg);}
+ from { -webkit-transform: rotate(0deg);}
+ to { -webkit-transform: rotate(360deg);}
}
@keyframes spin {
- from { transform: scale(1) rotate(0deg);}
- to { transform: scale(1) rotate(360deg);}
+ from { transform: scale(1) rotate(0deg);}
+ to { transform: scale(1) rotate(360deg);}
}
.glyphicon-refresh-animate {
- @include animation(spin .7s infinite linear);
+ @include animation(spin .7s infinite linear);
}
.black-bg {
- background-color: black !important;
+ background-color: black !important;
}
.white-bg {
- background-color: white !important;
+ background-color: white !important;
}
.alert {
- padding: 8px 12px;
- @include border-radius(2px);
+ padding: 8px 12px;
+ @include border-radius(2px);
}
.emoji {
- width: 1.5em;
- height: 1.5em;
- display: inline-block;
- margin-bottom: 0.25em;
- background-size: contain;
+ width: 1.5em;
+ height: 1.5em;
+ display: inline-block;
+ margin-bottom: 0.25em;
+ background-size: contain;
}
diff --git a/web/sass-files/sass/partials/_headers.scss b/web/sass-files/sass/partials/_headers.scss
index e73680b38..93cb04198 100644
--- a/web/sass-files/sass/partials/_headers.scss
+++ b/web/sass-files/sass/partials/_headers.scss
@@ -173,6 +173,7 @@
.team__name {
line-height: 22px;
margin-top: -2px;
+ float: left;
}
.user__name {
@include single-transition(all, 0.1s, linear);
@@ -297,8 +298,13 @@
height: 30px;
width: 24px;
line-height: 26px;
- margin-right: 10px;
+ margin-right: 9px;
font-size: 22px;
+ .channel__wrap.move--left & {
+ position: absolute;
+ right: -400px;
+ top: 14px;
+ }
> a {
color: inherit;
text-decoration: none;
diff --git a/web/sass-files/sass/partials/_markdown.scss b/web/sass-files/sass/partials/_markdown.scss
index 7aa29d95d..14e12ecd2 100644
--- a/web/sass-files/sass/partials/_markdown.scss
+++ b/web/sass-files/sass/partials/_markdown.scss
@@ -20,6 +20,14 @@
.post-body--code {
position: relative;
+
+ pre {
+ margin-bottom: 0;
+ word-break: normal;
+ overflow: auto;
+ word-wrap: normal;
+ }
+
}
.post-body--code__language {
@@ -43,7 +51,7 @@
@include opacity(0.2);
}
code {
- white-space: pre-line;
+ white-space: pre;
}
}
.markdown__table {
diff --git a/web/sass-files/sass/partials/_post.scss b/web/sass-files/sass/partials/_post.scss
index 73c7bd9cb..a018315e3 100644
--- a/web/sass-files/sass/partials/_post.scss
+++ b/web/sass-files/sass/partials/_post.scss
@@ -283,8 +283,8 @@ body.ios {
width: 40px;
height: 40px;
position: absolute;
- bottom: 50px;
- right: 5px;
+ bottom: 0;
+ left: 10px;
z-index: 50;
@include opacity(0);
@include single-transition(all, 0.3s);
@@ -408,7 +408,7 @@ body.ios {
@include legacy-pie-clearfix;
&:hover {
- .dropdown, .comment-icon__container, .post__reply {
+ .dropdown, .comment-icon__container, .post__reply, .post__remove {
visibility: visible;
}
.permalink-icon {
@@ -646,6 +646,29 @@ body.ios {
}
}
+ .post__remove {
+ font-family: 'Open Sans', sans-serif;
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ right: 15px;
+ top: -5px;
+ font-size: 20px;
+ width: 20px;
+ height: 20px;
+ line-height: 20px;
+ font-weight: 600;
+ visibility: hidden;
+ color: inherit;
+ @include opacity(0.5);
+ text-decoration: none;
+
+ &:hover {
+ @include opacity(0.8);
+ }
+
+ }
+
.post__body {
word-wrap: break-word;
padding: 0.2em 0.5em 0em;
@@ -656,6 +679,10 @@ body.ios {
margin: 0 0 0.4em;
}
+ p + p {
+ margin-top: 1.4em;
+ }
+
img {
max-height: 400px;
}
@@ -764,12 +791,13 @@ body.ios {
}
svg {
+ height: 17px;
width: 17px;
}
.comment-icon {
display: inline-block;
- top: 3px;
+ top: 2px;
position: relative;
margin-right: 3px;
fill: inherit;
diff --git a/web/sass-files/sass/partials/_responsive.scss b/web/sass-files/sass/partials/_responsive.scss
index 832481cc5..09d498a69 100644
--- a/web/sass-files/sass/partials/_responsive.scss
+++ b/web/sass-files/sass/partials/_responsive.scss
@@ -60,6 +60,11 @@
&.move--left {
@include translateX(0);
+
+ .search-bar__container {
+ padding-right: 8px;
+ }
+
}
}
@@ -68,6 +73,13 @@
&.move--left {
margin-right: 0;
+
+ .channel-header__links {
+ position: relative;
+ right: auto;
+ top: auto;
+ }
+
}
}
diff --git a/web/sass-files/sass/partials/_search.scss b/web/sass-files/sass/partials/_search.scss
index cb125bff0..aa398e916 100644
--- a/web/sass-files/sass/partials/_search.scss
+++ b/web/sass-files/sass/partials/_search.scss
@@ -1,11 +1,14 @@
@charset "UTF-8";
#channel-header .search-bar__container {
- padding: 0 8px 0 3px;
+ padding: 0 9px 0 3px;
}
.search-bar__container {
padding: 12px 8px 0 0;
@include flex(0 0 56px);
+ .sidebar--right.move--left & {
+ padding-right: 42px;
+ }
}
.search__clear {
display: none;
@@ -90,6 +93,7 @@
-webkit-overflow-scrolling: touch;
@include flex(1 1 auto);
height: calc(100% - 56px);
+ padding-top: 10px;
}
.search-results-header {
@@ -104,19 +108,22 @@
border-bottom: $border-gray;
}
-.search-item-container {
- border-top: $border-gray;
- padding: 10px 1em;
- margin: 0;
+.search-item__container {
- &:first-child {
- border: none;
- }
+ .post {
+ padding: 0 1em 1em;
+ margin: 0;
+
+ &:first-child {
+ border: none;
+ }
- .search-channel__name {
- font-weight: 600;
- margin: 0 0 10px 0;
+ .search-channel__name {
+ font-weight: 600;
+ margin: 0 0 10px 0;
+ }
}
+
}
.search-item__jump {
diff --git a/web/static/i18n/en.json b/web/static/i18n/en.json
index 890e7188d..caa4afae3 100644
--- a/web/static/i18n/en.json
+++ b/web/static/i18n/en.json
@@ -8,54 +8,6 @@
"about.date": "Build Date:",
"about.hash": "Build Hash:",
"about.close": "Close",
- "audit_table.sessionRevoked": "The session with id {sessionId} was revoked",
- "audit_table.channelCreated": "Created the {channelName} channel/group",
- "audit_table.establishedDM": "Established a direct message channel with {username}",
- "audit_table.nameUpdated": "Updated the {channelName} channel/group name",
- "audit_table.headerUpdated": "Updated the {channelName} channel/group header",
- "audit_table.channelDeleted": "Deleted the channel/group with the URL {url}",
- "audit_table.userAdded": "Added {username} to the {channelName} channel/group",
- "audit_table.userRemoved": "Removed {username} to the {channelName} channel/group",
- "audit_table.attemptedRegisterApp": "Attempted to register a new OAuth Application with ID {id}",
- "audit_table.attemptedAllowOAuthAccess": "Attempted to allow a new OAuth service access",
- "audit_table.successfullOAuthAccess": "Successfully gave a new OAuth service access",
- "audit_table.failedOAuthAccess": "Failed to allow a new OAuth service access - the redirect URI did not match the previously registered callback",
- "audit_table.attemptedOAuthToken": "Attempted to get an OAuth access token",
- "audit_table.successfullOAuthToken": "Successfully added a new OAuth service",
- "audit_table.oauthTokenFailed": "Failed to get an OAuth access token - {token}",
- "audit_table.attemptedLogin": "Attempted to login",
- "audit_table.successfullLogin": "Successfully logged in",
- "audit_table.failedLogin": "FAILED login attempt",
- "audit_table.updatePicture": "Updated your profile picture",
- "audit_table.updateGeneral": "Updated the general settings of your account",
- "audit_table.attemptedPassword": "Attempted to change password",
- "audit_table.successfullPassword": "Successfully changed password",
- "audit_table.failedPassword": "Failed to change password - tried to update user password who was logged in through oauth",
- "audit_table.updatedRol": "Updated user role(s) to ",
- "audit_table.member": "member",
- "audit_table.accountActive": "Account made active",
- "audit_table.accountInactive": "Account made inactive",
- "audit_table.by": " by {username}",
- "audit_table.byAdmin": " by an admin",
- "audit_table.sentEmail": "Sent an email to {email} to reset your password",
- "audit_table.attemptedReset": "Attempted to reset password",
- "audit_table.successfullReset": "Successfully reset password",
- "audit_table.updateGlobalNotifications": "Updated your global notification settings",
- "audit_table.attemptedWebhookCreate": "Attempted to create a webhook",
- "audit_table.successfullWebhookCreate": "Successfully created a webhook",
- "audit_table.failedWebhookCreate": "Failed to create a webhook - bad channel permissions",
- "audit_table.attemptedWebhookDelete": "Attempted to delete a webhook",
- "audit_table.successfullWebhookDelete": "Successfully deleted a webhook",
- "audit_table.failedWebhookDelete": "Failed to delete a webhook - inappropriate conditions",
- "audit_table.logout": "Logged out of your account",
- "audit_table.verified": "Sucessfully verified your email address",
- "audit_table.revokedAll": "Revoked all current sessions for the team",
- "audit_table.loginAttempt": " (Login attempt)",
- "audit_table.loginFailure": " (Login failure)",
- "audit_table.moreInfo": "More info",
- "audit_table.ip": "IP: {ip}",
- "audit_table.session": "Session ID: {id}",
- "audit_table.userId": "User ID",
"access_history.title": "Access History",
"activity_log_modal.iphoneNativeApp": "iPhone Native App",
"activity_log_modal.androidNativeApp": "Android Native App",
@@ -81,6 +33,7 @@
"admin.sidebar.statistics": "- Statistics",
"admin.sidebar.ldap": "LDAP Settings",
"admin.sidebar.license": "Edition and License",
+ "admin.sidebar.audits": "Compliance and Auditing",
"admin.sidebar.reports": "SITE REPORTS",
"admin.sidebar.view_statistics": "View Statistics",
"admin.sidebar.settings": "SETTINGS",
@@ -97,8 +50,6 @@
"admin.sidebar.teams": "TEAMS ({count})",
"admin.sidebar.other": "OTHER",
"admin.sidebar.logs": "Logs",
- "admin.sidebar.audits": "Audits",
- "admin.analytics.loading": "Loading...",
"admin.analytics.totalUsers": "Total Users",
"admin.analytics.publicChannels": "Public Channels",
"admin.analytics.privateGroups": "Private Groups",
@@ -110,11 +61,14 @@
"admin.analytics.channelTypes": "Channel Types",
"admin.analytics.textPosts": "Posts with Text-only",
"admin.analytics.postTypes": "Posts, Files and Hashtags",
+ "admin.analytics.loading": "Loading...",
"admin.analytics.meaningful": "Not enough data for a meaningful representation.",
"admin.analytics.activeUsers": "Active Users With Posts",
"admin.analytics.recentActive": "Recent Active Users",
"admin.analytics.newlyCreated": "Newly Created Users",
"admin.analytics.title": "Statistics for {title}",
+ "admin.audits.title": "User Activity",
+ "admin.audits.reload": "Reload",
"admin.email.notificationDisplayExample": "Ex: \"Mattermost Notification\", \"System\", \"No-Reply\"",
"admin.email.notificationEmailExample": "Ex: \"mattermost@yourcompany.com\", \"admin@yourcompany.com\"",
"admin.email.smtpUsernameExample": "Ex: \"admin@yourcompany.com\", \"AKIADTOVBGERKLCBV\"",
@@ -126,7 +80,7 @@
"admin.email.connectionSecurityStart": "STARTTLS",
"admin.email.inviteSaltExample": "Ex \"bjlSR4QqkXFBr7TP4oDzlfZmcNuH9Yo\"",
"admin.email.passwordSaltExample": "Ex \"bjlSR4QqkXFBr7TP4oDzlfZmcNuH9Yo\"",
- "admin.email.pushServerEx": "E.g.: \"https://push-test.mattermost.com\"",
+ "admin.email.pushServerEx": "E.g.: \"http://push-test.mattermost.com\"",
"admin.email.testing": "Testing...",
"admin.email.saving": "Saving Config...",
"admin.email.emailSuccess": "No errors were reported while sending an email. Please check your inbox to make sure.",
@@ -169,7 +123,7 @@
"admin.email.pushTitle": "Send Push Notifications: ",
"admin.email.pushDesc": "Typically set to true in production. When true, Mattermost attempts to send iOS and Android push notifications through the push notification server.",
"admin.email.pushServerTitle": "Push Notification Server:",
- "admin.email.pushServerDesc": "Location of Mattermost push notification service you can set up behind your firewall using https://github.com/mattermost/push-proxy. For testing you can use https://push-test.mattermost.com, which connects to the sample Mattermost iOS app in the public Apple AppStore. Please do not use test service for production deployments.",
+ "admin.email.pushServerDesc": "Location of Mattermost push notification service you can set up behind your firewall using https://github.com/mattermost/push-proxy. For testing you can use http://push-test.mattermost.com, which connects to the sample Mattermost iOS app in the public Apple AppStore. Please do not use test service for production deployments.",
"admin.email.save": "Save",
"admin.gitlab.clientIdExample": "Ex \"jcuS8PuvcpGhpgHhlcpT1Mx42pnqMxQY\"",
"admin.gitlab.clientSecretExample": "Ex \"jcuS8PuvcpGhpgHhlcpT1Mx42pnqMxQY\"",
@@ -254,7 +208,7 @@
"admin.ldap.saving": "Saving Config...",
"admin.ldap.bannerHeading": "Note:",
"admin.ldap.bannerDesc": "If a user attribute changes on the LDAP server it will be updated the next time the user enters their credentials to log in to Mattermost. This includes if a user is made inactive or removed from an LDAP server. Synchronization with LDAP servers is planned in a future release.",
- "admin.ldap.noLicense": "<h4 className=\"banner__heading\">Note:</h4><p>LDAP is an enterprise feature. Your current license does not support LDAP. Click <a href=\"http://mattermost.com\"target=\"_blank\">here</a> for information and pricing on enterprise licenses.</p>",
+ "admin.ldap.noLicense": "<h4 class=\"banner__heading\">Note:</h4><p>LDAP is an enterprise feature. Your current license does not support LDAP. Click <a href=\"http://mattermost.com\"target=\"_blank\">here</a> for information and pricing on enterprise licenses.</p>",
"admin.ldap.title": "LDAP Settings",
"admin.ldap.enableTitle": "Enable Login With LDAP:",
"admin.ldap.true": "true",
@@ -301,13 +255,13 @@
"admin.license.removing": "Removing License...",
"admin.license.uploading": "Uploading License...",
"admin.license.enterpriseEdition": "Mattermost Enterprise Edition. Designed for enterprise-scale communication.",
- "admin.license.entrepriseType": "<div><p>This compiled release of Mattermost platform is provided under a <a href=\"http://mattermost.com\" target=\"_blank\">commercial license</a>\n from Mattermost, Inc. based on your subscription level and is subject to the <a href=\"{terms}\" target=\"_blank\">Terms of Service.</a></p>\n <p>Your subscription details are as follows:</p>\n Name: {name}<br />\n Company or organization name: {company}<br/>\n Number of users: {users}<br/>\n License issued: {issued}<br/>\n Start date of license: {start}<br/>\n Expiry date of license: {expires}<br/>\n LDAP: {ldap}<br/></div>",
+ "admin.license.enterpriseType": "<div><p>This compiled release of Mattermost platform is provided under a <a href=\"http://mattermost.com\" target=\"_blank\">commercial license</a>from Mattermost, Inc. based on your subscription level and is subject to the <a href=\"{terms}\" target=\"_blank\">Terms of Service.</a></p><p>Your subscription details are as follows:</p>Name: {name}<br />Company or organization name: {company}<br/>Number of users: {users}<br/>License issued: {issued}<br/>Start date of license: {start}<br/>Expiry date of license: {expires}<br/>LDAP: {ldap}<br/></div>",
"admin.license.keyRemove": "Remove Enterprise License and Downgrade Server",
- "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,\n <a href=\"http://mattermost.com\" target=\"_blank\">disable all Enterprise Edition features on this server</a>.\n This will enable the ability to remove the license key and downgrade this server from Enterprise Edition to Team Edition.",
+ "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.teamEdition": "Mattermost Team Edition. Designed for teams from 5 to 50 users.",
- "admin.license.teamType": "<span><p>This compiled release of Mattermost platform is offered under an MIT license.</p>\n <p>See MIT-COMPILED-LICENSE.txt in your root install directory for details. See NOTICES.txt for information about open source software used in this system.</p></span>",
+ "admin.license.teamType": "<span><p>This compiled release of Mattermost platform is offered under an MIT license.</p><p>See MIT-COMPILED-LICENSE.txt in your root install directory for details. See NOTICES.txt for information about open source software used in this system.</p></span>",
"admin.license.upload": "Upload",
- "admin.license.uploadDesc": "Upload a license key for Mattermost Enterprise Edition to upgrade this server. <a href=\"http://mattermost.com\" target=\"_blank\">Visit us online</a>\n to learn more about the benefits of Enterprise Edition or to purchase a key.",
+ "admin.license.uploadDesc": "Upload a license key for Mattermost Enterprise Edition to upgrade this server. <a href=\"http://mattermost.com\" target=\"_blank\">Visit us online</a>to learn more about the benefits of Enterprise Edition or to purchase a key.",
"admin.license.title": "Edition and License",
"admin.license.edition": "Edition: ",
"admin.license.type": "License: ",
@@ -339,8 +293,6 @@
"admin.log.save": "Save",
"admin.logs.title": "Server Logs",
"admin.logs.reload": "Reload",
- "admin.audits.title": "Server Audits",
- "admin.audits.reload": "Reload",
"admin.privacy.saving": "Saving Config...",
"admin.privacy.title": "Privacy Settings",
"admin.privacy.showEmailTitle": "Show Email Address: ",
@@ -392,17 +344,21 @@
"admin.service.segmentTitle": "Segment Developer Key:",
"admin.service.segmentDescription": "For users running a SaaS services, sign up for a key at Segment.com to track metrics.",
"admin.service.googleTitle": "Google Developer Key:",
- "admin.service.googleDescription": "Set this key to enable embedding of YouTube video previews based on hyperlinks appearing in messages or comments. Instructions to obtain a key available at\n <a href=\"https://www.youtube.com/watch?v=Im69kzhpR3I\" target=\"_blank\">https://www.youtube.com/watch?v=Im69kzhpR3I</a>.\n Leaving the field blank disables the automatic generation of YouTube video previews from links.",
+ "admin.service.googleDescription": "Set this key to enable embedding of YouTube video previews based on hyperlinks appearing in messages or comments. Instructions to obtain a key available at<a href=\"https://www.youtube.com/watch?v=Im69kzhpR3I\" target=\"_blank\">https://www.youtube.com/watch?v=Im69kzhpR3I</a>.Leaving the field blank disables the automatic generation of YouTube video previews from links.",
"admin.service.webhooksTitle": "Enable Incoming Webhooks: ",
"admin.service.true": "true",
"admin.service.false": "false",
"admin.service.webhooksDescription": "When true, incoming webhooks will be allowed. To help combat phishing attacks, all posts from webhooks will be labelled by a BOT tag.",
"admin.service.outWebhooksTitle": "Enable Outgoing Webhooks: ",
"admin.service.outWebhooksDesc": "When true, outgoing webhooks will be allowed.",
- "admin.service.overrideTitle": "Enable Overriding Usernames from Webhooks: ",
- "admin.service.overrideDescription": "When true, webhooks will be allowed to change the username they are posting as. Note, combined with allowing icon overriding, this could open users up to phishing attacks.",
- "admin.service.iconTitle": "Enable Overriding Icon from Webhooks: ",
- "admin.service.iconDescription": "When true, webhooks will be allowed to change the icon they post with. Note, combined with allowing username overriding, this could open users up to phishing attacks.",
+ "admin.service.cmdsTitle": "Enable Slash Commands: ",
+ "admin.service.cmdsDesc": "When true, user created slash commands will be allowed.",
+ "admin.service.integrationAdmin": "Enable Integrations for Admin Only: ",
+ "admin.service.integrationAdminDesc": "When true, user created integrations can only be created by admins.",
+ "admin.service.overrideTitle": "Enable Overriding Usernames from Webhooks and Slash Commands: ",
+ "admin.service.overrideDescription": "When true, webhooks and slash commands will be allowed to change the username they are posting as. Note, combined with allowing icon overriding, this could open users up to phishing attacks.",
+ "admin.service.iconTitle": "Enable Overriding Icon from Webhooks and Slash Commands: ",
+ "admin.service.iconDescription": "When true, webhooks and slash commands will be allowed to change the icon they post with. Note, combined with allowing username overriding, this could open users up to phishing attacks.",
"admin.service.testingTitle": "Enable Testing: ",
"admin.service.testingDescription": "(Developer Option) When true, /loadtest slash command is enabled to load test accounts and test data. Changing this will require a server restart before taking effect.",
"admin.service.developerTitle": "Enable Developer Mode: ",
@@ -484,11 +440,61 @@
"admin.user_item.makeActive": "Make Active",
"admin.user_item.makeInactive": "Make Inactive",
"admin.user_item.resetPwd": "Reset Password",
+ "audit_table.sessionRevoked": "The session with id {sessionId} was revoked",
+ "audit_table.channelCreated": "Created the {channelName} channel/group",
+ "audit_table.establishedDM": "Established a direct message channel with {username}",
+ "audit_table.nameUpdated": "Updated the {channelName} channel/group name",
+ "audit_table.headerUpdated": "Updated the {channelName} channel/group header",
+ "audit_table.channelDeleted": "Deleted the channel/group with the URL {url}",
+ "audit_table.userAdded": "Added {username} to the {channelName} channel/group",
+ "audit_table.userRemoved": "Removed {username} to the {channelName} channel/group",
+ "audit_table.attemptedRegisterApp": "Attempted to register a new OAuth Application with ID {id}",
+ "audit_table.attemptedAllowOAuthAccess": "Attempted to allow a new OAuth service access",
+ "audit_table.successfullOAuthAccess": "Successfully gave a new OAuth service access",
+ "audit_table.failedOAuthAccess": "Failed to allow a new OAuth service access - the redirect URI did not match the previously registered callback",
+ "audit_table.attemptedOAuthToken": "Attempted to get an OAuth access token",
+ "audit_table.successfullOAuthToken": "Successfully added a new OAuth service",
+ "audit_table.oauthTokenFailed": "Failed to get an OAuth access token - {token}",
+ "audit_table.attemptedLogin": "Attempted to login",
+ "audit_table.successfullLogin": "Successfully logged in",
+ "audit_table.failedLogin": "FAILED login attempt",
+ "audit_table.updatePicture": "Updated your profile picture",
+ "audit_table.updateGeneral": "Updated the general settings of your account",
+ "audit_table.attemptedPassword": "Attempted to change password",
+ "audit_table.successfullPassword": "Successfully changed password",
+ "audit_table.failedPassword": "Failed to change password - tried to update user password who was logged in through oauth",
+ "audit_table.updatedRol": "Updated user role(s) to ",
+ "audit_table.member": "member",
+ "audit_table.accountActive": "Account made active",
+ "audit_table.accountInactive": "Account made inactive",
+ "audit_table.by": " by {username}",
+ "audit_table.byAdmin": " by an admin",
+ "audit_table.sentEmail": "Sent an email to {email} to reset your password",
+ "audit_table.attemptedReset": "Attempted to reset password",
+ "audit_table.successfullReset": "Successfully reset password",
+ "audit_table.updateGlobalNotifications": "Updated your global notification settings",
+ "audit_table.attemptedWebhookCreate": "Attempted to create a webhook",
+ "audit_table.successfullWebhookCreate": "Successfully created a webhook",
+ "audit_table.failedWebhookCreate": "Failed to create a webhook - bad channel permissions",
+ "audit_table.attemptedWebhookDelete": "Attempted to delete a webhook",
+ "audit_table.successfullWebhookDelete": "Successfully deleted a webhook",
+ "audit_table.failedWebhookDelete": "Failed to delete a webhook - inappropriate conditions",
+ "audit_table.logout": "Logged out of your account",
+ "audit_table.verified": "Sucessfully verified your email address",
+ "audit_table.revokedAll": "Revoked all current sessions for the team",
+ "audit_table.loginAttempt": " (Login attempt)",
+ "audit_table.loginFailure": " (Login failure)",
+ "audit_table.userId": "User ID",
+ "audit_table.ip": "IP Address",
+ "audit_table.session": "Session ID",
+ "audit_table.timestamp": "Timestamp",
+ "audit_table.action": "Action",
"authorize.title": "An application would like to connect to your {teamName} account",
"authorize.app": "The app <strong>{appName}</strong> would like the ability to access and modify your basic information.",
"authorize.access": "Allow <strong>{appName}</strong> access?",
"authorize.deny": "Deny",
"authorize.allow": "Allow",
+ "center_panel.recent": "Click here to jump to recent messages. ",
"change_url.longer": "Must be longer than two characters",
"change_url.startWithLetter": "Must start with a letter or number",
"change_url.endWithLetter": "Must end with a letter or number",
@@ -516,6 +522,13 @@
"channel_info.close": "Close",
"channel_invite.addNewMembers": "Add New Members to ",
"channel_invite.close": "Close",
+ "channel_loader.socketError": "Please check connection, Mattermost unreachable. If issue persists, ask administrator to check WebSocket port.",
+ "channel_loader.someone": "Someone",
+ "channel_loader.posted": "Posted",
+ "channel_loader.uploadedImage": " uploaded an image",
+ "channel_loader.uploadedFile": " uploaded a file",
+ "channel_loader.something": " did something new",
+ "channel_loader.wrote": " wrote: ",
"channel_memebers_modal.members": " Members",
"channel_members_modal.addNew": " Add New Members",
"channel_members_modal.close": "Close",
@@ -551,6 +564,10 @@
"create_comment.commentTitle": "Comment",
"create_comment.file": "File uploading",
"create_comment.files": "Files uploading",
+ "create_post.comment": "Comment",
+ "create_post.post": "Post",
+ "create_post.write": "Write a message...",
+ "create_post.tutorialTip": "<h4>Sending Messages</h4><p>Type here to write a message and press <strong>Enter</strong> to post it.</p><p>Click the <strong>Attachment</strong> button to upload an image or a file.</p>",
"delete_channel.channel": "channel",
"delete_channel.group": "group",
"delete_channel.confirm": "Confirm DELETE Channel",
@@ -588,6 +605,9 @@
"email_verify.resend": "Resend Email",
"email_verify.sent": " Verification email sent.",
"error_bar.preview_mode": "Preview Mode: Email notifications have not been configured",
+ "file_attachment.download": "Download",
+ "file_info_preview.type": "File type ",
+ "file_info_preview.size": "Size ",
"upload_overlay.info": "Drop a file to upload it.",
"file_upload.limited": "Uploads limited to {count} files maximum. Please use additional posts for more files.",
"file_upload.filesAbove": "Files above {max}MB could not be uploaded: {filenames}",
@@ -630,6 +650,12 @@
"login_email.email": "Email",
"login_email.pwd": "Password",
"login_email.signin": "Sign in",
+ "login_ldap.badTeam": "Bad team name",
+ "login_ldap.idlReq": "An LDAP ID is required",
+ "login_ldap.pwdReq": "An LDAP password is required",
+ "login_ldap.username": "LDAP Username",
+ "login_ldap.pwd": "LDAP Password",
+ "login_ldap.signin": "Sign in",
"login_username.badTeam": "Bad team name",
"login_username.usernameReq": "A username is required",
"login_username.pwdReq": "A password is required",
@@ -638,12 +664,6 @@
"login_username.username": "Username",
"login_username.pwd": "Password",
"login_username.signin": "Sign in",
- "login_ldap.badTeam": "Bad team name",
- "login_ldap.idlReq": "An LDAP ID is required",
- "login_ldap.pwdReq": "An LDAP password is required",
- "login_ldap.username": "LDAP Username",
- "login_ldap.pwd": "LDAP Password",
- "login_ldap.signin": "Sign in",
"login.gitlab": "with GitLab",
"login.google": "with Google Apps",
"login.changed": " Sign-in method changed successfully",
@@ -697,6 +717,19 @@
"navbar_dropdown.accountSettings": "Account Settings",
"navbar_dropdown.logout": "Logout",
"navbar_dropdown.about": "About Mattermost",
+ "navbar.viewInfo": "View Info",
+ "navbar.setHeader": "Set Channel Header...",
+ "navbar.setPurpose": "Set Channel Purpose...",
+ "navbar.addMembers": "Add Members",
+ "navbar.leave": "Leave Channel",
+ "navbar.manageMembers": "Manage Members",
+ "navbar.delete": "Delete Channel...",
+ "navbar.rename": "Rename Channel...",
+ "navbar.preferences": "Notification Preferences",
+ "navbar.toggle1": "Toggle sidebar",
+ "navbar.toggle2": "Toggle sidebar",
+ "navbar.click": "Click here",
+ "navbar.noHeader": "No channel header yet.{newline}{link} to add one.",
"channel_flow.invalidName": "Invalid Channel Name",
"channel_flow.alreadyExist": "A channel with that URL already exists",
"channel_flow.channel": "Channel",
@@ -737,9 +770,24 @@
"password_send.reset": "Reset my password",
"members_popover.msg": "Message",
"members_popover.title": "Members",
+ "post_attachment.collapse": "▲ collapse text",
+ "post_attachment.more": "▼ read more",
+ "post_body.plusOne": " plus 1 other file",
+ "post_body.plusMore": " plus {count} other files",
+ "post_body.commentedOn": "Commented on {name}{apostrophe} message: ",
+ "post_body.retry": "Retry",
+ "post_body.deleted": "(message deleted)",
"post_delete.notPosted": "Comment could not be posted",
"post_delete.someone": "Someone deleted the message on which you tried to post a comment.",
"post_delete.okay": "Okay",
+ "post_focus_view.beginning": "Beginning of Channel Archives",
+ "post_info.reply": "Reply",
+ "post_info.permalink": "Permalink",
+ "post_info.del": "Delete",
+ "post_info.edit": "Edit",
+ "post_info.copy": "Copy ",
+ "posts_view.newMsg": "New Messages",
+ "posts_view.loadMore": "Load more messages",
"register_app.required": "Required",
"register_app.optional": "Optional",
"register_app.nameError": "Application name must be filled in.",
@@ -793,7 +841,7 @@
"search_item.jump": "Jump",
"search_results.usage": "<ul><li>Use <b>\"quotation marks\"</b> to search for phrases</li><li>Use <b>from:</b> to find posts from specific users and <b>in:</b> to find posts in specific channels</li></ul>",
"search_results.noResults": "NO RESULTS",
- "search_results.because": "<ul>\n <li>If you're searching a partial phrase (ex. searching \"rea\", looking for \"reach\" or \"reaction\"), append a * to your search term</li>\n <li>Due to the volume of results, two letter searches and common words like \"this\", \"a\" and \"is\" won't appear in search results</li>\n </ul>",
+ "search_results.because": "<ul><li>If you're searching a partial phrase (ex. searching \"rea\", looking for \"reach\" or \"reaction\"), append a * to your search term</li><li>Due to the volume of results, two letter searches and common words like \"this\", \"a\" and \"is\" won't appear in search results</li></ul>",
"setting_item_max.save": "Save",
"setting_item_max.cancel": "Cancel",
"setting_item_min.edit": "Edit",
@@ -804,7 +852,7 @@
"setting_upload.noFile": "No file selected.",
"setting_upload.select": "Select file",
"setting_upload.import": "Import",
- "sidebar_header.tutorial": "<h4>Main Menu</h4>\n <p>The <strong>Main Menu</strong> is where you can <strong>Invite New Members</strong>, access your <strong>Account Settings</strong> and set your <strong>Theme Color</strong>.</p>\n <p>Team administrators can also access their <strong>Team Settings</strong> from this menu.</p><p>System administrators will find a <strong>System Console</strong> option to administrate the entire system.</p>",
+ "sidebar_header.tutorial": "<h4>Main Menu</h4><p>The <strong>Main Menu</strong> is where you can <strong>Invite New Members</strong>, access your <strong>Account Settings</strong> and set your <strong>Theme Color</strong>.</p><p>Team administrators can also access their <strong>Team Settings</strong> from this menu.</p><p>System administrators will find a <strong>System Console</strong> option to administrate the entire system.</p>",
"sidebar_right_menu.inviteNew": "Invite New Member",
"sidebar_right_menu.teamLink": "Get Team Invite Link",
"sidebar_right_menu.teamSettings": "Team Settings",
@@ -815,8 +863,8 @@
"sidebar_right_menu.accountSettings": "Account Settings",
"sidebar_right_menu.logout": "Logout",
"sidebar.tutorialScreen1": "<h4>Channels</h4><p><strong>Channels</strong> organize conversations across different topics. They’re open to everyone on your team. To send private communications use <strong>Direct Messages</strong> for a single person or <strong>Private Groups</strong> for multiple people.</p>",
- "sidebar.tutorialScreen2": "<h4>\"Town Square\" and \"Off-Topic\" channels</h4>\n <p>Here are two public channels to start:</p>\n <p><strong>Town Square</strong> is a place for team-wide communication. Everyone in your team is a member of this channel.</p>\n <p><strong>Off-Topic</strong> is a place for fun and humor outside of work-related channels. You and your team can decide what other channels to create.</p>",
- "sidebar.tutorialScreen3": "<h4>Creating and Joining Channels</h4>\n <p>Click <strong>\"More...\"</strong> to create a new channel or join an existing one.</p>\n <p>You can also create a new channel or private group by clicking the <strong>\"+\" symbol</strong> next to the channel or private group header.</p>",
+ "sidebar.tutorialScreen2": "<h4>\"Town Square\" and \"Off-Topic\" channels</h4><p>Here are two public channels to start:</p><p><strong>Town Square</strong> is a place for team-wide communication. Everyone in your team is a member of this channel.</p><p><strong>Off-Topic</strong> is a place for fun and humor outside of work-related channels. You and your team can decide what other channels to create.</p>",
+ "sidebar.tutorialScreen3": "<h4>Creating and Joining Channels</h4><p>Click <strong>\"More...\"</strong> to create a new channel or join an existing one.</p><p>You can also create a new channel or private group by clicking the <strong>\"+\" symbol</strong> next to the channel or private group header.</p>",
"sidebar.removeList": "Remove from list",
"sidebar.more": "More ({count})",
"sidebar.createChannel": "Create new channel",
@@ -841,6 +889,7 @@
"signup_user_completed.usernameLength": "Username must begin with a letter, and contain between {min} to {max} lowercase characters made up of numbers, letters, and the symbols '.', '-' and '_'.",
"signup_user_completed.passwordLength": "Please enter at least {min} characters",
"signup_user_completed.expired": "You've already completed the signup process for this invitation or this invitation has expired.",
+ "signup_user_completed.emailHelp": "Valid email required for sign-up",
"signup_user_completed.userHelp": "Username must begin with a letter, and contain between {min} to {max} lowercase characters made up of numbers, letters, and the symbols '.', '-' and '_'",
"signup_user_completed.emailIs": "Your email address is <strong>{email}</strong>. You'll use this address to sign in to {siteName}.",
"signup_user_completed.whatis": "What's your email address?",
@@ -933,7 +982,7 @@
"team_signup_url.unavailable": "This URL is unavailable. Please try another.",
"team_signup_url.teamUrl": "Team URL",
"team_signup_url.webAddress": "Choose the web address of your new team:",
- "team_signup_url.hint": "<li>Short and memorable is best</li>\n <li>Use lowercase letters, numbers and dashes</li>\n <li>Must start with a letter and can't end in a dash</li>",
+ "team_signup_url.hint": "<li>Short and memorable is best</li><li>Use lowercase letters, numbers and dashes</li><li>Must start with a letter and can't end in a dash</li>",
"team_signup_url.next": "Next",
"team_signup_url.back": "Back to previous step",
"team_signup_username.reserved": "This username is reserved, please choose a new one.",
@@ -950,7 +999,7 @@
"team_signup_welcome.welcome": "Welcome to:",
"team_signup_welcome.lets": "Let's set up your new team",
"team_signup_welcome.confirm": "Please confirm your email address:",
- "team_signup_welcome.admin": "Your account will administer the new team site. <br />\n You can add other administrators later.",
+ "team_signup_welcome.admin": "Your account will administer the new team site. <br />You can add other administrators later.",
"team_signup_welcome.yes": "Yes, this address is correct",
"team_signup_welcome.instead": "Use this instead",
"team_signup_welcome.different": "Use a different email",
@@ -967,8 +1016,8 @@
"textbox.edit": "Edit message",
"textbox.preview": "Preview",
"textbox.help": "Help",
- "tutorial_intro.screenOne": "<h3>Welcome to:</h3>\n <h1>Mattermost</h1>\n <p>Your team communication all in one place, instantly searchable and available anywhere</p>\n <p>Keep your team connected to help them achieve what matters most.</p>",
- "tutorial_intro.screenTwo": "<h3>How Mattermost works:</h3>\n <p>Communication happens in public discussion channels, private groups and direct messages.</p>\n <p>Everything is archived and searchable from any web-enabled desktop, laptop or phone.</p>",
+ "tutorial_intro.screenOne": "<h3>Welcome to:</h3><h1>Mattermost</h1><p>Your team communication all in one place, instantly searchable and available anywhere</p><p>Keep your team connected to help them achieve what matters most.</p>",
+ "tutorial_intro.screenTwo": "<h3>How Mattermost works:</h3><p>Communication happens in public discussion channels, private groups and direct messages.</p><p>Everything is archived and searchable from any web-enabled desktop, laptop or phone.</p>",
"tutorial_intro.invite": "Invite teammates",
"tutorial_intro.teamInvite": "Team Invite",
"tutorial_intro.support": "Need anything, just email us at ",
@@ -1009,6 +1058,41 @@
"user.settings.import_theme.importBody": "To import a theme, go to a Slack team and look for “Preferences -> Sidebar Theme”. Open the custom theme option, copy the theme color values and paste them here:",
"user.settings.import_theme.cancel": "Cancel",
"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_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.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.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_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_desc_desc": "A short description of what this commands does",
+ "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.add": "Add",
"user.settings.hooks_in.channel": "Channel: ",
"user.settings.hooks_in.none": "None",
"user.settings.hooks_in.existing": "Existing incoming webhooks",
@@ -1104,6 +1188,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.title": "Integration Settings",
"user.settings.modal.general": "General",
"user.settings.modal.security": "Security",
@@ -1125,9 +1211,10 @@
"user.settings.notification.allActivity": "For all activity",
"user.settings.notifications.onlyMentions": "Only for mentions and direct messages",
"user.settings.notifications.never": "Never",
- "user.settings.notifications.info": "Desktop notification sounds are available on Firefox, Safari, Chrome, Internet Explorer, and Edge.",
+ "user.settings.notifications.info": "Desktop notifications are available on Firefox, Safari, Chrome, Internet Explorer, and Edge.",
"user.settings.notifications.on": "On",
"user.settings.notifications.off": "Off",
+ "user.settings.notifications.sounds_info": "Desktop notifications sounds are available on Firefox, Safari, Chrome, Internet Explorer, and Edge.",
"user.settings.notification.soundConfig": "Please configure notification sounds in your browser settings",
"user.settings.notifications.emailInfo": "Email notifications are sent for mentions and direct messages after you’ve been offline for more than 60 seconds or away from {siteName} for more than 5 minutes.",
"user.settings.notifications.sensitiveName": "Your case sensitive first name \"{first_name}\"",
@@ -1157,5 +1244,23 @@
"user.settings.security.gitlab": "GitLab SSO",
"user.settings.security.title": "Security Settings",
"user.settings.security.viewHistory": "View Access History",
- "user.settings.security.logoutActiveSessions": "View and Logout of Active Sessions"
-}
+ "user.settings.security.logoutActiveSessions": "View and Logout of Active Sessions",
+ "view_image_popover.publicLink": "Get Public Link",
+ "view_image_popover.file": "File {count} of {total}",
+ "view_image_popover.download": "Download",
+ "view_image.loading": "Loading ",
+ "intro_messages.DM": "This is the start of your direct message history with {teammate}.<br />Direct messages and files shared here are not shown to people outside this area.",
+ "intro_messages.teammate": "This is the start of your direct message history with this teammate. Direct messages and files shared here are not shown to people outside this area.",
+ "intro_messages.offTopic": "<h4 class=\"channel-intro__title\">Beginning of {display_name}</h4><p class=\"channel-intro__content\">This is the start of {display_name}, a channel for non-work-related conversations.<br/></p>",
+ "intro_messages.inviteOthers": "Invite others to this team",
+ "intro_messages.default": "<h4 class='channel-intro__title'>Beginning of {display_name}</h4><p class='channel-intro__content'><strong>Welcome to {display_name}!'</strong><br/><br/>This is the first channel teammates see when they sign up - use it for posting updates everyone needs to know.</p>",
+ "intro_messages.group": "private group",
+ "intro_messages.onlyInvited": " Only invited members can see this private group.",
+ "intro_messages.channel": "channel",
+ "intro_messages.anyMember": " Any member can join and read this channel.",
+ "intro_messages.noCreator": "This is the start of the {name} {type}, created on {date}.",
+ "intro_messages.creator": "This is the start of the <strong>{name}</strong> {type}, created by <strong>{creator}</strong> on <strong>{date}</strong>",
+ "intro_messages.beginning": "Beginning of {name}",
+ "intro_messages.invite": "Invite others to this {type}",
+ "intro_messages.setHeader": "Set a Header"
+} \ No newline at end of file
diff --git a/web/static/i18n/es.json b/web/static/i18n/es.json
index 92f3ba2ea..b22a7cfd2 100644
--- a/web/static/i18n/es.json
+++ b/web/static/i18n/es.json
@@ -8,54 +8,7 @@
"about.teamEdtion": "Edición Team",
"about.title": "Acerca de Mattermost",
"about.version": "Versión:",
- "access_history.accountActive": "La cuenta se ha activado",
- "access_history.accountInactive": "La cuenta se ha desactivado",
- "access_history.attemptedAllowOAuthAccess": "Intento para permitir acceso a un nuevo servicio de OAuth",
- "access_history.attemptedLogin": "Intento de inicio de sesión",
- "access_history.attemptedOAuthToken": "Intento de obtener un token de acceso de OAuth",
- "access_history.attemptedPassword": "Intento de cambio de contraseña",
- "access_history.attemptedRegisterApp": "Intento de registrar una nueva aplicación OAuth con el ID {id}",
- "access_history.attemptedReset": "Intento de reestablecer al contraseña",
- "access_history.attemptedWebhookCreate": "Intento de creación de un webhook",
- "access_history.attemptedWebhookDelete": "Intento de eliminación de un webhook",
- "access_history.by": " por {username}",
- "access_history.byAdmin": " por un admin",
- "access_history.channelCreated": "Creado el canal/grupo {channelName}",
- "access_history.channelDeleted": "Eliminado el canal/grupo con el URL {url}",
- "access_history.establishedDM": "Establecido un canal de mensajes directos con {username}",
- "access_history.failedLogin": "Intento de inicio de sesión FALLIDO",
- "access_history.failedOAuthAccess": "Fallo al permitir acceso a un nuevo servicio de OAuth - la URI de redirección no concuerda con la previamente registrada",
- "access_history.failedPassword": "Fallo al cambiar la contraseña - se trató de actualizar la contraseña de un usuario que ingresó por medio de un servicio de OAuth",
- "access_history.failedWebhookCreate": "Falló la creación del webhook - permisos inadecuados del canal",
- "access_history.failedWebhookDelete": "Falló la eliminación del webhook - condiciones inapropiadas",
- "access_history.headerUpdated": "Actualizado el cancabezado del canal/grupo {channelName}",
- "access_history.ip": "IP: {ip}",
- "access_history.loginAttempt": " (intento de inicio de sesión)",
- "access_history.loginFailure": " (Fallo de inicio de sesión)",
- "access_history.logout": "Cerrada la sesión de tu cuenta",
- "access_history.member": "miembro",
- "access_history.moreInfo": "Más información",
- "access_history.nameUpdated": "Actualizado el nombre del canal/grupo {channelName}",
- "access_history.oauthTokenFailed": "Fallo al obtener un token de acceso de OAuth - {token}",
- "access_history.revokedAll": "Revocadas todas las sesiones actuales para el equipo",
- "access_history.sentEmail": "Enviado un correo electrónico a {email} para restablecer tu contraseña",
- "access_history.session": "Sesión ID: {id}",
- "access_history.sessionRevoked": "La sesión con el id {sessionId} fue revocada",
- "access_history.successfullLogin": "Inicio de sesión con éxito",
- "access_history.successfullOAuthAccess": "Se asignó un nuevo servicio de OAuth con éxito",
- "access_history.successfullOAuthToken": "Se agregó un nuevo servicio de OAuth con éxito",
- "access_history.successfullPassword": "La contraseña se cambió satisfactoriamente",
- "access_history.successfullReset": "La contraseña fue reestablecida con éxito",
- "access_history.successfullWebhookCreate": "Creación del webhook con éxito",
- "access_history.successfullWebhookDelete": "Eliminación del webhook con éxito",
"access_history.title": "Historial de Acceso",
- "access_history.updateGeneral": "Actualizada la configuración general de tu cuenta",
- "access_history.updateGlobalNotifications": "Actualizada la configuración global de tus notificaciones",
- "access_history.updatePicture": "Actualizada tu imagén de perfil",
- "access_history.updatedRol": "Actualizado rol(es) de usuario a ",
- "access_history.userAdded": "Agregado {username} al canal/grupo {channelName}",
- "access_history.userRemoved": "Removido {username} del canal/grupo {channelName}",
- "access_history.verified": "Se verificó tu dirección de correo electrónico con éxito",
"activity_log.activeSessions": "Sesiones Activas",
"activity_log.browser": "Navegador: {browser}",
"activity_log.firstTime": "Primera actividad: {date}, {time}",
@@ -69,17 +22,30 @@
"activity_log_modal.androidNativeApp": "Android App Nativa",
"activity_log_modal.iphoneNativeApp": "iPhone App Nativa",
"admin.analytics.activeUsers": "Usuarios Activos con Mensajes",
+ "admin.analytics.channelTypes": "Tipos de Canales",
"admin.analytics.loading": "Cargando...",
"admin.analytics.meaningful": "No hay suficiente data para tener una representación significativa.",
"admin.analytics.newlyCreated": "Nuevos Usuarios Creados",
+ "admin.analytics.postTypes": "Mesajes, Archivos y Hashtags",
"admin.analytics.privateGroups": "Grupos Privados",
"admin.analytics.publicChannels": "Canales Públicos",
"admin.analytics.recentActive": "Usuarios Recientemente Activos",
+ "admin.analytics.textPosts": "Mensajes de sólo Texto",
"admin.analytics.title": "Estadísticas para {title}",
+ "admin.analytics.totalFilePosts": "Mensajes con Archivos",
+ "admin.analytics.totalHashtagPosts": "Mensajes con Hashtags",
+ "admin.analytics.totalIncomingWebhooks": "Webhooks de Entrada",
+ "admin.analytics.totalOutgoingWebhooks": "Webhooks de Salida",
"admin.analytics.totalPosts": "Total de Mensajes",
"admin.analytics.totalUsers": "Total de Usuarios",
+ "admin.audits.reload": "Recargar",
+ "admin.audits.title": "Auditorías del Servidor",
+ "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.",
- "admin.email.allowSignupTitle": "Permitir inicio de sesión con correo:",
+ "admin.email.allowSignupTitle": "Permitir registro con correo electrónico:",
+ "admin.email.allowUsernameSignInDescription": "Cuando es verdadero, Mattermost permite a los usuarios iniciar sesión con el nombre de usuario y contraseña. Esta opción normalmente se utiliza cuando la verificación de correo electrónico está deshabilitada.",
+ "admin.email.allowUsernameSignInTitle": "Permitir inicio de sesión con Nombre de usuario: ",
"admin.email.connectionSecurityNone": "Ninguno",
"admin.email.connectionSecurityNoneDescription": "Mattermost enviará los correos electrónicos sobre conexiones no seguras.",
"admin.email.connectionSecurityStart": "STARTTLS",
@@ -242,19 +208,19 @@
"admin.ldap.uernameAttrDesc": "El atributo en el servidor LDAP que se utilizará para poblar el nombre de usuario en Mattermost. Este puede ser igual al Attributo Id.",
"admin.ldap.usernameAttrEx": "Ej \"sAMAccountName\"",
"admin.ldap.usernameAttrTitle": "Atributo Usuario:",
- "admin.licence.keyMigration": "Si estás migrando servidores es posible que necesites remover tu licencia de este servidor para poder instalarlo en un servidor nuevo. Para empezar,\n <a href=\"http://mattermost.com\" target=\"_blank\">deshabilita todas las características de la Edición Enterprise de este servidor</a>.\n Esta operación habilitará la opción para remover la licencia y degradar este servidor de la Edición Enterprise a la Edición Team.",
+ "admin.licence.keyMigration": "Si estás migrando servidores es posible que necesites remover tu licencia de este servidor para poder instalarlo en un servidor nuevo. Para empezar,<a href=\"http://mattermost.com\" target=\"_blank\">deshabilita todas las características de la Edición Enterprise de este servidor</a>.Esta operación habilitará la opción para remover la licencia y degradar este servidor de la Edición Enterprise a la Edición Team.",
"admin.license.edition": "Edición: ",
"admin.license.enterpriseEdition": "Mattermost Edición Enterprise. Diseñada para comunicación de escala empresarial.",
- "admin.license.entrepriseType": "<div><p>Esta versión compilada de la plataforma de Mattermost es proporcionada bajo una <a href=\"http://mattermost.com\" target=\"_blank\">licencia comercial</a>\n de Mattermost, Inc. basado en tu nivel de subscripción y sujeto a los <a href=\"{terms}\" target=\"_blank\">Términos del Servicio.</a></p>\n <p>Los detalles de tu subscripción son los siguientes:</p>\n Nombre: {name}<br />\n Nombre de compañia u organización: {company}<br/>\n Cantidad de usuarios: {users}<br/>\n Licencia emitida por: {issued}<br/>\n Inicio de la licencia: {start}<br/>\n Fecha de expiración: {expires}<br/>\n LDAP: {ldap}<br/></div>",
+ "admin.license.enterpriseType": "<div><p>Esta versión compilada de la plataforma de Mattermost es provista bajo una <a href=\"http://mattermost.com\" target=\"_blank\">licencia comercial</a> de Mattermost, Inc. en función en su nivel de subscripción y bajo los <a href=\"{terms}\" target=\"_blank\">Términos del Servicio.</a></p><p>Los detalles de tu subscripción son los siguientes:</p>Nombre: {name}<br />Nombre compañía u organización: {company}<br/>Cantidad de usuarios: {users}<br/>Licencia emitida: {issued}<br/>Fecha de inicio: {start}<br/>Fecha de expiración: {expires}<br/>LDAP: {ldap}<br/></div>",
"admin.license.key": "Llave de la Licencia: ",
"admin.license.keyRemove": "Remover la Licencia Enterprise y Degradar el Servidor",
"admin.license.removing": "Removiendo Licencia...",
"admin.license.teamEdition": "Mattermost Edición Team. Diseñado para equipos desde 5 hasta 50 usuarios.",
- "admin.license.teamType": "<span><p>Esta versión compilada de la plataforma de Mattermost es proporcionada bajo la licencia MIT.</p>\n <p>Lea MIT-COMPILED-LICENSE.txt en el directorio raíz de la instalación para más detalles. Lea NOTICES.txt para información sobre software libre utilizado en este sistema.</p></span>",
+ "admin.license.teamType": "<span><p>Esta versión compilada de la plataforma de Mattermost es proporcionada bajo la licencia MIT.</p><p>Lea MIT-COMPILED-LICENSE.txt en el directorio raíz de la instalación para más detalles. Lea NOTICES.txt para información sobre software libre utilizado en este sistema.</p></span>",
"admin.license.title": "Edición y Licencia",
"admin.license.type": "Licencia: ",
"admin.license.upload": "Subir",
- "admin.license.uploadDesc": "Subir una llave de licencia de Mattermost Edición Enterprise para mejorar este servidor. <a href=\"http://mattermost.com\" target=\"_blank\">Visitanos en línea</a>\n para conocer más acerca de los beneficios de la Edición Enterprise or para comprar una licencia.",
+ "admin.license.uploadDesc": "Subir una llave de licencia de Mattermost Edición Enterprise para mejorar este servidor. <a href=\"http://mattermost.com\" target=\"_blank\">Visitanos en línea</a>para conocer más acerca de los beneficios de la Edición Enterprise or para comprar una licencia.",
"admin.license.uploading": "Subiendo Licencia...",
"admin.log.consoleDescription": "Normalmente asignado en falso en producción. Los desarolladores pueden configurar este campo en verdadero para ver de mensajes de consola basado en las opciones de nivel configuradas. Si es verdadera, el servidor escribirá los mensajes en una salida estandar (stdout).",
"admin.log.consoleTitle": "Mostrar registros en la consola: ",
@@ -327,6 +293,8 @@
"admin.service.attemptDescription": "Inicio de sesión permitidos antes que el usuario sea bloqueado y se requiera volver a configurar la contraseña vía correo electrónico.",
"admin.service.attemptExample": "Ej \"10\"",
"admin.service.attemptTitle": "Máximo de intentos de conexión:",
+ "admin.service.cmdsDesc": "Cuando es verdadero, se permite la creación de comandos de barra por usuarios.",
+ "admin.service.cmdsTitle": "Habilitar Comandos de Barra: ",
"admin.service.developerDesc": "(Opción de Desarrollador) Cuando está asignado en verdadero, información extra sobre errores se muestra en el UI.",
"admin.service.developerTitle": "Habilitar modo de Desarrollador: ",
"admin.service.false": "falso",
@@ -335,6 +303,8 @@
"admin.service.googleTitle": "Llave de desarrolador Google:",
"admin.service.iconDescription": "Cuando es verdadero, se le permitirá cambiar el icono del mensaje desde webhooks. Nota, en combinación con permitir el cambio de nombre de usuario, podría exponer a los usuarios a sufrir ataques de phishing.",
"admin.service.iconTitle": "Habilitar el cambio de icono desde los Webhooks: ",
+ "admin.service.integrationAdmin": "Habilitar Integraciones sólo para administradores: ",
+ "admin.service.integrationAdminDesc": "Cuando es verdadero, las integraciones creadas por usuarios solo pueden ser creadas por administradores.",
"admin.service.listenAddress": "Dirección de escucha:",
"admin.service.listenDescription": "La dirección a la que se unirá y escuchará. Ingresar \":8065\" se podrá unir a todas las interfaces o podrá seleccionar una como ej: \"127.0.0.1:8065\". Cambiando este valor es necesario reiniciar el servidor.",
"admin.service.listenExample": "Ej \":8065\"",
@@ -365,6 +335,7 @@
"admin.service.webhooksDescription": "Cuando es verdadero, la entradas de webhooks será permitida. Para ayudar a combatir ataques phishing, todos los comentarios de webhooks serán marcados con una etiqueta BOT.",
"admin.service.webhooksTitle": "Habilitar Webhooks de Entrada: ",
"admin.sidebar.addTeamSidebar": "Agregar un equipo el menú lateral",
+ "admin.sidebar.audits": "Auditorías",
"admin.sidebar.email": "Configuración de correo",
"admin.sidebar.file": "Configuracion de archivos",
"admin.sidebar.gitlab": "Configuración de GitLab",
@@ -469,11 +440,61 @@
"admin.user_item.resetPwd": "Reiniciar Contraseña",
"admin.user_item.sysAdmin": "Admin de Sistema",
"admin.user_item.teamAdmin": "Admin de Equipo",
+ "audit_table.accountActive": "Cuentas activadas",
+ "audit_table.accountInactive": "Cuentas desactivadas",
+ "audit_table.action": "Acción",
+ "audit_table.attemptedAllowOAuthAccess": "Intento de permitir acceso a un nuevo servicio OAuth",
+ "audit_table.attemptedLogin": "Intento de inicio de sesión",
+ "audit_table.attemptedOAuthToken": "Intento de obtener un token de acceso con OAuth",
+ "audit_table.attemptedPassword": "Intento de cambio de contraseña",
+ "audit_table.attemptedRegisterApp": "Intento de registrar una nueva aplicación OAuth con ID {id}",
+ "audit_table.attemptedReset": "Intento de restablecer contraseña",
+ "audit_table.attemptedWebhookCreate": "Intento de crear un webhook",
+ "audit_table.attemptedWebhookDelete": "Intento de eliminar un webhook",
+ "audit_table.by": " por {username}",
+ "audit_table.byAdmin": " por un admin",
+ "audit_table.channelCreated": "Creado el canal/grupo {channelName}",
+ "audit_table.channelDeleted": "Borrado el canal/grupo con el URL {url}",
+ "audit_table.establishedDM": "Establecido un canal de mensajes directos con {username}",
+ "audit_table.failedLogin": "intento de inicio de sesión FALLIDO",
+ "audit_table.failedOAuthAccess": "Falla al permitir acceso al nuevo servicio de OAuth - El URI de redirección no coincide con el previamente registrado",
+ "audit_table.failedPassword": "Falla al cambiar la contraseña - intento de actualizar la contraseña del usuario que está autenticado a través de oauth",
+ "audit_table.failedWebhookCreate": "Falla al crear un webhook - no tiene permisos en el canal",
+ "audit_table.failedWebhookDelete": "Falla al borrar un webhook - condiciones inapropiadas",
+ "audit_table.headerUpdated": "Actualizado el encabezado del canal/grupo {channelName}",
+ "audit_table.ip": "IP: {ip}",
+ "audit_table.loginAttempt": " (intento de inicio de sesión)",
+ "audit_table.loginFailure": " (inicio de sesión fallido)",
+ "audit_table.logout": "Cerrada la sesión de tu cuenta",
+ "audit_table.member": "miembro",
+ "audit_table.nameUpdated": "Actualizado el nombre del canal/grupo {channelName}",
+ "audit_table.oauthTokenFailed": "Falla al obtener un token de acceso de OAuth - {token}",
+ "audit_table.revokedAll": "Revocadas todas las sesiones actuales del equipo",
+ "audit_table.sentEmail": "Correo electrónico enviado a {email} para restablecer tu contraseña",
+ "audit_table.session": "ID de Sesión: {id}",
+ "audit_table.sessionRevoked": "La sesión con id {sessionId} fue revocada",
+ "audit_table.successfullLogin": "Inicio de sesión satisfactorio",
+ "audit_table.successfullOAuthAccess": "Se entrego acceso al nuevo servicio de OAuth satisfactoriamente",
+ "audit_table.successfullOAuthToken": "Se agregó el nuevo servicio de OAuth satisfactoriamente",
+ "audit_table.successfullPassword": "Cambio de contraseña satisfactorio",
+ "audit_table.successfullReset": "Contraseña restablecida satisfactoriamente",
+ "audit_table.successfullWebhookCreate": "Creado un webhook satisfactoriamente",
+ "audit_table.successfullWebhookDelete": "Borrado un webhook satisfactoriamente",
+ "audit_table.timestamp": "Marca de tiempo",
+ "audit_table.updateGeneral": "Actulizada la configuración general de tu cuenta",
+ "audit_table.updateGlobalNotifications": "Actualizada la configuración global de tus notificaciones",
+ "audit_table.updatePicture": "Actualizada tu imagen de perfil",
+ "audit_table.updatedRol": "Rol(es) de usuario actualizado(s) a ",
+ "audit_table.userAdded": "Agregado {username} al canal/grupo {channelName}",
+ "audit_table.userId": "ID de Usuario",
+ "audit_table.userRemoved": "Removido {username} del canal/grupo {channelName}",
+ "audit_table.verified": "Verificada la dirección de correo electrónico satisfacoriamente",
"authorize.access": "¿Permitir acceso a {appName}?",
"authorize.allow": "Permitir",
"authorize.app": "La app {appName} quiere tener la abilidad de accesar y modificar tu información básica.",
"authorize.deny": "Denegar",
"authorize.title": "Una aplicación quiere conectarse con tu cuenta de {teamName}",
+ "center_panel.recent": "Pincha aquí para ir a los mensajes más recientes. ",
"chanel_header.addMembers": "Agregar Miembros",
"change_url.close": "Cerrar",
"change_url.endWithLetter": "Debe terminar con una letra o número",
@@ -490,14 +511,14 @@
"channel_flow.invalidName": "Nombre de Canal Inválido",
"channel_flow.set_url_title": "Asignar URL de {term}",
"channel_header.channel": "Canal",
- "channel_header.channelHeader": "Encabezado del Canal...",
- "channel_header.delete": "Eliminar {term}...",
+ "channel_header.channelHeader": "Asignar Encabezado del Canal...",
+ "channel_header.delete": "Borrar {term}...",
"channel_header.group": "Grupo",
- "channel_header.leave": "Abondanar {term}",
+ "channel_header.leave": "Abandonar ",
"channel_header.manageMembers": "Administrar Miembros",
"channel_header.notificationPreferences": "Preferencias de Notificación",
"channel_header.recentMentions": "Menciones recientes",
- "channel_header.rename": "Renombrar {term}...",
+ "channel_header.rename": "Renombrar ",
"channel_header.setHeader": "Encabezado del {term}...",
"channel_header.setPurpose": "Propósito del {term}...",
"channel_header.viewInfo": "Ver Info",
@@ -509,6 +530,13 @@
"channel_info.url": "URL del Canal:",
"channel_invite.addNewMembers": "Agregar nuevos Miembros a ",
"channel_invite.close": "Cerrar",
+ "channel_loader.posted": "Publicó",
+ "channel_loader.socketError": "No se puede conectar con Mattermost, por favor revise su conexión. Si el problema persiste, solicite a un administrador que revise el puerto del WebSocket.",
+ "channel_loader.someone": "Alguien",
+ "channel_loader.something": " hizo algo nuevo",
+ "channel_loader.uploadedFile": " subió un archivo",
+ "channel_loader.uploadedImage": " subió una imagen",
+ "channel_loader.wrote": " escribió: ",
"channel_members_modal.addNew": " Agregar nuevos Miembros",
"channel_members_modal.close": "Cerrar",
"channel_memebers_modal.members": " Miembros",
@@ -530,12 +558,12 @@
"channel_modal.purpose": "Propósito",
"channel_notifications.allActivity": "Para toda actividad",
"channel_notifications.allUnread": "Para todos los mensajes sin leer",
- "channel_notifications.globalDefault": "Predeterminado global ({notifyLevel})",
+ "channel_notifications.globalDefault": "Predeterminada",
"channel_notifications.markUnread": "Marcar Canal como No Leido",
"channel_notifications.never": "Nunca",
"channel_notifications.onlyMentions": "Sólo para menciones",
"channel_notifications.override": "Seleccionar una opción diferente a \"Predeterminada\" anulará las configuraciones globales de notificación. Las notificaciones de Escritorio están disponibles para Firefox, Safari, y Chrome.",
- "channel_notifications.preferences": "Preferencias de Notificación de ",
+ "channel_notifications.preferences": "Preferencias de Notificación para ",
"channel_notifications.sendDesktop": "Enviar notificaciones de escritorio",
"channel_notifications.unreadInfo": "El nombre del canal está en negritas en la barra lateral cuando hay mensajes sin leer. Al elegir \"Sólo para menciones\" sólo lo dejará en negritas cuando seas mencionado.",
"choose_auth_page.emailCreate": "Crea un nuevo equipo con tu cuenta de correo",
@@ -548,8 +576,8 @@
"claim.email_to_sso.pwd": "Contraseña",
"claim.email_to_sso.pwdError": "Por favor introduce tu contraseña.",
"claim.email_to_sso.ssoType": "Al reclamar tu cuenta, sólo podrás iniciar sesión con {type} SSO",
- "claim.email_to_sso.switchTo": "Cambiar cuenta a ",
- "claim.email_to_sso.title": "Cambiar Cuenta de Correo/Contraseña a ",
+ "claim.email_to_sso.switchTo": "Cambiar cuenta a {uiType}",
+ "claim.email_to_sso.title": "Cambiar Cuenta de Correo/Contraseña a {uiType}",
"claim.sso_to_email.confirm": "Confirmar Contraseña",
"claim.sso_to_email.description": "Al cambiar el tipo de cuenta, sólo podrás iniciar sesión con tu correo electrónico y contraseña.",
"claim.sso_to_email.enterPwd": "Por favor ingresa una contraseña.",
@@ -565,18 +593,22 @@
"create_comment.commentTitle": "Comentario",
"create_comment.file": "Subiendo archivo",
"create_comment.files": "Subiendo archivos",
+ "create_post.comment": "Comentario",
+ "create_post.post": "Mensaje",
+ "create_post.tutorialTip": "<h4>Enviar Mensajes</h4> <p>Escribe aquí para redactar un mensaje y presiona <strong>Retorno</strong> para enviarlo.</p><p>Pincha el botón de <strong>Adjuntar</strong> para subir una imagen o archivo.</p>",
+ "create_post.write": "Escribe un mensaje...",
"delete_channel.cancel": "Cancelar",
"delete_channel.channel": "canal",
- "delete_channel.confirm": "Confirmar la ELIMINACIÓN del Canal",
- "delete_channel.del": "Eliminar",
+ "delete_channel.confirm": "Confirmar BORRAR Canal",
+ "delete_channel.del": "Borrar",
"delete_channel.group": "grupo",
- "delete_channel.question": "¿Estás seguro de querer eliminar el {term} {display_name}?",
+ "delete_channel.question": "¿Estás seguro de querer borrar el ",
"delete_post.cancel": "Cancelar",
"delete_post.comment": "Comentario",
"delete_post.confirm": "Confirmar Eliminación del {term}",
- "delete_post.del": "Eliminar",
+ "delete_post.del": "Borrar",
"delete_post.post": "Mensaje",
- "delete_post.question": "¿Estás seguro(a) de querer eliminar este {term}?",
+ "delete_post.question": "¿Estás seguro(a) de querer borrar este {term}?",
"delete_post.warning": "Este mensaje tiene {count} comentario(s).",
"edit_channel_header_modal.cancel": "Cancelar",
"edit_channel_header_modal.description": "Edita el texto que aparece al lado del nombre del canal en el encabezado del canal.",
@@ -606,6 +638,9 @@
"email_verify.verified": "{siteName} Correo electrónico verificado",
"email_verify.verifiedBody": "<p>Tu correo electrónico ha sido verificado!! Pincha <a href={url}>aquí</a> para iniciar sesión.</p>",
"error_bar.preview_mode": "Modo de prueba: Las notificaciones por correo electrónico no han sido configuradas",
+ "file_attachment.download": "Descargar",
+ "file_info_preview.size": "Tamaño ",
+ "file_info_preview.type": "Tipo de archivo ",
"file_upload.fileAbove": "No se puede subir un archivo que pesa más de {max}MB: {filename}",
"file_upload.filesAbove": "No se pueden subir archivos de más de {max}MB: {filenames}",
"file_upload.limited": "Se pueden subir un máximo de {count} archivos. Por favor envía otros mensajes para adjuntar más archivos.",
@@ -639,7 +674,22 @@
"get_link.close": "Cerrar",
"get_link.copy": "Copiar Enlace",
"get_team_invite_link_modal.help": "Enviar a los compañeros de equipo el enlace que se muestra a continuación para permitirles registrarse a este equipo.",
+ "get_team_invite_link_modal.helpDisabled": "La creación de usuario ha sido deshabilitada para tu equipo. Por favor solicita más detalles a tu administrador de equipo.",
"get_team_invite_link_modal.title": "Enlace de Invitación al Equipo",
+ "intro_messages.DM": "Este es el inicio de tu historial de mensajes directos con {teammate}.<br />Los mensajes directos y archivos que se comparten aquí no son mostrados a personas fuera de esta área.",
+ "intro_messages.anyMember": " Cualquier miembro se puede unir y leer este canal.",
+ "intro_messages.beginning": "Inicio de {name}",
+ "intro_messages.channel": "canal",
+ "intro_messages.creator": "Este es el inicio del {type} <strong>{name}</strong>, creado por <strong>{creator}</strong> el <strong>{date}</strong>",
+ "intro_messages.default": "<h4 class='channel-intro__title'>Inicio de {display_name}</h4><p class='channel-intro__content'><strong>¡Bienvenido a {display_name}!</strong><br/><br/>Este es el primer canal que ven tus compañeros cuando se registran - utilizalo para colocar mensajes que todos deberían leer.</p>",
+ "intro_messages.group": "grupo privado",
+ "intro_messages.invite": "Invita a otros a este {type}",
+ "intro_messages.inviteOthers": "Invita a otros a este equipo",
+ "intro_messages.noCreator": "Este es el inicio del {type} {name}, creado el {date}.",
+ "intro_messages.offTopic": "<h4 class=\"channel-intro__title\">Inicio de {display_name}</h4><p class=\"channel-intro__content\">Este es el inicio de {display_name}, un canal para tener conversaciones no relacionadas trabajo.<br/></p>",
+ "intro_messages.onlyInvited": " Sólo miembros invitados pueden ver este grupo privado.",
+ "intro_messages.setHeader": "Asignar un Encabezado",
+ "intro_messages.teammate": "Este es el inicio de tu historial de mensajes directos con este compañero. Los mensajes directos y archivos que se comparten aquí no son mostrados a personas fuera de esta área.",
"invite_member.addAnother": "Agregar otro",
"invite_member.autoJoin": "Las personas invitadas se unirán automáticamente al canal <strong>{channel}</strong>.",
"invite_member.cancel": "Cancelar",
@@ -656,7 +706,6 @@
"invite_member.send": "Enviar Invitaciones",
"invite_member.send2": "Enviar Invitaciones",
"invite_member.sending": " Enviando",
- "invite_member.teamInvite": "Invitación de Equipo",
"invite_member.teamInviteLink": "También puedes invitar personas usando el {link}.",
"loading_screen.loading": "Cargando",
"login.changed": " Cambiado el método de inicio de sesión satisfactoriamente",
@@ -683,6 +732,14 @@
"login_ldap.pwdReq": "La contraseña LDAP es obligatoria",
"login_ldap.signin": "Entrar",
"login_ldap.username": "Usuario LDAP",
+ "login_username.badTeam": "Mal nombre de equipo",
+ "login_username.pwd": "Contraseña",
+ "login_username.pwdReq": "La contraseña es obligatoria",
+ "login_username.signin": "Ingresar",
+ "login_username.userNotFoundError": "No encontramos una cuenta existente que coincida con tu nombre de usuario en este equipo.",
+ "login_username.username": "Nombre de usuario",
+ "login_username.usernameReq": "El nombre de usuario es obligatorio",
+ "login_username.verifyEmailError": "Por favor válida tu dirección de correo electrónico. Te hemos enviado un correo, revisa tu bandeja de entrada.",
"member_item.add": " Agregar",
"member_item.makeAdmin": "Convertir en Admin de Equipo",
"member_item.member": "Miembro",
@@ -714,6 +771,19 @@
"msg_typing.areTyping": "{users} y {last} están escribiendo...",
"msg_typing.isTyping": "{user} está escribiendo...",
"msg_typing.someone": "Alguien",
+ "navbar.addMembers": "Agregar Miembros",
+ "navbar.click": "Pincha aquí",
+ "navbar.delete": "Borrar Canal...",
+ "navbar.leave": "Abandonar Canal",
+ "navbar.manageMembers": "Administrar Miembros",
+ "navbar.noHeader": "Todavía no hay un encabezado.{newline}{link} para agregar uno.",
+ "navbar.preferences": "Preferencias de Notificación",
+ "navbar.rename": "Renombrar Canal...",
+ "navbar.setHeader": "Asignar Encabezado del Canal...",
+ "navbar.setPurpose": "Asignar Propósito del Canal...",
+ "navbar.toggle1": "Mostrar Barra",
+ "navbar.toggle2": "Esconder Barra",
+ "navbar.viewInfo": "Ver Info",
"navbar_dropdown.about": "Acerca de Mattermost",
"navbar_dropdown.accountSettings": "Configurar Cuenta",
"navbar_dropdown.console": "Consola de Sistema",
@@ -740,9 +810,24 @@
"password_send.link": "<p>Se ha enviado un enlace para restablecer la contraseña a <b>{email}</b> para tu equipo <b>{teamDisplayName}</b> en {hostname}.</p>",
"password_send.reset": "Restablecer mi contraseña",
"password_send.title": "Restablecer Contraseña",
+ "post_attachment.collapse": "▲ colapsar texto",
+ "post_attachment.more": "▼ leer más",
+ "post_body.commentedOn": "Comentó el mensaje de {name}{apostrophe}: ",
+ "post_body.deleted": "(mensaje eliminado)",
+ "post_body.plusMore": " más {count} otros archivos",
+ "post_body.plusOne": " más 1 archivo",
+ "post_body.retry": "Reintentar",
"post_delete.notPosted": "No se pudo enviar el comentario",
"post_delete.okay": "Ok",
"post_delete.someone": "Alguien borró el mensaje que querías comentar.",
+ "post_focus_view.beginning": "Inicio de los Archivos del Canal",
+ "post_info.copy": "Copiar ",
+ "post_info.del": "Borrar",
+ "post_info.edit": "Editar",
+ "post_info.permalink": "Enlace permanente",
+ "post_info.reply": "Responder",
+ "posts_view.loadMore": "Cargar más mensajes",
+ "posts_view.newMsg": "Nuevos Mensajes",
"register_app.callback": "Callback URL",
"register_app.callbackError": "Al menos un callback URL debe ser ingresado.",
"register_app.cancel": "Cancelar",
@@ -818,8 +903,8 @@
"sidebar.tutorialScreen1": "<h4>Canales</h4><p><strong>Canales</strong> organizan las conversaciones en diferentes tópicos. Son abiertos para cualquier persona de tu equipo. Para enviar comunicaciones privadas con una sola persona utiliza <strong>Mensajes Directos</strong> o con multiples personas utilizando <strong>Grupos Privados</strong>.</p>",
"sidebar.tutorialScreen2": "<h4>Canal \"General\"</h4><p>Este es un canal para comenzar:</p><p><strong>General</strong> es el lugar para tener comunicación con todo el equipo. Todos los integrantes de tu equipo son miembros de este canal.</p>",
"sidebar.tutorialScreen3": "<h4>Creando y Uniendose a Canales</h4><p>Pincha en <strong>\"Más...\"</strong> para crear un nuevo canal o unirte a uno existente.</p><p>También puedes crear un nuevo canal o grupo privado al pinchar el simbolo de <strong>\"+\"</strong> que se encuentra al lado del encabezado de Canales o Grupos Privados.</p>",
- "sidebar.unreadAbove": "Mensaje(s) sin leer arriba",
- "sidebar.unreadBelow": "Mensaje(s) sin leer abajo",
+ "sidebar.unreadAbove": "Mensaje(s) sin leer ▲",
+ "sidebar.unreadBelow": "Mensaje(s) sin leer ▼",
"sidebar_header.tutorial": "<h4>Menú Principal</h4><p>El <strong>Menú Principal</strong> es donde puedes <strong>Invitar a nuevos miembros</strong>, podrás <strong>Configurar tu Cuenta</strong> y seleccionar un <strong>Tema</strong> para personalizar la apariencia.</p><p>Los administradores del Equipo podrán <strong>Configurar el Equipo</strong> desde este menú.</p><p>Los administradores del Sistema encontrarán una opción para ir a la <strong>Consola de Sistema</strong> para administrar el sistema completo.</p>",
"sidebar_right_menu.accountSettings": "Configurar tu Cuenta",
"sidebar_right_menu.console": "Consola del Sistema",
@@ -841,6 +926,7 @@
"signup_user_completed.choosePwd": "Escoge tu contraseña",
"signup_user_completed.chooseUser": "Escoge tu nombre de usuario",
"signup_user_completed.create": "Crea una Cuenta",
+ "signup_user_completed.emailHelp": "Para registrarte es necesario un correo electrónico válido",
"signup_user_completed.emailIs": "Tu dirección de correo electrónico es <strong>{email}</strong>. Utiliza está dirección para ingresar a {siteName}.",
"signup_user_completed.expired": "Ya haz completado el proceso de registro para esta invitación, o esta invitación ya ha expirado.",
"signup_user_completed.gitlab": "con GitLab",
@@ -977,6 +1063,41 @@
"user.settings.appearance.save": "Guardar",
"user.settings.appearance.themeColors": "Selecciona un Tema",
"user.settings.appearance.title": "Configuraciones de Apariencia",
+ "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_desc_desc": "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",
@@ -1074,6 +1195,8 @@
"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",
@@ -1111,6 +1234,7 @@
"user.settings.notifications.sensitiveName": "Tu nombre con distinción de mayúsculas \"{first_name}\"",
"user.settings.notifications.sensitiveUsername": "Tu nombre de usuario sin distinción de mayúsculas \"{username}\"",
"user.settings.notifications.sensitiveWords": "Otras palabras sin distinción de mayúsculas, separadas por comas:",
+ "user.settings.notifications.sounds_info": "Las notificaciones de escritorio con sonidos están disponibles en Firefox, Safari, Chrome, Internet Explorer, y Edge.",
"user.settings.notifications.teamWide": "Menciones para todo el equipo \"@all\"",
"user.settings.notifications.title": "Configuracón de Notificaciones",
"user.settings.notifications.usernameMention": "Tu nombre de usuario mencionado \"@{username}\"",
@@ -1134,5 +1258,9 @@
"user.settings.security.switchGoogle": "Cambiar para utilizar Google SSO",
"user.settings.security.title": "Configuración de Seguridad",
"user.settings.security.viewHistory": "Visualizar historial de acceso",
- "user_profile.notShared": "Correo no compartido"
-}
+ "user_profile.notShared": "Correo no compartido",
+ "view_image.loading": "Cargando ",
+ "view_image_popover.download": "Descargar",
+ "view_image_popover.file": "Archivo {count} de {total}",
+ "view_image_popover.publicLink": "Obtener Enlace Público"
+} \ No newline at end of file
diff --git a/web/web_test.go b/web/web_test.go
index cc7d22559..7617ae54a 100644
--- a/web/web_test.go
+++ b/web/web_test.go
@@ -194,6 +194,10 @@ func TestIncomingWebhook(t *testing.T) {
user = ApiClient.Must(ApiClient.CreateUser(user, "")).Data.(*model.User)
store.Must(api.Srv.Store.User().VerifyEmail(user.Id))
+ c := &api.Context{}
+ c.RequestId = model.NewId()
+ c.IpAddress = "cmd_line"
+ api.UpdateRoles(c, user, model.ROLE_SYSTEM_ADMIN)
ApiClient.LoginByEmail(team.Name, user.Email, "pwd")
channel1 := &model.Channel{DisplayName: "Test API Name", Name: "a" + model.NewId() + "a", Type: model.CHANNEL_OPEN, TeamId: team.Id}