summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
Diffstat (limited to 'webapp')
-rw-r--r--webapp/action_creators/global_actions.jsx9
-rw-r--r--webapp/action_creators/websocket_actions.jsx19
-rw-r--r--webapp/components/claim/components/email_to_ldap.jsx14
-rw-r--r--webapp/components/login.jsx12
-rw-r--r--webapp/components/root.jsx2
-rw-r--r--webapp/components/signup_team_complete/components/signup_team_complete.jsx4
-rw-r--r--webapp/components/signup_user_complete.jsx12
-rw-r--r--webapp/components/suggestion/search_suggestion_list.jsx1
-rw-r--r--webapp/components/team_signup_with_sso.jsx2
-rw-r--r--webapp/components/user_settings/user_settings_modal.jsx14
-rw-r--r--webapp/components/user_settings/user_settings_security.jsx1
-rw-r--r--webapp/components/user_settings/user_settings_theme.jsx13
-rw-r--r--webapp/i18n/pt.json38
-rw-r--r--webapp/root.jsx2
-rw-r--r--webapp/stores/notification_store.jsx (renamed from webapp/stores/notificaiton_store.jsx)0
15 files changed, 86 insertions, 57 deletions
diff --git a/webapp/action_creators/global_actions.jsx b/webapp/action_creators/global_actions.jsx
index ab38532a6..7322f1150 100644
--- a/webapp/action_creators/global_actions.jsx
+++ b/webapp/action_creators/global_actions.jsx
@@ -264,6 +264,15 @@ export function newLocalizationSelected(locale) {
}
}
+export function loadBrowserLocale() {
+ let locale = (navigator.languages && navigator.languages.length > 0 ? navigator.languages[0] :
+ (navigator.language || navigator.userLanguage)).split('-')[0];
+ if (!I18n.getLanguages()[locale]) {
+ locale = 'en';
+ }
+ return newLocalizationSelected(locale);
+}
+
export function viewLoggedIn() {
AsyncClient.getChannels();
AsyncClient.getChannelExtraInfo();
diff --git a/webapp/action_creators/websocket_actions.jsx b/webapp/action_creators/websocket_actions.jsx
index 611d53bf7..bb46db149 100644
--- a/webapp/action_creators/websocket_actions.jsx
+++ b/webapp/action_creators/websocket_actions.jsx
@@ -7,6 +7,7 @@ import PostStore from 'stores/post_store.jsx';
import ChannelStore from 'stores/channel_store.jsx';
import BrowserStore from 'stores/browser_store.jsx';
import ErrorStore from 'stores/error_store.jsx';
+import NotificationStore from 'stores/notification_store.jsx'; //eslint-disable-line no-unused-vars
import * as Utils from 'utils/utils.jsx';
import * as AsyncClient from 'utils/async_client.jsx';
@@ -21,6 +22,7 @@ const WEBSOCKET_RETRY_TIME = 3000;
var conn = null;
var connectFailCount = 0;
var pastFirstInit = false;
+var manuallyClosed = false;
export function initialize() {
if (window.WebSocket && !conn) {
@@ -35,6 +37,8 @@ export function initialize() {
console.log('websocket connecting to ' + connUrl); //eslint-disable-line no-console
}
+ manuallyClosed = false;
+
conn = new WebSocket(connUrl);
conn.onopen = () => {
@@ -69,12 +73,14 @@ export function initialize() {
ErrorStore.setConnectionErrorCount(connectFailCount);
ErrorStore.emitChange();
- setTimeout(
- () => {
- initialize();
- },
- WEBSOCKET_RETRY_TIME
- );
+ if (!manuallyClosed) {
+ setTimeout(
+ () => {
+ initialize();
+ },
+ WEBSOCKET_RETRY_TIME
+ );
+ }
};
conn.onerror = (evt) => {
@@ -147,6 +153,7 @@ export function sendMessage(msg) {
}
export function close() {
+ manuallyClosed = true;
if (conn && conn.readyState === WebSocket.OPEN) {
conn.close();
}
diff --git a/webapp/components/claim/components/email_to_ldap.jsx b/webapp/components/claim/components/email_to_ldap.jsx
index 1f51f9cd5..1ceb42a27 100644
--- a/webapp/components/claim/components/email_to_ldap.jsx
+++ b/webapp/components/claim/components/email_to_ldap.jsx
@@ -21,7 +21,7 @@ export default class EmailToLDAP extends React.Component {
e.preventDefault();
var state = {};
- const password = ReactDOM.findDOMNode(this.refs.password).value.trim();
+ const password = ReactDOM.findDOMNode(this.refs.emailpassword).value.trim();
if (!password) {
state.error = Utils.localizeMessage('claim.email_to_ldap.pwdError', 'Please enter your password.');
this.setState(state);
@@ -105,12 +105,18 @@ export default class EmailToLDAP extends React.Component {
}}
/>
</p>
+ <input
+ type='text'
+ style={{display: 'none'}}
+ name='fakeusernameremembered'
+ />
<div className={formClass}>
<input
type='password'
className='form-control'
- name='password'
- ref='password'
+ name='emailPassword'
+ ref='emailpassword'
+ autoComplete='off'
placeholder={Utils.localizeMessage('claim.email_to_ldap.pwd', 'Password')}
spellCheck='false'
/>
@@ -131,6 +137,7 @@ export default class EmailToLDAP extends React.Component {
className='form-control'
name='ldapId'
ref='ldapid'
+ autoComplete='off'
placeholder={Utils.localizeMessage('claim.email_to_ldap.ldapId', 'LDAP ID')}
spellCheck='false'
/>
@@ -141,6 +148,7 @@ export default class EmailToLDAP extends React.Component {
className='form-control'
name='ldapPassword'
ref='ldappassword'
+ autoComplete='off'
placeholder={Utils.localizeMessage('claim.email_to_ldap.ldapPwd', 'LDAP Password')}
spellCheck='false'
/>
diff --git a/webapp/components/login.jsx b/webapp/components/login.jsx
index e8180895d..ff9cd74a8 100644
--- a/webapp/components/login.jsx
+++ b/webapp/components/login.jsx
@@ -60,10 +60,10 @@ export default class Login extends React.Component {
let loginMessage = [];
if (global.window.mm_config.EnableSignUpWithGitLab === 'true') {
loginMessage.push(
- <Link
+ <a
className='btn btn-custom-login gitlab'
key='gitlab'
- to={'/api/v1/oauth/gitlab/login?team=' + encodeURIComponent(teamName)}
+ href={'/api/v1/oauth/gitlab/login?team=' + encodeURIComponent(teamName)}
>
<span className='icon'/>
<span>
@@ -72,16 +72,16 @@ export default class Login extends React.Component {
defaultMessage='with GitLab'
/>
</span>
- </Link>
+ </a>
);
}
if (global.window.mm_config.EnableSignUpWithGoogle === 'true') {
loginMessage.push(
- <Link
+ <a
className='btn btn-custom-login google'
key='google'
- to={'/api/v1/oauth/google/login?team=' + encodeURIComponent(teamName)}
+ href={'/api/v1/oauth/google/login?team=' + encodeURIComponent(teamName)}
>
<span className='icon'/>
<span>
@@ -90,7 +90,7 @@ export default class Login extends React.Component {
defaultMessage='with Google Apps'
/>
</span>
- </Link>
+ </a>
);
}
diff --git a/webapp/components/root.jsx b/webapp/components/root.jsx
index 9963bc5dd..3b85b23fd 100644
--- a/webapp/components/root.jsx
+++ b/webapp/components/root.jsx
@@ -69,7 +69,7 @@ export default class Root extends React.Component {
FastClick.attach(document.body);
// Get our localizaiton
- GlobalActions.newLocalizationSelected('en');
+ GlobalActions.loadBrowserLocale();
}
componentWillUnmount() {
LocalizationStore.removeChangeListener(this.localizationChanged);
diff --git a/webapp/components/signup_team_complete/components/signup_team_complete.jsx b/webapp/components/signup_team_complete/components/signup_team_complete.jsx
index 8b2096499..e5d310151 100644
--- a/webapp/components/signup_team_complete/components/signup_team_complete.jsx
+++ b/webapp/components/signup_team_complete/components/signup_team_complete.jsx
@@ -8,7 +8,7 @@ import {FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
import React from 'react';
-import Link from 'react-router';
+import {Link} from 'react-router';
export default class SignupTeamComplete extends React.Component {
constructor(props) {
@@ -55,7 +55,7 @@ export default class SignupTeamComplete extends React.Component {
<div>
<div className='signup-header'>
<Link to='/'>
- <span classNameName='fa fa-chevron-left'/>
+ <span className='fa fa-chevron-left'/>
<FormattedMessage id='web.header.back'/>
</Link>
</div>
diff --git a/webapp/components/signup_user_complete.jsx b/webapp/components/signup_user_complete.jsx
index 5460daf29..78ab1bd8c 100644
--- a/webapp/components/signup_user_complete.jsx
+++ b/webapp/components/signup_user_complete.jsx
@@ -317,10 +317,10 @@ class SignupUserComplete extends React.Component {
var signupMessage = [];
if (global.window.mm_config.EnableSignUpWithGitLab === 'true') {
signupMessage.push(
- <Link
+ <a
className='btn btn-custom-login gitlab'
key='gitlab'
- to={'/api/v1/oauth/gitlab/signup' + window.location.search + '&team=' + encodeURIComponent(this.state.teamName)}
+ href={'/api/v1/oauth/gitlab/signup' + window.location.search + '&team=' + encodeURIComponent(this.state.teamName)}
>
<span className='icon'/>
<span>
@@ -329,16 +329,16 @@ class SignupUserComplete extends React.Component {
defaultMessage='with GitLab'
/>
</span>
- </Link>
+ </a>
);
}
if (global.window.mm_config.EnableSignUpWithGoogle === 'true') {
signupMessage.push(
- <Link
+ <a
className='btn btn-custom-login google'
key='google'
- to={'/api/v1/oauth/google/signup' + window.location.search + '&team=' + encodeURIComponent(this.state.teamName)}
+ href={'/api/v1/oauth/google/signup' + window.location.search + '&team=' + encodeURIComponent(this.state.teamName)}
>
<span className='icon'/>
<span>
@@ -347,7 +347,7 @@ class SignupUserComplete extends React.Component {
defaultMessage='with Google'
/>
</span>
- </Link>
+ </a>
);
}
diff --git a/webapp/components/suggestion/search_suggestion_list.jsx b/webapp/components/suggestion/search_suggestion_list.jsx
index b15cc4243..57aaee8ff 100644
--- a/webapp/components/suggestion/search_suggestion_list.jsx
+++ b/webapp/components/suggestion/search_suggestion_list.jsx
@@ -2,6 +2,7 @@
// See License.txt for license information.
import $ from 'jquery';
+import React from 'react';
import ReactDOM from 'react-dom';
import Constants from 'utils/constants.jsx';
import SuggestionList from './suggestion_list.jsx';
diff --git a/webapp/components/team_signup_with_sso.jsx b/webapp/components/team_signup_with_sso.jsx
index 9a46b2d6b..78396eea8 100644
--- a/webapp/components/team_signup_with_sso.jsx
+++ b/webapp/components/team_signup_with_sso.jsx
@@ -64,7 +64,7 @@ class SSOSignUpPage extends React.Component {
this.props.service,
(data) => {
if (data.follow_link) {
- browserHistory.push(data.follow_link);
+ window.location.href = data.follow_link;
} else {
browserHistory.push('/' + team.name + '/channels/town-square');
}
diff --git a/webapp/components/user_settings/user_settings_modal.jsx b/webapp/components/user_settings/user_settings_modal.jsx
index d1c1f0fe2..b71547baf 100644
--- a/webapp/components/user_settings/user_settings_modal.jsx
+++ b/webapp/components/user_settings/user_settings_modal.jsx
@@ -9,7 +9,6 @@ import SettingsSidebar from '../settings_sidebar.jsx';
import UserStore from 'stores/user_store.jsx';
import * as Utils from 'utils/utils.jsx';
-import Constants from 'utils/constants.jsx';
import {Modal} from 'react-bootstrap';
@@ -113,7 +112,6 @@ class UserSettingsModal extends React.Component {
return;
}
- this.resetTheme();
this.deactivateTab();
this.props.onModalDismissed();
return;
@@ -220,22 +218,10 @@ class UserSettingsModal extends React.Component {
if (!skipConfirm && this.requireConfirm) {
this.showConfirmModal(() => this.updateSection(section, true));
} else {
- if (this.state.active_section === 'theme' && section !== 'theme') {
- this.resetTheme();
- }
this.setState({active_section: section});
}
}
- resetTheme() {
- const user = UserStore.getCurrentUser();
- if (user.theme_props == null) {
- Utils.applyTheme(Constants.THEMES.default);
- } else {
- Utils.applyTheme(user.theme_props);
- }
- }
-
render() {
const {formatMessage} = this.props.intl;
if (this.state.currentUser == null) {
diff --git a/webapp/components/user_settings/user_settings_security.jsx b/webapp/components/user_settings/user_settings_security.jsx
index 283d2c425..f937844ec 100644
--- a/webapp/components/user_settings/user_settings_security.jsx
+++ b/webapp/components/user_settings/user_settings_security.jsx
@@ -416,6 +416,7 @@ class SecurityTab extends React.Component {
let numMethods = 0;
numMethods = global.window.mm_config.EnableSignUpWithGitLab === 'true' ? numMethods + 1 : numMethods;
numMethods = global.window.mm_config.EnableSignUpWithGoogle === 'true' ? numMethods + 1 : numMethods;
+ numMethods = global.window.mm_config.EnableLdap === 'true' ? numMethods + 1 : numMethods;
if (global.window.mm_config.EnableSignUpWithEmail && numMethods > 0) {
signInSection = this.createSignInSection();
diff --git a/webapp/components/user_settings/user_settings_theme.jsx b/webapp/components/user_settings/user_settings_theme.jsx
index 3414fe2e2..14991037d 100644
--- a/webapp/components/user_settings/user_settings_theme.jsx
+++ b/webapp/components/user_settings/user_settings_theme.jsx
@@ -40,7 +40,6 @@ export default class ThemeSetting extends React.Component {
this.onChange = this.onChange.bind(this);
this.submitTheme = this.submitTheme.bind(this);
this.updateTheme = this.updateTheme.bind(this);
- this.deactivate = this.deactivate.bind(this);
this.resetFields = this.resetFields.bind(this);
this.handleImportModal = this.handleImportModal.bind(this);
@@ -62,12 +61,17 @@ export default class ThemeSetting extends React.Component {
}
}
componentWillReceiveProps(nextProps) {
- if (!this.props.selected && nextProps.selected) {
+ if (this.props.selected && !nextProps.selected) {
this.resetFields();
}
}
componentWillUnmount() {
UserStore.removeChangeListener(this.onChange);
+
+ if (this.props.selected) {
+ const state = this.getStateFromStores();
+ Utils.applyTheme(state.theme);
+ }
}
getStateFromStores() {
const user = UserStore.getCurrentUser();
@@ -147,11 +151,6 @@ export default class ThemeSetting extends React.Component {
updateType(type) {
this.setState({type});
}
- deactivate() {
- const state = this.getStateFromStores();
-
- Utils.applyTheme(state.theme);
- }
resetFields() {
const state = this.getStateFromStores();
state.serverError = null;
diff --git a/webapp/i18n/pt.json b/webapp/i18n/pt.json
index 0b06b77af..b758dd0b2 100644
--- a/webapp/i18n/pt.json
+++ b/webapp/i18n/pt.json
@@ -230,15 +230,9 @@
"admin.ldap.usernameAttrTitle": "Atributo do Usuário:",
"admin.licence.keyMigration": "Se você estiver migrando seu servidor você pode precisar remover sua chave da licença deste servidor a pedido para instala-la em um novo servidor. Para iniciar, <a href=\"http://mattermost.com\" target=\"_blank\">desativar todos os recursos Enterprise Edition deste servidor</a>. Isto irá habilitar para remover a chave da licença e fazer downgrade deste servidor Enterprise Edition para Team Edition.",
"admin.license.chooseFile": "Escolha um Arquivo",
- "admin.license.edition": "Edição: ",
- "admin.license.enterpriseEdition": "Mattermost Enterprise Edition. Desenvolvido para escala empresarial de comunicação.",
- "admin.license.enterpriseType": "<div><p>Esta versão compilada da plataforma Mattermost é fornecida sob a <a href=\"http://mattermost.com\" target=\"_blank\">licença comercial</a> para Mattermost, Inc. com base em seu nível de subscrição e está sujeito a <a href=\"{terms}\" target=\"_blank\">Termos de Serviço.</a></p><p>Os detalhes de sua assinatura, são como segue:</p>Nome: {name}<br />Nome da Empresa ou organização: {company}<br/>Número de usuários: {users}<br/>Licença emitida: {issued}<br/>Data de Início da licença: {start}<br/>Data de expiração da licença: {expires}<br/>LDAP: {ldap}<br/></div>",
- "admin.license.key": "Chave da Licença: ",
"admin.license.keyRemove": "Remover a Licença Enterprise e fazer Downgrade do Servidor",
"admin.license.noFile": "Nenhum arquivo enviado",
"admin.license.removing": "Removendo a Licença...",
- "admin.license.teamEdition": "Mattermost Team Edition. Desenvolvido para equipes de 5 a 50 usuários.",
- "admin.license.teamType": "<span><p>Esta versão compilada da plataforma Mattermost é oferecido sob uma licença MIT.</p><p>Ver MIT-COMPILED-LICENSE.txt no raiz do diretório de instalação para obter detalhes. Ver NOTICES.txt para obter informações sobre o software open source usados neste sistema.</p></span>",
"admin.license.title": "Edição e Licença",
"admin.license.type": "Licença: ",
"admin.license.upload": "Enviar",
@@ -416,6 +410,8 @@
"admin.support.emailTitle": "E-mail de suporte:",
"admin.support.helpDesc": "Link para documentação de ajuda para o site da equipe no menu principal. Normalmente não é alterado ao menos se sua empresa escolha criar uma documentação customizada.",
"admin.support.helpTitle": "Link de ajuda:",
+ "admin.support.noteDescription": "Se links para um site externo, URLs devem começar com http:// ou https://.",
+ "admin.support.noteTitle": "Nota:",
"admin.support.privacyDesc": "Link para Política de Privacidade para os usuários no desktop ou móvel. Deixando este espaço em branco irá esconder a opção de exibir um aviso.",
"admin.support.privacyTitle": "Link da Política de Privacidade:",
"admin.support.problemDesc": "Link para a documentação de ajuda do site no menu principal. Por padrão este aponta para um fórum peer-to-peer de solução de problemas onde os usuários podem pesquisar, encontrar e pedir ajuda com problemas técnicos.",
@@ -425,8 +421,6 @@
"admin.support.termsDesc": "Link para os Termos de Serviço para os usuários no desktop ou móvel. Deixando este espaço em branco irá esconder a opção de exibir um aviso.",
"admin.support.termsTitle": "Link Termos do Serviço:",
"admin.support.title": "Configurações jurídico e apoio",
- "admin.support.noteTitle": "Note:",
- "admin.support.noteDescription": "If linking to an external site, URLs should begin with http:// or https://.",
"admin.system_analytics.activeUsers": "Usuários Ativos com Postagens",
"admin.system_analytics.title": "o Sistema",
"admin.system_analytics.totalPosts": "Total Posts",
@@ -639,6 +633,18 @@
"choose_auth_page.ldapCreate": "Criar uma nova equipe com uma conta LDAP",
"choose_auth_page.noSignup": "Nenhum método de inscrição configurado, por favor contate seu administrador do sistema.",
"claim.account.noEmail": "Nenhum email específicado",
+ "claim.email_to_ldap.enterLdapPwd": "Entre o ID e a senha para sua conta LDAP",
+ "claim.email_to_ldap.enterPwd": "Entre a senha para o sua conta com email {team} {site}",
+ "claim.email_to_ldap.ldapId": "LDAP ID",
+ "claim.email_to_ldap.ldapIdError": "Por favor digite seu ID LDAP.",
+ "claim.email_to_ldap.ldapPasswordError": "Por favor digite a sua senha LDAP.",
+ "claim.email_to_ldap.ldapPwd": "Senha LDAP",
+ "claim.email_to_ldap.pwd": "Senha",
+ "claim.email_to_ldap.pwdError": "Por favor digite a sua senha.",
+ "claim.email_to_ldap.ssoNote": "Você precisa já ter uma conta LDAP válida",
+ "claim.email_to_ldap.ssoType": "Ao retirar a sua conta, você só vai ser capaz de logar com LDAP",
+ "claim.email_to_ldap.switchTo": "Trocar a conta para LDAP",
+ "claim.email_to_ldap.title": "Trocar E-mail/Senha da Conta para LDAP",
"claim.email_to_oauth.enterPwd": "Entre a senha para o sua conta {team} {site}",
"claim.email_to_oauth.pwd": "Senha",
"claim.email_to_oauth.pwdError": "Por favor digite a sua senha.",
@@ -646,14 +652,25 @@
"claim.email_to_oauth.ssoType": "Ao retirar a sua conta, você só vai ser capaz de logar com SSO {type}",
"claim.email_to_oauth.switchTo": "Trocar a conta para {uiType}",
"claim.email_to_oauth.title": "Trocar E-mail/Senha da Conta para {uiType}",
- "claim.oauth_to_email.confirm": "Confirmar senha",
+ "claim.ldap_to_email.confirm": "Confirmar senha",
+ "claim.ldap_to_email.email": "Você vai usar o email {email} para logar",
+ "claim.ldap_to_email.enterLdapPwd": "Entre a sua senha LDAP para o sua conta {team} {site}",
+ "claim.ldap_to_email.enterPwd": "Entre a nova senha para o sua conta com email.",
+ "claim.ldap_to_email.ldapPasswordError": "Por favor digite a sua senha LDAP.",
+ "claim.ldap_to_email.ldapPwd": "Senha LDAP",
+ "claim.ldap_to_email.pwd": "Senha",
+ "claim.ldap_to_email.pwdError": "Por favor digite a sua senha.",
+ "claim.ldap_to_email.pwdNotMatch": "As senha não correspondem.",
+ "claim.ldap_to_email.ssoType": "Após a alteração do tipo de conta, você só vai ser capaz de logar com seu e-mail e senha.",
+ "claim.ldap_to_email.switchTo": "Trocar a conta para e-mail/senha",
+ "claim.ldap_to_email.title": "Trocar a conta LDAP para E-mail/Senha",
+ "claim.oauth_to_email.confirm": "Confirmar Senha",
"claim.oauth_to_email.description": "Após a alteração do tipo de conta, você só vai ser capaz de logar com seu e-mail e senha.",
"claim.oauth_to_email.enterPwd": "Por favor entre uma senha.",
"claim.oauth_to_email.newPwd": "Nova Senha",
"claim.oauth_to_email.pwdNotMatch": "As senha não correspondem.",
"claim.oauth_to_email.switchTo": "Trocar {type} para email e senha",
"claim.oauth_to_email.title": "Trocar Conta {type} para E-mail",
- "claim.oauth_to_email.newPwd": "Entre a nova senha para o sua conta {team} {site}",
"confirm_modal.cancel": "Cancelar",
"create_comment.addComment": "Adicionar um comentário...",
"create_comment.comment": "Adicionar Comentário",
@@ -1341,6 +1358,7 @@
"user.settings.security.switchEmail": "Trocar para usar email e senha",
"user.settings.security.switchGitlab": "Trocar para usar GitLab SSO",
"user.settings.security.switchGoogle": "Trocar para usar Google SSO",
+ "user.settings.security.switchLda": "Trocar para usar LDAP",
"user.settings.security.title": "Configurações de Segurança",
"user.settings.security.viewHistory": "Ver Histórico de Acesso",
"user_list.notFound": "Nenhum usuário encontrado :(",
diff --git a/webapp/root.jsx b/webapp/root.jsx
index 2318c0682..2fce25532 100644
--- a/webapp/root.jsx
+++ b/webapp/root.jsx
@@ -119,7 +119,7 @@ function preRenderSetup(callwhendone) {
if (global.Intl) {
afterIntl();
} else {
- I18n.safarifix(afterIntl);
+ I18n.safariFix(afterIntl);
}
}
diff --git a/webapp/stores/notificaiton_store.jsx b/webapp/stores/notification_store.jsx
index 70caffeb6..70caffeb6 100644
--- a/webapp/stores/notificaiton_store.jsx
+++ b/webapp/stores/notification_store.jsx