Skip to content

Commit 6cb46eb

Browse files
authored
Merge pull request #805 from nervosnetwork/rc/v0.17.0-alpha.5
[ᚬmaster] chore: Bump to v0.17.0-alpha.5
2 parents d7765cf + 88009ff commit 6cb46eb

File tree

29 files changed

+227
-124
lines changed

29 files changed

+227
-124
lines changed

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1+
# [0.17.0-alpha.5](https://github.com/nervosnetwork/neuron/compare/v0.17.0-alpha.4...v0.17.0-alpha.5) (2019-08-02)
2+
3+
4+
### Bug Fixes
5+
6+
* **neuron-ui:** remove the quotation mark around error message ([5de8cba](https://github.com/nervosnetwork/neuron/commit/5de8cba))
7+
* **neuron-wallet:** fix the error comes with deleting all wallets ([fa87136](https://github.com/nervosnetwork/neuron/commit/fa87136))
8+
9+
10+
### Features
11+
12+
* using simple queue ([3595368](https://github.com/nervosnetwork/neuron/commit/3595368))
13+
* **neuron-ui:** add basic style on the list header of transaction list ([3a7eeaf](https://github.com/nervosnetwork/neuron/commit/3a7eeaf))
14+
* **neuron-ui:** add check on current wallet id on leaving settings view ([b33a238](https://github.com/nervosnetwork/neuron/commit/b33a238))
15+
* **neuron-ui:** add CKB unit in the transaction fee field ([e6107e5](https://github.com/nervosnetwork/neuron/commit/e6107e5))
16+
* **neuron-ui:** add dynamic prmopt in wallet wizard ([29372db](https://github.com/nervosnetwork/neuron/commit/29372db))
17+
* **neuron-ui:** add notification panel ([f7984b0](https://github.com/nervosnetwork/neuron/commit/f7984b0))
18+
* **neuron-ui:** add popping messages on copying and updating ([cd7d7e5](https://github.com/nervosnetwork/neuron/commit/cd7d7e5))
19+
* **neuron-ui:** add the story of connection status component, and set the network name to 14px ([e940fdf](https://github.com/nervosnetwork/neuron/commit/e940fdf))
20+
* **neuron-ui:** append network ips to network names in networks setting ([427941b](https://github.com/nervosnetwork/neuron/commit/427941b))
21+
* **neuron-ui:** cache language configuration ([49e35c3](https://github.com/nervosnetwork/neuron/commit/49e35c3))
22+
* **neuron-ui:** calculate transaction fee with user-specified price ([9ce3174](https://github.com/nervosnetwork/neuron/commit/9ce3174))
23+
* **neuron-ui:** call generate mnemonic method from neuron-wallet in neuron-ui with remote module ([5a27c7b](https://github.com/nervosnetwork/neuron/commit/5a27c7b))
24+
* **neuron-ui:** call networks controller's methods by remote module ([c4bc431](https://github.com/nervosnetwork/neuron/commit/c4bc431))
25+
* **neuron-ui:** call transactions controller methods with remote module ([4751817](https://github.com/nervosnetwork/neuron/commit/4751817))
26+
* **neuron-ui:** close the tx detail dialog on wallet switching ([5623f3b](https://github.com/nervosnetwork/neuron/commit/5623f3b))
27+
* **neuron-ui:** display balance with thousandth delimiter ([07e4370](https://github.com/nervosnetwork/neuron/commit/07e4370))
28+
* **neuron-ui:** double click on tx item shows its details ([383db66](https://github.com/nervosnetwork/neuron/commit/383db66))
29+
* **neuron-ui:** handle current-wallet update and wallet-list update separately ([bd4c109](https://github.com/nervosnetwork/neuron/commit/bd4c109))
30+
* **neuron-ui:** navigate to the Overview view on wallet switching ([bea4b20](https://github.com/nervosnetwork/neuron/commit/bea4b20))
31+
* Configure dev-app-update.yml for electron-updater ([8fcf184](https://github.com/nervosnetwork/neuron/commit/8fcf184))
32+
* **neuron-ui:** hide the top alert on removing the last error message from the notification panel ([e23d331](https://github.com/nervosnetwork/neuron/commit/e23d331))
33+
34+
35+
136
# [0.17.0-alpha.4](https://github.com/nervosnetwork/neuron/compare/v0.17.0-alpha.3...v0.17.0-alpha.4) (2019-08-01)
237

338

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"packages": [
33
"packages/*"
44
],
5-
"version": "0.17.0-alpha.4",
5+
"version": "0.17.0-alpha.5",
66
"npmClient": "yarn",
77
"useWorkspaces": true
88
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "neuron",
33
"productName": "Neuron",
44
"description": "CKB Neuron Wallet",
5-
"version": "0.17.0-alpha.4",
5+
"version": "0.17.0-alpha.5",
66
"private": true,
77
"author": {
88
"name": "Nervos Core Dev",

packages/neuron-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "neuron-ui",
3-
"version": "0.17.0-alpha.4",
3+
"version": "0.17.0-alpha.5",
44
"private": true,
55
"author": {
66
"name": "Nervos Core Dev",

packages/neuron-ui/src/components/Transaction/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { RouteComponentProps } from 'react-router-dom'
33
import { useTranslation } from 'react-i18next'
44
import { Stack, DetailsList, Text, DetailsListLayoutMode, CheckboxVisibility, IColumn } from 'office-ui-fabric-react'
55

6+
import { isMainWindow, getWinID } from 'services/remote'
7+
68
import { AppActions, StateWithDispatch } from 'states/stateProvider/reducer'
79
import { updateTransaction } from 'states/stateProvider/actionCreators'
810
import chainState from 'states/initStates/chain'
@@ -101,6 +103,11 @@ const Transaction = ({
101103
dispatch,
102104
}: React.PropsWithoutRef<StateWithDispatch & RouteComponentProps<{ hash: string }>>) => {
103105
const [t] = useTranslation()
106+
useEffect(() => {
107+
if ((walletID && !isMainWindow(getWinID())) || !walletID) {
108+
window.close()
109+
}
110+
}, [walletID])
104111

105112
useEffect(() => {
106113
dispatch({

packages/neuron-ui/src/components/WalletWizard/index.tsx

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1-
import React, { useCallback, useEffect } from 'react'
1+
import React, { useCallback, useEffect, useMemo } from 'react'
22
import { useTranslation } from 'react-i18next'
3-
import { Stack, Text, Label, Image, PrimaryButton, DefaultButton, TextField, FontSizes } from 'office-ui-fabric-react'
3+
import {
4+
Stack,
5+
Icon,
6+
Text,
7+
Label,
8+
Image,
9+
PrimaryButton,
10+
DefaultButton,
11+
TextField,
12+
FontSizes,
13+
} from 'office-ui-fabric-react'
414

515
import withWizard, { WizardElementProps, WithWizardState } from 'components/withWizard'
616
import { generateMnemonic, validateMnemonic, showErrorMessage } from 'services/remote'
717
import { createWalletWithMnemonic, importWalletWithMnemonic } from 'states/stateProvider/actionCreators'
818

919
import { Routes, MnemonicAction, BUTTON_GAP } from 'utils/const'
1020
import { buttonGrommetIconStyles } from 'utils/icons'
11-
import { verifyWalletSubmission } from 'utils/validators'
21+
import { verifyPasswordComplexity } from 'utils/validators'
1222

1323
export enum WalletWizardPath {
1424
Welcome = '/welcome',
@@ -243,7 +253,10 @@ const Submission = ({
243253
}
244254
}, [type, name, password, imported, history, dispatch])
245255

246-
const disableNext = !verifyWalletSubmission({ name, password, confirmPassword })
256+
const isNameUnused = useMemo(() => name && !wallets.find(w => w.name === name), [name, wallets])
257+
const isPwdComplex = useMemo(() => verifyPasswordComplexity(password) === true, [password])
258+
const isPwdSame = useMemo(() => password && password === confirmPassword, [password, confirmPassword])
259+
const disableNext = !(isNameUnused && isPwdComplex && isPwdSame)
247260

248261
return (
249262
<Stack verticalFill verticalAlign="center" horizontalAlign="stretch" tokens={{ childrenGap: 15 }}>
@@ -261,6 +274,21 @@ const Submission = ({
261274
</div>
262275
))}
263276

277+
<Stack>
278+
<Stack horizontal tokens={{ childrenGap: 3 }}>
279+
{isNameUnused ? <Icon iconName="Matched" /> : <Icon iconName="Unmatched" />}
280+
<Text variant="xSmall">{t('wizard.new-name')}</Text>
281+
</Stack>
282+
<Stack horizontal tokens={{ childrenGap: 3 }}>
283+
{isPwdComplex ? <Icon iconName="Matched" /> : <Icon iconName="Unmatched" />}
284+
<Text variant="xSmall">{t('wizard.complex-password')}</Text>
285+
</Stack>
286+
<Stack horizontal tokens={{ childrenGap: 3 }}>
287+
{isPwdSame ? <Icon iconName="Matched" /> : <Icon iconName="Unmatched" />}
288+
<Text variant="xSmall">{t('wizard.same-password')}</Text>
289+
</Stack>
290+
</Stack>
291+
264292
<Stack horizontal horizontalAlign="end" tokens={{ childrenGap: BUTTON_GAP }}>
265293
<DefaultButton onClick={history.goBack} text={t('wizard.back')} />
266294
<PrimaryButton onClick={onNext} disabled={disableNext} text={t('wizard.next')} />

packages/neuron-ui/src/containers/Main/hooks.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ export const useSubscription = ({
154154
updateTransaction({ walletID, hash: txHash })
155155
break
156156
}
157-
case 'wallet': {
157+
case 'current-wallet': {
158+
updateCurrentWallet()(dispatch)
159+
break
160+
}
161+
case 'wallets': {
158162
updateWalletList()(dispatch)
159163
updateCurrentWallet()(dispatch)
160164
break

packages/neuron-ui/src/locales/en.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@
4747
"set-wallet-name": "Give your new wallet a name",
4848
"set-a-strong-password-to-protect-your-wallet": "Create a strong password to protect your wallet",
4949
"wallet-suffix": "Wallet {{suffix}}",
50-
"write-down-seed": "Write down your wallet seed and save it in a safe place"
50+
"write-down-seed": "Write down your wallet seed and save it in a safe place",
51+
"new-name": "Use an unused name for the new wallet",
52+
"complex-password": "The password is a string of 8 to 50 characters consisting of three types of characters: uppercase letters, lowercase letters, numbers, and special symbols, and must start with a letter or a number.",
53+
"same-password": "The password and confirm password should be same"
5154
},
5255
"detail": {
5356
"more-transactions": "More"

packages/neuron-ui/src/locales/zh.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@
4747
"set-wallet-name": "为钱包设置名称",
4848
"set-a-strong-password-to-protect-your-wallet": "请设置一个强密码用于保护您的钱包",
4949
"wallet-suffix": "钱包 {{suffix}}",
50-
"write-down-seed": "请记下您的助记词并保存到安全的地方"
50+
"write-down-seed": "请记下您的助记词并保存到安全的地方",
51+
"new-name": "输入新的钱包名称",
52+
"complex-password": "密码为 8 至 50 位由大写字母、小写字母、数字、特殊符号中三类字符组成的字符串, 且必须以字母或者数字开头",
53+
"same-password": "两次输入密码应一致"
5154
},
5255
"detail": {
5356
"more-transactions": "更多交易记录"

packages/neuron-ui/src/services/remote/app.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@ export const showTransactionDetails = controllerMethodWrapper(CONTROLLER_NAME)(c
1616
controller.showTransactionDetails(hash)
1717
)
1818

19+
export const isMainWindow = controllerMethodWrapper(CONTROLLER_NAME)(controller => (winID: number) =>
20+
controller.isMainWindow(winID)
21+
)
22+
1923
export default {
2024
getNeuronWalletState,
2125
handleViewError,
2226
contextMenu,
2327
showTransactionDetails,
28+
isMainWindow,
2429
}

0 commit comments

Comments
 (0)