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

Implement 2nd passphrase registration - Closes #68 #554

Merged
merged 40 commits into from
Mar 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
193cf17
Add some strings to common.json
yasharAyari Mar 13, 2018
e20585f
Use header and message in safekeeping component
yasharAyari Mar 13, 2018
9a90917
Create a new theme for react-toolbar progressBar
yasharAyari Mar 13, 2018
a8376bd
Add secondPassphrase class to create.css
yasharAyari Mar 13, 2018
de43df7
Create createSecond component
yasharAyari Mar 13, 2018
50a2611
Pass header and message to next step in create component
yasharAyari Mar 13, 2018
4994757
Merge branch '0.3.0' into 68-implement-2nd-passphrase-registration
yasharAyari Mar 13, 2018
ad72432
Add some translation strings to common.json
yasharAyari Mar 15, 2018
fa0eb86
Create confirmSecond component
yasharAyari Mar 15, 2018
486d620
Add second passphrase route to app component
yasharAyari Mar 15, 2018
4e445f6
Add secondPassphrase path to routes
yasharAyari Mar 15, 2018
57f4203
Create confirmSecond HOC
yasharAyari Mar 15, 2018
1e2c08f
Compelete SecondPassphrase component
yasharAyari Mar 15, 2018
b6e7667
Add SecondPassphraseSteps to passphrase component
yasharAyari Mar 15, 2018
c2b4f21
enable secondPassphrase slide in setting
yasharAyari Mar 15, 2018
da52762
Fix a bug in account action
yasharAyari Mar 15, 2018
127568c
Merge branch '0.3.0' into 68-implement-2nd-passphrase-registration
yasharAyari Mar 16, 2018
50c1c3f
Add pending animation to confirmSecond.css
yasharAyari Mar 16, 2018
f2d6441
Add a translation string to common.json
yasharAyari Mar 16, 2018
734cc85
Update safeKeeping unit test
yasharAyari Mar 16, 2018
d8f9310
Add second passphrase component to coverage exclude list
yasharAyari Mar 16, 2018
c45c064
Add withRouter to seconPassphrase component
yasharAyari Mar 16, 2018
ee35117
Use history in SecondPassphrase
yasharAyari Mar 16, 2018
567c0a6
Add doneClass to header
yasharAyari Mar 16, 2018
1c9c8fc
Merge branch '0.3.0' into 68-implement-2nd-passphrase-registration
yasharAyari Mar 19, 2018
ca24806
Update a translation string
yasharAyari Mar 19, 2018
03f3bc5
Fix some style bugs in small breakpoint
yasharAyari Mar 19, 2018
b929c59
fix a bug in passphrase confirm
yasharAyari Mar 19, 2018
fbc7d66
Add contentFocused class to body when componet is mounted
yasharAyari Mar 19, 2018
e9af35a
Merge branch '0.4.0' into 68-implement-2nd-passphrase-registration
yasharAyari Mar 19, 2018
bc02e52
Update translation strings
yasharAyari Mar 19, 2018
b6b4618
Add translation for step title
yasharAyari Mar 19, 2018
56c227c
Fix a style bug
yasharAyari Mar 19, 2018
ba04083
Deactive secondPassphrase item in setting component
yasharAyari Mar 20, 2018
eab874f
Fix confirm slider style bug
yasharAyari Mar 20, 2018
ee569cd
Move header and message to secondPassphrase component
yasharAyari Mar 20, 2018
f17628c
Deactive secondPassphrase link in setting
yasharAyari Mar 20, 2018
01e0cde
Fix extra padding bugs
yasharAyari Mar 20, 2018
91398d1
Fix a style bug in confirmSecond component
yasharAyari Mar 20, 2018
c32e7f0
Change the direction of animation in pending
yasharAyari Mar 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions i18n/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
"Buy Lisk": "Buy Lisk",
"Cancel": "Cancel",
"Check for updates...": "Check for updates...",
"Choose the correct phrases to confirm.": "Choose the correct phrases to confirm.",
"Close": "Close",
"Coming soon.": "Coming soon.",
"Confirm": "Confirm",
"Confirm (Fee: 1 LSK)": "Confirm (Fee: 1 LSK)",
"Confirm (Fee: {{fee}} LSK)": "Confirm (Fee: {{fee}} LSK)",
"Confirm to register your second passphrase on the blockchain.": "Confirm to register your second passphrase on the blockchain.",
"Confirm transfer": "Confirm transfer",
"Confirmation in the next step": "Confirmation in the next step",
"Confirmation in the next step.": "Confirmation in the next step.",
Expand All @@ -39,9 +39,11 @@
"Copied!": "Copied!",
"Copy": "Copy",
"Copy Transaction ID to clipboard": "Copy Transaction ID to clipboard",
"Create": "Create",
"Create Lisk ID": "Create Lisk ID",
"Create a Lisk ID to gain access to all services.": "Create a Lisk ID to gain access to all services.",
"Create your Lisk ID": "Create your Lisk ID",
"Create your second passphrase": "Create your second passphrase",
"Current version is up-to-date.": "Current version is up-to-date.",
"Currently we speaking english and german.": "Currently we speaking english and german.",
"Custom Node": "Custom Node",
Expand Down Expand Up @@ -71,10 +73,13 @@
"Fee: {{fee}} LSK": "Fee: {{fee}} LSK",
"Final confirmation": "Final confirmation",
"Get to your Dashboard": "Get to your Dashboard",
"Go back to Dashboard": "Go back to Dashboard",
"Got it": "Got it",
"Great!\nYou’re almost finished": "Great!\nYou’re almost finished",
"Help": "Help",
"Hide passphrase": "Hide passphrase",
"I am responsible for keeping my passphrase safe. No one can reset it, not even Lisk.": "I am responsible for keeping my passphrase safe. No one can reset it, not even Lisk.",
"I confirm (Fee: 5 LSK)": "I confirm (Fee: 5 LSK)",
"I understand": "I understand",
"In": "In",
"Incoming": "Incoming",
Expand Down Expand Up @@ -103,7 +108,6 @@
"Lock ID": "Lock ID",
"Lock ID’s automatically after 10 minutes.": "Lock ID’s automatically after 10 minutes.",
"Log in": "Log in",
"Losing access to this passphrase will mean no funds can be sent from this account.": "Losing access to this passphrase will mean no funds can be sent from this account.",
"Main menu": "Main menu",
"Mainnet": "Mainnet",
"Maximum of 101 votes in total": "Maximum of 101 votes in total",
Expand Down Expand Up @@ -137,6 +141,7 @@
"Please click Next, then move around your mouse randomly to generate a random passphrase.": "Please click Next, then move around your mouse randomly to generate a random passphrase.",
"Please go back and check your passphrase again.": "Please go back and check your passphrase again.",
"Please keep it safe!": "Please keep it safe!",
"Please sign in with your first passphrase": "Please sign in with your first passphrase",
"Price data currently not available": "Price data currently not available",
"Processing delegate names: ": "Processing delegate names: ",
"Productivity": "Productivity",
Expand All @@ -156,15 +161,18 @@
"Report Issue...": "Report Issue...",
"Required": "Required",
"Restart now": "Restart now",
"Safekeeping": "Safekeeping",
"Search": "Search",
"Search by username": "Search by username",
"Search for Lisk ID or Transaction ID": "Search for Lisk ID or Transaction ID",
"Search for a delegate": "Search for a delegate",
"Second Signature Creation": "Second Signature Creation",
"Secure the use of your Lisk ID with a second passphrase.": "Secure the use of your Lisk ID with a second passphrase.",
"Security": "Security",
"See all transactions": "See all transactions",
"Select a network": "Select a network",
"Select all": "Select all",
"Select the missing words to confirm": "Select the missing words to confirm",
"Selection": "Selection",
"Send": "Send",
"Send Lisk from Blockchain Application": "Send Lisk from Blockchain Application",
Expand All @@ -182,14 +190,17 @@
"Start here": "Start here",
"Submit": "Submit",
"Success": "Success",
"Success!": "Success!",
"Testnet": "Testnet",
"Thank you": "Thank you",
"The Wallet will show your recent transactions.": "The Wallet will show your recent transactions.",
"The download was started. Depending on your internet speed it can take up to several minutes. You will be informed then it is finished and prompted to restart the app.": "The download was started. Depending on your internet speed it can take up to several minutes. You will be informed then it is finished and prompted to restart the app.",
"The easiest way to do this is to send LSK to yourself. It will cost you only the usual {{fee}} LSK transaction fee.": "The easiest way to do this is to send LSK to yourself. It will cost you only the usual {{fee}} LSK transaction fee.",
"There are no {{filterName}} transactions.": "There are no {{filterName}} transactions.",
"There is a new version ({{version}}) available, do you want to update now?": "There is a new version ({{version}}) available, do you want to update now?",
"This is not reversible.": "This is not reversible.",
"This is your Lisk ID": "This is your Lisk ID",
"This process should take only 10 seconds but may take up to 15 minutes.": "This process should take only 10 seconds but may take up to 15 minutes.",
"Toggle full screen": "Toggle full screen",
"Total": "Total",
"Total incl. {{fee}} LSK Fee": "Total incl. {{fee}} LSK Fee",
Expand Down Expand Up @@ -229,15 +240,19 @@
"You can vote for up to {{count}} delegates in total._plural": "You can vote for up to {{count}} delegates in total.",
"You have already registered as a delegate.": "You have already registered as a delegate.",
"You only need to do this once for each Lisk ID.": "You only need to do this once for each Lisk ID.",
"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.",
"Your ID is now secured!": "Your ID is now secured!",
"Your Lisk IDs": "Your Lisk IDs",
"Your passphrase is used to access your Lisk ID.": "Your passphrase is used to access your Lisk ID.",
"Your registration is secured on the blockchain.": "Your registration is secured on the blockchain.",
"Your second passphrase registration is being processed and will be confirmed.": "Your second passphrase registration is being processed and will be confirmed.",
"You’re votes are being processed and will be confirmed. It may take up to 10 minutes to be secured in the blockchain.": "You’re votes are being processed and will be confirmed. It may take up to 10 minutes to be secured in the blockchain.",
"Zero not allowed": "Zero not allowed",
"by moving your mouse.": "by moving your mouse.",
"by tilting your device.": "by tilting your device.",
"more": "more",
"set second passphrase": "set second passphrase",
"your second passphrase will be required for all transactions sent from this account": "your second passphrase will be required for all transactions sent from this account",
"{{count}} delegate names were successfully resolved for unvoting.": "{{count}} delegate name successfully resolved to remove vote from.",
"{{count}} delegate names were successfully resolved for unvoting._plural": "{{count}} delegate names were successfully resolved for unvoting.",
"{{count}} delegate names were successfully resolved for voting.": "{{count}} delegate name successfully resolved to add vote to.",
Expand Down
4 changes: 4 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ module.exports = function (config) {
'src/components/authenticate/authenticate.js',
'src/components/multiStep/index.js',
'src/components/passphrase/create/index.js',
'src/components/passphrase/createSecond/index.js',
'src/components/passphrase/ConfirmSecond/confirmSecond.js',
'src/components/passphrase/ConfirmSecond/index.js',
'src/components/passphrase/safekeeping/index.js',
'src/components/secondPassphrase/secondPassphrase.js',
'src/components/toolbox/sliderCheckbox/index.js',
'src/components/toolbox/transitionWrapper/index.js',
'src/components/searchBar/index.js',
Expand Down
6 changes: 3 additions & 3 deletions src/actions/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ export const passphraseUsed = data => ({
/**
*
*/
export const secondPassphraseRegistered = ({ activePeer, secondPassphrase, account }) =>
export const secondPassphraseRegistered = ({ activePeer, secondPassphrase, account, passphrase }) =>
(dispatch) => {
setSecondPassphrase(activePeer, secondPassphrase, account.publicKey, account.passphrase)
setSecondPassphrase(activePeer, secondPassphrase, account.publicKey, passphrase)
.then((data) => {
dispatch(transactionAdded({
id: data.transactionId,
Expand All @@ -81,7 +81,7 @@ export const secondPassphraseRegistered = ({ activePeer, secondPassphrase, accou
const text = (error && error.message) ? error.message : i18next.t('An error occurred while registering your second passphrase. Please try again.');
dispatch(errorAlertDialogDisplayed({ text }));
});
dispatch(passphraseUsed(account.passphrase));
dispatch(passphraseUsed(passphrase));
};

/**
Expand Down
2 changes: 2 additions & 0 deletions src/components/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Sidechains from '../sidechains';
import Header from '../header';
import Login from '../login';
import Register from '../register';
import SecondPassphrase from '../secondPassphrase';
import Search from '../search';
import SearchResult from '../search/searchResult';
import TransactionDashboard from '../transactionDashboard';
Expand Down Expand Up @@ -46,6 +47,7 @@ class App extends React.Component {
<Route path={`${match.url}${routes.wallet.path}/:dialog?`} component={TransactionDashboard} />
<Route path={`${match.url}${routes.voting.path}/:dialog?`} component={Voting} />
<Route path={`${match.url}${routes.sidechains.path}/:dialog?`} component={Sidechains} />
<Route path={`${match.url}${routes.secondPassphrase.path}/:dialog?`} component={SecondPassphrase} />
<Route path='*' component={NotFound} />
</Switch>
</main>
Expand Down
122 changes: 122 additions & 0 deletions src/components/passphrase/ConfirmSecond/confirmSecond.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
@import '../../app/variables.css';

@keyframes burst {
0% {
opacity: 0;
transform: scale(1);
}

100% {
opacity: 1;
transform: scale(1.1);
}
}

.wrapper {
position: absolute;
height: calc(100% - 85px) !important;
background: #fff;
width: 100%;
bottom: 0;
z-index: 3;

&.hidden {
display: none;
}

& header {
height: 50%;
width: 100%;
display: flex;
justify-content: space-around;
flex-direction: column;
position: relative;
z-index: 1;

&.done {
justify-content: flex-end;
}
}

& h5 {
line-height: 38px;
}
}

.content {
position: absolute;
height: 50%;
border-top: solid 1px #f6f8fb;
background: #f6f8fb;
box-sizing: border-box;
width: 100%;
bottom: 0;
display: flex;
justify-content: space-around;
flex-direction: column;

&.done {
background: #fff;
border: none;
justify-content: baseline;
}
}

.innerContent {
margin-top: 45px;
padding: 0 50px;
}

.confirmSlider {
width: 250px;
margin: 48px auto;
}

.sliderInput label {
width: 275px;
margin: 48px auto;

& div > span {
text-indent: 75px;
}
}

.headerIcon {
font-size: 68px;
color: var(--color-action-light);
margin-bottom: 30px;
}

.resultHeader {
margin: 0 auto 10px !important;
}

.resultButton {
margin: 60px auto 0;
}

.pendingIcon {
color: var(--color-grayscale-dark);
animation: burst 2000ms infinite linear;
animation-direction: alternate;
font-size: 120px;
margin: 0 auto;
transform-origin: 50%;
animation-delay: 450ms;
}

.button {
margin-top: 10px;
}

.sliderInput span.circle {
margin-top: 0;
}

@media (--small-viewport) {
.content {
position: relative;
min-height: 90%;
height: auto;
}
}
Loading