Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace old send page with new new one - Closes #1743 #1817

Merged
merged 42 commits into from Mar 22, 2019
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
6886864
:recycle: Add Hardware Wallet support for send component
Mar 11, 2019
a8a6ddc
:recycle: Update routes file to keep it as before
Mar 11, 2019
8f813b7
:recycle: Update transaction actions file to use constants properly
Mar 12, 2019
5e4e7e3
:recycle: Update E2E tests for send component
Mar 12, 2019
4c4585a
:recycle: Update send E2E test
Mar 13, 2019
1d10cd0
:recycle: Update send files after code review
Mar 13, 2019
920687a
:recycle: Update topBar component to properly focus the menu item sel…
Mar 13, 2019
6b96208
Merge pull request #1814 from LiskHQ/1811-implement-send-lsk-with-led…
Mar 13, 2019
095c421
:recycle: Update E2E tests for send component
Mar 12, 2019
0bf76c4
:recycle: Update send E2E test
Mar 13, 2019
e294c31
:recycle: Update topBar component to properly focus the menu item sel…
Mar 13, 2019
e251d59
:recycle: fix merge conflicts
Mar 13, 2019
bfa1799
:recycle: Update transactionStatus file based on cypress problem find…
Mar 14, 2019
38b1380
:recycle: Add Hardware Wallet support for send component
Mar 11, 2019
7122cc9
:recycle: Update routes file to keep it as before
Mar 11, 2019
ee778e1
:recycle: Update transaction actions file to use constants properly
Mar 12, 2019
0d68899
:recycle: Update E2E tests for send component
Mar 12, 2019
241e2f4
:recycle: Update send E2E test
Mar 13, 2019
75b2788
:recycle: Update send files after code review
Mar 13, 2019
3e44a72
:recycle: Update topBar component to properly focus the menu item sel…
Mar 13, 2019
030bcc2
:recycle: Update transactionStatus file based on cypress problem find…
Mar 14, 2019
d7f5c4b
Merge branch '1806-implement-follow-account-dropdown-send-component'…
Mar 14, 2019
532b4e2
:recycle: Update unit test for transactionStatus file
Mar 15, 2019
642186d
:recycle: Update E2E test for the transactionStatus
Mar 15, 2019
d5fb15b
:recycle: Update files after code review
Mar 15, 2019
15ceeb0
:recycle: update files after code review
Mar 15, 2019
cc08a12
:recycle: fix bookmark component
Mar 15, 2019
ca632fc
Merge pull request #1823 from LiskHQ/1806-implement-follow-account-dr…
Mar 15, 2019
713781f
:recycle: Update form file after QA review
Mar 18, 2019
b54cab3
:recycle: Update follow accounts comment the checkbox option for now
Mar 19, 2019
4797a23
:recycle: Update send component after QA review
Mar 19, 2019
1c0d506
Merge branch '1.14.0' into 1743-replace-old-send-page-with-new-new-one
Mar 19, 2019
dcc5ffc
:recycle: update e2e send test
Mar 19, 2019
0c8ffce
Merge branch '1743-replace-old-send-page-with-new-new-one' of github.…
Mar 19, 2019
308fb82
:recycle: update files after QA review
Mar 20, 2019
a88d287
:recycle: Update text labels for bookmark account after send some liks
Mar 21, 2019
aac6c9a
:recycle: update form bookmark error message
Mar 21, 2019
d689240
:recycle: update form component for properly read bookmarked accounts
Mar 21, 2019
e07a5ba
:recycle: Form accept acccount init params when user click it
Mar 22, 2019
271cbc1
:recycle: Add link to init banner
Mar 22, 2019
2f89e6b
:recycle: Add link to init banner
Mar 22, 2019
96ac7e9
:recycle: Add link back to banner init
Mar 22, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 10 additions & 5 deletions i18n/locales/en/common.json
Expand Up @@ -78,6 +78,7 @@
"Confirm": "Confirm",
"Confirm (Fee: 1 LSK)": "Confirm (Fee: 1 LSK)",
"Confirm (Fee: {{fee}} LSK)": "Confirm (Fee: {{fee}} LSK)",
"Confirm on Ledger": "Confirm on Ledger",
"Confirm to register your second passphrase on the blockchain.": "Confirm to register your second passphrase on the blockchain.",
"Confirm transaction on Ledger Nano S": "Confirm transaction on Ledger Nano S",
"Confirm transfer": "Confirm transfer",
Expand Down Expand Up @@ -129,6 +130,7 @@
"Delegates have great responsibility within the Lisk system for securing the blockchain. Becoming a delegate requires the registration of a name. The top 101 delegates are eligible to forge.": "Delegates have great responsibility within the Lisk system for securing the blockchain. Becoming a delegate requires the registration of a name. The top 101 delegates are eligible to forge.",
"Details": "Details",
"Discard": "Discard",
"Does the problem still persist?": "Does the problem still persist?",
"Done": "Done",
"Don’t be a stranger! Connect with our worldwide community.": "Don’t be a stranger! Connect with our worldwide community.",
"Dowload started": "Dowload started",
Expand Down Expand Up @@ -209,7 +211,6 @@
"Invalid address": "Invalid address",
"Invalid amount": "Invalid amount",
"Is Blockchain Secure?": "Is Blockchain Secure?",
"Is the problem presisting?": "Is the problem presisting?",
"It is highly recommended to delete the PDF and remove it from your trash after printing.": "It is highly recommended to delete the PDF and remove it from your trash after printing.",
"It is recommended that you initialize your Lisk ID.": "It is recommended that you initialize your Lisk ID.",
"It will cost you only the usual {{fee}} LSK transaction fee.": "It will cost you only the usual {{fee}} LSK transaction fee.",
Expand Down Expand Up @@ -243,6 +244,7 @@
"Lisk.Chat": "Lisk.Chat",
"Loading accounts": "Loading accounts",
"Local": "Local",
"Log Out": "Log Out",
"Login Type not recognized.": "Login Type not recognized.",
"Logout": "Logout",
"Look at your Ledger for confirmation": "Look at your Ledger for confirmation",
Expand All @@ -263,6 +265,7 @@
"Minimize": "Minimize",
"Multisignature Creation": "Multisignature Creation",
"My Account": "My Account",
"My Wallet": "My Wallet",
"Name": "Name",
"Name is already taken!": "Name is already taken!",
"Name is available": "Name is available",
Expand All @@ -288,6 +291,7 @@
"Okay": "Okay",
"Onboarding whenever you need": "Onboarding whenever you need",
"Oops! Wrong passphrase": "Oops! Wrong passphrase",
"Oops, looks like something went wrong. Please try again.": "Oops, looks like something went wrong. Please try again.",
"Open the Lisk App": "Open the Lisk App",
"Open the Lisk App with your Ledger Nano S": "Open the Lisk App with your Ledger Nano S",
"Out": "Out",
Expand Down Expand Up @@ -340,7 +344,6 @@
"Remove from bookmarks": "Remove from bookmarks",
"Removed Votes": "Removed Votes",
"Report the error via E-Mail": "Report the error via E-Mail",
"Report the error via email": "Report the error via email",
"Request": "Request",
"Request LSK": "Request LSK",
"Requested amount": "Requested amount",
Expand Down Expand Up @@ -380,7 +383,7 @@
"Send to Address": "Send to Address",
"Send to address": "Send to address",
"Send to this address": "Send to this address",
"Send {{value}} LSK": "Send {{value}} LSK",
"Send {{amount}} LSK": "Send {{amount}} LSK",
"Sender": "Sender",
"Session timeout": "Session timeout",
"Session timeout in": "Session timeout in",
Expand Down Expand Up @@ -445,10 +448,12 @@
"Transaction": "Transaction",
"Transaction Fee": "Transaction Fee",
"Transaction ID": "Transaction ID",
"Transaction aborted on device": "Transaction aborted on device",
"Transaction failed": "Transaction failed",
"Transaction fee": "Transaction fee",
"Transaction is being processed and will be confirmed. It may take up to 15 minutes to be secured in the blockchain.": "Transaction is being processed and will be confirmed. It may take up to 15 minutes to be secured in the blockchain.",
"Transaction not found": "Transaction not found",
"Transaction submitted": "Transaction submitted",
"Transaction summary": "Transaction summary",
"Transactions can’t be reversed": "Transactions can’t be reversed",
"Transfer Transaction": "Transfer Transaction",
Expand Down Expand Up @@ -518,11 +523,13 @@
"You can use your passphrase to sign a message. ": "You can use your passphrase to sign a message. ",
"You have already registered as a delegate.": "You have already registered as a delegate.",
"You have cancelled the transaction on your hardware wallet. You can either continue or retry.": "You have cancelled the transaction on your hardware wallet. You can either continue or retry.",
"You have cancelled the transaction on your harware wallet.": "You have cancelled the transaction on your harware wallet.",
"You have cancelled voting on your hardware wallet.": "You have cancelled voting on your hardware wallet.",
"You must keep it safe as it is the only way to access your wallet and cannot be recovered if lost.": "You must keep it safe as it is the only way to access your wallet and cannot be recovered if lost.",
"You only need to do this once for each Lisk ID.": "You only need to do this once for each Lisk ID.",
"You will be able to select the desired network when signing in": "You will be able to select the desired network when signing in",
"You will be signed out in a minute due to no network activity. You can turn off Auto-Logout in the settings.": "You will be signed out in a minute due to no network activity. You can turn off Auto-Logout in the settings.",
"You will find it in My Transactions in a matter of minutes": "You will find it in My Transactions in a matter of minutes",
"You will need it to use your Lisk ID, like sending and voting. You are responsible for keeping your second passphrase safe. No one can restore it, not even Lisk.": "You will need it to use your Lisk ID, like sending and voting. You are responsible for keeping your second passphrase safe. No one can restore it, not even Lisk.",
"You will send a small amount of {{fee}} LSK to yourself and therefore initialize your ID.": "You will send a small amount of {{fee}} LSK to yourself and therefore initialize your ID.",
"You've received {{value}} LSK.": "You've received {{value}} LSK.",
Expand Down Expand Up @@ -570,7 +577,5 @@
"{{count}} delegate(s) selected to vote_plural": "{{count}} delegates selected to vote",
"{{length}} extra characters": "{{length}} extra characters",
"{{length}} out of {{total}} characters left": "{{length}} out of {{total}} characters left",
"{{paragraph}}": "{{paragraph}}",
"{{title}}": "{{title}}",
"{{title}} has been added to your Dashboard.": "{{title}} has been added to your Dashboard."
}
9 changes: 5 additions & 4 deletions src/actions/transactions.js
Expand Up @@ -13,6 +13,7 @@ import Fees from '../constants/fees';
import transactionTypes from '../constants/transactionTypes';
import { toRawLsk } from '../utils/lsk';
import { sendWithLedger } from '../utils/api/ledger';
import { loginType } from '../constants/hwConstants';

export const cleanTransactions = () => ({
type: actionTypes.cleanTransactions,
Expand Down Expand Up @@ -243,10 +244,10 @@ export const transactionsUpdated = ({
const handleSentError = ({ error, account, dispatch }) => {
let text;
switch (account.loginType) {
case 0:
case loginType.normal:
text = error && error.message ? `${error.message}.` : i18next.t('An error occurred while creating the transaction.');
break;
case 1:
case loginType.ledger:
text = i18next.t('You have cancelled the transaction on your hardware wallet. You can either continue or retry.');
break;
default:
Expand All @@ -268,11 +269,11 @@ export const sent = ({
const liskAPIClient = getState().peers.liskAPIClient;
const timeOffset = getTimeOffset(getState());
switch (account.loginType) {
case 0:
case loginType.normal:
// eslint-disable-next-line
[error, callResult] = await to(send(liskAPIClient, recipientId, toRawLsk(amount), passphrase, secondPassphrase, data, timeOffset));
break;
case 1:
case loginType.ledger:
// eslint-disable-next-line
[error, callResult] = await to(sendWithLedger(liskAPIClient, account, recipientId, toRawLsk(amount), secondPassphrase, data, timeOffset));
break;
Expand Down
2 changes: 1 addition & 1 deletion src/components/sendV2/form/form.css
Expand Up @@ -10,7 +10,7 @@
max-width: 443px;
height: auto;
background-color: var(--color-white);
box-shadow: var(--box-shadow-standar2);
box-shadow: var(--box-shadow-graph-selector);
border-radius: var(--border-radius-box);
}

Expand Down
17 changes: 12 additions & 5 deletions src/components/sendV2/form/form.js
Expand Up @@ -68,20 +68,27 @@ class Form extends React.Component {
const { prevState } = this.props;

if (prevState.fields && Object.entries(prevState.fields).length > 0) {
this.setState({ fields: { ...prevState.fields } });
this.setState({
...this.state,
fields: {
...this.state.fields,
...prevState.fields,
},
});
}
}

ifDataFromUrl() {
const { fields = {} } = this.props;

if (Object.entries(fields).length > 0) {
if (fields.recipient.address !== '' || fields.amount.value !== '' || fields.reference.value !== '') {
this.setState({
fields: {
...this.state.fields,
recipient: {
...this.state.fields.recipient,
address: fields.recipient.address,
value: fields.recipient.address,
},
amount: {
...this.state.fields.amount,
Expand Down Expand Up @@ -324,7 +331,7 @@ class Form extends React.Component {
src={ fields.amount.error ? svg.alert_icon : svg.ok_icon}
/>
</span>
<span className={`${styles.feedback} ${fields.amount.error ? 'error' : ''} ${fields.amount.feedback ? styles.show : ''}`}>
<span className={`${styles.feedback} ${fields.amount.error ? 'error' : ''} ${fields.amount.feedback ? styles.show : ''} amount-feedback`}>
{fields.amount.feedback}
</span>
<span className={styles.amountHint}>
Expand Down Expand Up @@ -360,7 +367,7 @@ class Form extends React.Component {
name='reference'
value={fields.reference.value}
placeholder={this.props.t('Write message')}
className={`${styles.textarea} ${fields.reference.error ? 'error' : ''}`} />
className={`${styles.textarea} ${fields.reference.error ? 'error' : ''} message`} />
<SpinnerV2 className={`${styles.spinner} ${this.state.isLoading && fields.reference.value ? styles.show : styles.hide}`}/>
<img
className={`${styles.status} ${!this.state.isLoading && fields.reference.value ? styles.show : styles.hide}`}
Expand All @@ -374,7 +381,7 @@ class Form extends React.Component {

<footer>
<PrimaryButtonV2
className={`${styles.confirmButton} btn-submit`}
className={`${styles.confirmButton} btn-submit send-next-button`}
disabled={isBtnDisabled}
onClick={this.onGoNext}
>
Expand Down
6 changes: 5 additions & 1 deletion src/components/sendV2/form/form.test.js
Expand Up @@ -48,7 +48,11 @@ describe('Form', () => {

const props = {
t: v => v,
fields: {},
fields: {
recipient: { address: '' },
amount: { value: '' },
reference: { value: '' },
},
prevState: {
fields: {},
},
Expand Down
12 changes: 12 additions & 0 deletions src/components/sendV2/send.css
Expand Up @@ -23,6 +23,18 @@
height: auto;
}

footer > div {
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-evenly;
align-items: center;

& > .btn {
max-width: 209px;
}
}

:global(.offlineWrapper) {
height: 100%;
}
3 changes: 2 additions & 1 deletion src/components/sendV2/send.test.js
Expand Up @@ -32,7 +32,9 @@ describe('Form', () => {
},
transactions: {
failed: undefined,
pending: [],
},
failedTransactions: '',
account: {
balance: accounts.genesis.balance,
},
Expand Down Expand Up @@ -81,7 +83,6 @@ describe('Form', () => {
prevState: {
fields: {},
},
fields: {},
followedAccounts: [
{
title: 'ABC',
Expand Down
2 changes: 2 additions & 0 deletions src/components/sendV2/summary/index.js
Expand Up @@ -6,6 +6,8 @@ import Summary from './summary';

const mapStateToProps = state => ({
account: state.account,
failedTransactions: state.transactions.failed,
pendingTransactions: state.transactions.pending,
});

const mapDispatchToProps = {
Expand Down