Skip to content

Commit

Permalink
0.0.161014 release (steemit#484)
Browse files Browse the repository at this point in the history
* Auto re-establish session by resending email verification link. steemit#467 (steemit#472)

* Validate all transfer amounts to at most 3 decimal places. (steemit#466)

* Warning cleanup

* Validate all transfer amounts to at most 3 decimal places. close steemit#461

* Add formatting to saving account balance. close steemit#462 (steemit#463)

* Fix $ Signs in Locale Strings

* Power up should not show memo. close steemit#474 (steemit#475)

* Fixes save login checkbox to remember last status. Simplify react form types. close steemit#482 (steemit#483)

* 478 fix create account's form issue and a couple of more minor fixes (steemit#480)

* fix  issue when get_accounts API call fails

* reset an error before making api call

* one more fix

* better handle existing email edge case

* use 302 redirects not 301

* Replace Math.random with secure-random. steemit#478

* Lock down confirm email lookup to email identity provider records. steemit#478

* Start over link more consistent order by in Identites sql. steemit#478

* Revert "Start over link more consistent order by in Identites sql. steemit#478"

This reverts commit dea06a5.

* reset session.user in /enter_email

* start registration process if user get to create_account page and has no id in session yet

* Add a few DESC to Identity.ID order by.

* update comment
  • Loading branch information
Valentine Zavgorodnev authored Oct 14, 2016
1 parent dea1a02 commit 8c980c8
Show file tree
Hide file tree
Showing 22 changed files with 181 additions and 138 deletions.
7 changes: 6 additions & 1 deletion app/components/elements/ChangePassword.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,18 @@ class ChangePassword extends React.Component {
if (name.length > 0) {
nameError = validate_account_name(name);
if (!nameError) {
this.setState({nameError: ''});
promise = Apis.db_api('get_accounts', [name]).then(res => {
return !(res && res.length > 0) ? 'Account not found' : '';
});
}
}
if (promise) {
promise.then(error => this.setState({nameError: error}));
promise
.then(nameError => this.setState({nameError}))
.catch(() => this.setState({
nameError: "Account name can't be verified right now due to server failure. Please try again later."
}));
} else {
this.setState({nameError});
}
Expand Down
2 changes: 1 addition & 1 deletion app/components/modules/LoginForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class LoginForm extends Component {
reactForm({
name: 'login',
instance: this,
fields: ['username', 'password', 'saveLogin:bool'],
fields: ['username', 'password', 'saveLogin:checked'],
initialValues: props.initialValues,
validation: values => ({
username: ! values.username ? 'Required' : validate_account_name(values.username.split('/')[0]),
Expand Down
4 changes: 3 additions & 1 deletion app/components/modules/Transfer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {transferTips} from 'app/utils/Tips'
import {powerTip, powerTip2, powerTip3} from 'app/utils/Tips'
import {browserTests} from 'shared/ecc/test/BrowserTests'
import {validate_account_name} from 'app/utils/ChainValidation';
import {countDecimals} from 'app/utils/ParsersAndFormatters'

/** Warning .. This is used for Power UP too. */
class TransferForm extends Component {
Expand Down Expand Up @@ -62,7 +63,7 @@ class TransferForm extends Component {
}
const {toVesting} = props
const fields = toVesting ? ['to', 'amount'] : ['to', 'amount', 'asset']
if(transferType !== 'Transfer to Savings' && transferType !== 'Savings Withdraw')
if(!toVesting && transferType !== 'Transfer to Savings' && transferType !== 'Savings Withdraw')
fields.push('memo')

reactForm({
Expand All @@ -76,6 +77,7 @@ class TransferForm extends Component {
! values.amount ? 'Required' :
! /^[0-9]*\.?[0-9]*/.test(values.amount) ? 'Amount is in the form 99999.999' :
insufficientFunds(values.asset, values.amount) ? 'Insufficient funds' :
countDecimals(values.amount) > 3 ? 'Use only 3 digits of precison' :
null,
asset:
props.toVesting ? null :
Expand Down
10 changes: 6 additions & 4 deletions app/components/modules/UserWallet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ class UserWallet extends React.Component {
const steem_balance_str = numberWithCommas(balance_steem.toFixed(3)) // formatDecimal(balance_steem, 3)
const power_balance_str = numberWithCommas(vesting_steem) // formatDecimal(vesting_steem, 3)
const sbd_balance_str = numberWithCommas('$' + sbd_balance.toFixed(3)) // formatDecimal(account.sbd_balance, 3)
const savings_balance_str = numberWithCommas('$' + saving_balance_steem.toFixed(3))
const savings_sbd_balance_str = numberWithCommas('$' + sbd_balance_savings.toFixed(3))

const savings_menu = [
{ value: 'Withdraw Steem', link: '#', onClick: showTransfer.bind( this, 'STEEM', 'Savings Withdraw' ) },
Expand Down Expand Up @@ -191,12 +193,12 @@ class UserWallet extends React.Component {
</div>
<div className="column small-12 medium-4">
{isMyAccount ?
<FoundationDropdownMenu dropdownPosition="bottom" dropdownAlignment="right" label={savings_balance} menu={savings_menu} />
: savings_balance}
<FoundationDropdownMenu dropdownPosition="bottom" dropdownAlignment="right" label={savings_balance_str} menu={savings_menu} />
: savings_balance_str}
<br />
{isMyAccount ?
<FoundationDropdownMenu dropdownPosition="bottom" dropdownAlignment="right" label={savings_sbd_balance} menu={savings_sbd_menu} />
: savings_sbd_balance}
<FoundationDropdownMenu dropdownPosition="bottom" dropdownAlignment="right" label={savings_sbd_balance_str} menu={savings_sbd_menu} />
: savings_sbd_balance_str}
</div>
</div>
<div className="row">
Expand Down
23 changes: 14 additions & 9 deletions app/components/pages/CreateAccount.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint react/prop-types: 0 */
import React from 'react';
import { connect } from 'react-redux';
import {connect} from 'react-redux';
import LoadingIndicator from 'app/components/elements/LoadingIndicator';
import Apis from 'shared/api_client/ApiInstances';
import { PrivateKey } from 'shared/ecc';
import {PrivateKey} from 'shared/ecc';
import user from 'app/redux/User';
import {validate_account_name} from 'app/utils/ChainValidation';
import SignUp from 'app/components/modules/SignUp';
Expand Down Expand Up @@ -119,13 +119,18 @@ class CreateAccount extends React.Component {
if (name.length > 0) {
name_error = validate_account_name(name);
if (!name_error) {
this.setState({name_error: ''});
promise = Apis.db_api('get_accounts', [name]).then(res => {
return res && res.length > 0 ? 'Account name is not available' : '';
});
}
}
if (promise) {
promise.then(error => this.setState({name_error: error}));
promise
.then(name_error => this.setState({name_error}))
.catch(() => this.setState({
name_error: "Account name can't be verified right now due to server failure. Please try again later."
}));
} else {
this.setState({name_error});
}
Expand All @@ -147,9 +152,7 @@ class CreateAccount extends React.Component {

const {loggedIn, logout, offchainUser, serverBusy} = this.props;
const submit_btn_disabled =
loading ||
!name ||
!password_valid ||
loading || !name || !password_valid ||
name_error;
const submit_btn_class = 'button action' + (submit_btn_disabled ? ' disabled' : '');

Expand All @@ -168,7 +171,8 @@ class CreateAccount extends React.Component {
<div className="callout alert">
<h4>Cryptography test failed</h4>
<p>We will be unable to create your Steem account with this browser.</p>
<p>The latest versions of <a href="https://www.google.com/chrome/">Chrome</a> and <a href="https://www.mozilla.org/en-US/firefox/new/">Firefox</a> are well tested and known to work with steemit.com.</p>
<p>The latest versions of <a href="https://www.google.com/chrome/">Chrome</a> and <a href="https://www.mozilla.org/en-US/firefox/new/">Firefox</a>
are well tested and known to work with steemit.com.</p>
</div>
</div>
</div>;
Expand Down Expand Up @@ -196,7 +200,7 @@ class CreateAccount extends React.Component {
<p>Our records indicate that you already have steem account: <strong>{existingUserAccount}</strong></p>
<p>In order to prevent abuse (each registered account costs 3 STEEM) Steemit can only register one account per verified user.</p>
<p>You can either <a href="/login.html">login</a> to your existing account
or <a href="mailto:[email protected]">send us email</a> if you need a new account.</p>
or <a href="mailto:[email protected]">send us email</a> if you need a new account.</p>
</div>
</div>
</div>;
Expand Down Expand Up @@ -243,7 +247,8 @@ class CreateAccount extends React.Component {
</div>
<hr />
</div> : <div className="text-center">
<a className="CreateAccount__rules-button" href="#" onClick={() => this.setState({showRules: true})}>Steemit Rules &nbsp; &raquo;</a>
<a className="CreateAccount__rules-button" href="#" onClick={() => this.setState({showRules: true})}>Steemit
Rules &nbsp; &raquo;</a>
</div>}
<form onSubmit={this.onSubmit} autoComplete="off" noValidate method="post">
<div className={name_error ? 'error' : ''}>
Expand Down
4 changes: 2 additions & 2 deletions app/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const en = {
tags_and_topics: "Tags and Topics",
filter: "Filter",
show_more_topics: "Show more topics",
we_require_social_account: 'Steemit funds each account with over ${signup_bonus} worth of Steem Power; to prevent abuse, we require new users to login via social media.',
we_require_social_account: 'Steemit funds each account with over {signup_bonus} worth of Steem Power; to prevent abuse, we require new users to login via social media.',
personal_info_will_be_private: 'Your personal information will be kept',
personal_info_will_be_private_link: 'Private',
continue_with_facebook: 'Continue with Facebook',
Expand Down Expand Up @@ -85,7 +85,7 @@ const en = {
welcome_to_the_blockchain: 'Welcome to the Blockchain!',
your_voice_is_worth_something: 'Your voice is worth something',
learn_more: 'Learn More',
get_sp_when_sign_up: 'Get ${signupBonus} of Steem Power when you sign up today.',
get_sp_when_sign_up: 'Get {signupBonus} of Steem Power when you sign up today.',
all_accounts_refunded: 'All Recovered Accounts have been fully Refunded',
steemit_is_now_open_source: 'Steemit.com is now Open Source',
// this is mainly from ReplyEditor
Expand Down
4 changes: 2 additions & 2 deletions app/locales/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const es = {
tags_and_topics: "Tags y Tópicos",
filter: "Filtros",
show_more_topics: "Mostrar más tópicos",
we_require_social_account: 'Steemit funds each account with over ${signup_bonus} worth of Steem Power; to prevent abuse, we require new users to login via social media.',
we_require_social_account: 'Steemit funds each account with over {signup_bonus} worth of Steem Power; to prevent abuse, we require new users to login via social media.',
personal_info_will_be_private: 'Your personal information will be kept',
personal_info_will_be_private_link: 'Privado',
continue_with_facebook: 'Continuar con Facebook',
Expand Down Expand Up @@ -85,7 +85,7 @@ const es = {
welcome_to_the_blockchain: 'Bienvenidos al Blockchain!',
your_voice_is_worth_something: 'Tu voz vale algo',
learn_more: 'Aprende más',
get_sp_when_sign_up: 'Get ${signupBonus} of Steem Power when you sign up today.',
get_sp_when_sign_up: 'Get {signupBonus} of Steem Power when you sign up today.',
all_accounts_refunded: 'All Recovered Accounts have been fully Refunded',
steemit_is_now_open_source: 'Steemit.com es ahora Software Libre',
// this is mainly from ReplyEditor
Expand Down
4 changes: 2 additions & 2 deletions app/locales/es_AR.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const es = {
tags_and_topics: "Tags y Temas",
filter: "Filtros",
show_more_topics: "Mostrar más temas",
we_require_social_account: 'Steemit funds each account with over ${signup_bonus} worth of Steem Power; to prevent abuse, we require new users to login via social media.',
we_require_social_account: 'Steemit funds each account with over {signup_bonus} worth of Steem Power; to prevent abuse, we require new users to login via social media.',
personal_info_will_be_private: 'Tu información personal se mantendrá',
personal_info_will_be_private_link: 'Privado',
continue_with_facebook: 'Continuar con Facebook',
Expand Down Expand Up @@ -85,7 +85,7 @@ const es = {
welcome_to_the_blockchain: 'Bienvenidos al Blockchain!',
your_voice_is_worth_something: 'Tu voz vale algo',
learn_more: 'Aprende más',
get_sp_when_sign_up: 'Get ${signupBonus} of Steem Power when you sign up today.',
get_sp_when_sign_up: 'Get {signupBonus} of Steem Power when you sign up today.',
all_accounts_refunded: 'All Recovered Accounts have been fully Refunded',
steemit_is_now_open_source: 'Steemit.com es ahora Software Libre',
// this is mainly from ReplyEditor
Expand Down
4 changes: 2 additions & 2 deletions app/locales/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const fr = {
tags_and_topics: "Tags et sujets",
filter: "Filtre",
show_more_topics: "Afficher plus de sujets",
we_require_social_account: 'Steemit rémunere chaque nouveau compte avec ${signup_bonus} de Steem Power; afin d\'éviter les abus, nous demandons aux nouveaux utilisateurs de lier leur compte social.',
we_require_social_account: 'Steemit rémunere chaque nouveau compte avec {signup_bonus} de Steem Power; afin d\'éviter les abus, nous demandons aux nouveaux utilisateurs de lier leur compte social.',
personal_info_will_be_private: 'Vos informations personelles seront privées',
personal_info_will_be_private_link: 'Privé',
continue_with_facebook: 'Continuer avec Facebook',
Expand Down Expand Up @@ -85,7 +85,7 @@ const fr = {
welcome_to_the_blockchain: 'Bienvenue sur la Blockchain!',
your_voice_is_worth_something: 'Votre voix a une valeur',
learn_more: 'En savoir plus',
get_sp_when_sign_up: 'Obtenez ${signupBonus} de Steem Power à votre inscription.',
get_sp_when_sign_up: 'Obtenez {signupBonus} de Steem Power à votre inscription.',
all_accounts_refunded: 'Vous les comptes récupérés ont été remboursés.',
steemit_is_now_open_source: 'Steemit.com est maintenant Open Source',
// this is mainly from ReplyEditor
Expand Down
4 changes: 2 additions & 2 deletions app/locales/it.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const it = {
tags_and_topics: "Tags e Argomenti",
filter: "Filtro",
show_more_topics: "Mostra più argomenti",
we_require_social_account: 'Steemit assegna ad ogni account ${signup_bonus} valorizzati in Steem Power; per prevenire gli abusi, ai nuovi utenti è richiesto di accedere tramite social.',
we_require_social_account: 'Steemit assegna ad ogni account {signup_bonus} valorizzati in Steem Power; per prevenire gli abusi, ai nuovi utenti è richiesto di accedere tramite social.',
personal_info_will_be_private: 'Le tue informazioni personali verranno custodite',
personal_info_will_be_private_link: 'Privato',
continue_with_facebook: 'Continua con Facebook',
Expand Down Expand Up @@ -85,7 +85,7 @@ const it = {
welcome_to_the_blockchain: 'Welcome to the Blockchain!',
your_voice_is_worth_something: 'La tua voce ha un certo valore',
learn_more: 'Approfondisci',
get_sp_when_sign_up: 'Ottieni un bonus di ${signupBonus} di Steem Power se ti iscrivi oggi.',
get_sp_when_sign_up: 'Ottieni un bonus di {signupBonus} di Steem Power se ti iscrivi oggi.',
all_accounts_refunded: 'Tutti gli account recuperati sono stati rimborsati pienamente',
steemit_is_now_open_source: 'Steemit.com è ora Open Source',
// this is mainly from ReplyEditor
Expand Down
4 changes: 2 additions & 2 deletions app/locales/jp.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const jp = {
tags_and_topics: "タグとトピック",
filter: "フィルター",
show_more_topics: "さらにトピックを見る",
we_require_social_account: 'Steemitは、それぞれのアカウントに対して、${signup_bonus} Steem Powerを付与しています。; 乱用を防ぐため、ソーシャルメディアアカウントでのログインを新しいユーザーには求めています。',
we_require_social_account: 'Steemitは、それぞれのアカウントに対して、{signup_bonus} Steem Powerを付与しています。; 乱用を防ぐため、ソーシャルメディアアカウントでのログインを新しいユーザーには求めています。',
personal_info_will_be_private: 'あなたの個人情報を保存する',
personal_info_will_be_private_link: 'プライベート',
continue_with_facebook: 'Facebookで続ける',
Expand Down Expand Up @@ -85,7 +85,7 @@ const jp = {
welcome_to_the_blockchain: '新しいBlockchainの世界へようこそ!',
your_voice_is_worth_something: 'あなたの言葉はどこかの世界のだれかに必ず役に立つ',
learn_more: 'もっと学ぶ',
get_sp_when_sign_up: '${signupBonus} 分のSteem Powerサインアップボーナスをゲットしよう',
get_sp_when_sign_up: '{signupBonus} 分のSteem Powerサインアップボーナスをゲットしよう',
all_accounts_refunded: '復元されたアカウント全てに対して払い戻されます',
steemit_is_now_open_source: 'Steemit.comはオープンソースプロジェクトです',
// this is mainly from ReplyEditor
Expand Down
4 changes: 2 additions & 2 deletions app/locales/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const ru = {
tags_and_topics: "Тэги и топики",
filter: "Фильтр",
show_more_topics: "Показать больше топиков",
we_require_social_account: 'Steemit funds each account with over ${signup_bonus} worth of Steem Power; to prevent abuse, we require new users to login via social media.',
we_require_social_account: 'Steemit funds each account with over {signup_bonus} worth of Steem Power; to prevent abuse, we require new users to login via social media.',
personal_info_will_be_private: 'Твоя персональная информация будет оставаться',
personal_info_will_be_private_link: 'приватной',
continue_with_facebook: 'Продолжить с Facebook',
Expand Down Expand Up @@ -85,7 +85,7 @@ const ru = {
welcome_to_the_blockchain: 'Добро пожаловать в Blockchain!',
your_voice_is_worth_something: 'Your voice is worth something',
learn_more: 'Узнать больше',
get_sp_when_sign_up: 'Get ${signupBonus} of Steem Power when you sign up today.',
get_sp_when_sign_up: 'Get {signupBonus} of Steem Power when you sign up today.',
all_accounts_refunded: 'All Recovered Accounts have been fully Refunded',
steemit_is_now_open_source: 'Steemit.com is now Open Source',
// this is mainly from ReplyEditor
Expand Down
7 changes: 7 additions & 0 deletions app/utils/ParsersAndFormatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,10 @@ export const repLog10 = rep2 => {
out = parseInt(out)
return out
}

export function countDecimals(amount) {
if(amount == null) return amount
amount = String(amount).match(/[\d\.]+/g).join('') // just dots and digits
const parts = amount.split('.')
return parts.length > 2 ? undefined : parts.length === 1 ? 0 : parts[1].length
}
15 changes: 10 additions & 5 deletions app/utils/ReactForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export default function reactForm({name, instance, fields, initialValues, valida

if(fieldType === 'checked') {
fs.value = toString(initialValue)
fs.props.checked = toBoolean(initialValue)
} else if(fieldType === 'selected') {
fs.props.selected = toString(initialValue)
fs.value = fs.props.selected
Expand All @@ -91,6 +92,7 @@ export default function reactForm({name, instance, fields, initialValues, valida

if(fieldType === 'checked') {
v.touched = toString(value) !== toString(initialValue)
v.value = v.props.checked = toBoolean(value)
v.value = value
} else if(fieldType === 'selected') {
v.touched = toString(value) !== toString(initialValue)
Expand Down Expand Up @@ -145,22 +147,25 @@ function getData(fields, state) {
/*
@arg {string} field - field:type
<pre>
type = checkbox,radio
type = option,select
type = checked (for checkbox or radio)
type = selected (for seelct option)
type = string
</pre>
@return {string} type
*/
function t(field) {
let [, type = 'string'] = field.split(':')
if(/checkbox|radio/.test(type)) type = 'checked'
if(/select|option/.test(type)) type = 'selected'
const [, type = 'string'] = field.split(':')
return type
}

/**
@return {string} name
*/
function n(field) {
const [name] = field.split(':')
return name
}

const hasValue = v => v == null ? false : (typeof v === 'string' ? v.trim() : v) === '' ? false : true
const toString = v => hasValue(v) ? v : ''
const toBoolean = v => hasValue(v) ? JSON.parse(v) : ''
3 changes: 2 additions & 1 deletion scripts/send_waiting_list_invites.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import models from '../db/models';
import sendEmail from '../server/sendEmail';
import secureRandom from 'secure-random'

function inviteUser(u, email, number) {
const confirmation_code = Math.random().toString(36).slice(2);
const confirmation_code = secureRandom.randomBuffer(13).toString('hex');
console.log(`\n***** invite #${number} ***** `, u.id, email, confirmation_code);
const i_attrs = {
provider: 'email',
Expand Down
Loading

0 comments on commit 8c980c8

Please sign in to comment.