Skip to content

Commit 1fc1a0c

Browse files
authored
Merge pull request #745 from nervosnetwork/rc/v0.16.0-alpha.1
[ᚬmaster] Rc/v0.16.0 alpha.1
2 parents 7f85ccd + e3b975f commit 1fc1a0c

File tree

88 files changed

+1518
-1510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1518
-1510
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# [0.16.0-alpha.1](https://github.com/nervosnetwork/neuron/compare/v0.16.0-alpha.0...v0.16.0-alpha.1) (2019-07-26)
2+
3+
4+
### Bug Fixes
5+
6+
* **neuron-wallet:** check min capacity ([ad77232](https://github.com/nervosnetwork/neuron/commit/ad77232))
7+
8+
9+
### Features
10+
11+
* Trigger auto update on app launch ([a2ad858](https://github.com/nervosnetwork/neuron/commit/a2ad858))
12+
* **neuron-ui:** call generate mnemonic method from neuron-wallet in neuron-ui with remote module ([5a27c7b](https://github.com/nervosnetwork/neuron/commit/5a27c7b))
13+
* **neuron-ui:** call networks controller's methods by remote module ([c4bc431](https://github.com/nervosnetwork/neuron/commit/c4bc431))
14+
* **neuron-ui:** call transactions controller methods with remote module ([4751817](https://github.com/nervosnetwork/neuron/commit/4751817))
15+
* **neuron-ui:** remove UILayer ([f2f3145](https://github.com/nervosnetwork/neuron/commit/f2f3145))
16+
* **neuron-ui:** subscribe current network id from neuron-wallet in neuron-ui ([1173622](https://github.com/nervosnetwork/neuron/commit/1173622))
17+
* **package:** Rename package task to release, publish to GitHub ([e3d473e](https://github.com/nervosnetwork/neuron/commit/e3d473e))
18+
* call methods of app controller with remote module ([cdc93a0](https://github.com/nervosnetwork/neuron/commit/cdc93a0))
19+
* subscribe network list from neuron-wallet in neuron-ui ([b56ae1c](https://github.com/nervosnetwork/neuron/commit/b56ae1c))
20+
21+
22+

azure-pipelines.yml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ jobs:
104104
- script: yarn test:e2e
105105
name: Test
106106

107-
- job: Package
108-
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
107+
- job: Release
108+
condition: eq(variables['build.sourceBranch'], 'refs/heads/master')
109109
pool:
110110
vmImage: 'macos-10.14'
111111
steps:
@@ -127,27 +127,14 @@ jobs:
127127
displayName: 'Download Windows Signing Certificate'
128128
inputs:
129129
secureFile: Neuron_win.p12
130-
- script: yarn package
131-
name: Build
130+
- script: yarn release
131+
name: Release
132+
displayName: 'Sign and Release'
132133
env:
133134
CSC_LINK: $(macSiginingCertificate.secureFilePath)
134135
CSC_KEY_PASSWORD: $(macSiginingCertificatePassword)
135136
WIN_CSC_LINK: $(winSiginingCertificate.secureFilePath)
136137
WIN_CSC_KEY_PASSWORD: $(winSiginingCertificatePassword)
137138
APPLE_ID: $(appleId)
138139
APPLE_ID_PASSWORD: $(appleIdPassword)
139-
- task: GitHubRelease@0
140-
inputs:
141-
gitHubConnection: nervos-bot
142-
repositoryName: nervosnetwork/neuron
143-
action: edit
144-
tag: $(Build.SourceBranchName)
145-
assets: |
146-
$(Build.SourcesDirectory)/release/*.zip
147-
$(Build.SourcesDirectory)/release/*.dmg
148-
$(Build.SourcesDirectory)/release/*.exe
149-
$(Build.SourcesDirectory)/release/*.deb
150-
$(Build.SourcesDirectory)/release/*.AppImage
151-
assetUploadMode: replace
152-
isPreRelease: true
153-
addChangeLog: false
140+
GH_TOKEN: $(ghToken)

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.16.0-alpha.0",
5+
"version": "0.16.0-alpha.1",
66
"npmClient": "yarn",
77
"useWorkspaces": true
88
}

package.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22
"name": "@nervosnetwork/neuron",
33
"productName": "Neuron",
44
"description": "CKB Neuron Wallet",
5-
"version": "0.16.0-alpha.0",
5+
"version": "0.16.0-alpha.1",
66
"private": true,
77
"author": {
88
"name": "Nervos Core Dev",
99
"email": "dev@nervos.org",
1010
"url": "https://github.com/nervosnetwork/neuron"
1111
},
12+
"repository": {
13+
"type" : "git",
14+
"url" : "https://github.com/nervosnetwork/neuron"
15+
},
1216
"license": "MIT",
1317
"engines": {
1418
"node": ">= 12.0",
@@ -25,7 +29,7 @@
2529
"clean": "lerna run --stream clean",
2630
"prebuild": "yarn clean",
2731
"build": "lerna run --stream build",
28-
"package": "yarn build && ./scripts/copy-ui-files.sh && ./scripts/package.sh",
32+
"release": "yarn build && ./scripts/copy-ui-files.sh && ./scripts/release.sh",
2933
"test": "lerna run --parallel test",
3034
"test:e2e": "yarn build && ./scripts/copy-ui-files.sh && lerna run --parallel test:e2e",
3135
"lint": "lerna run --stream lint",
@@ -45,7 +49,6 @@
4549
"@typescript-eslint/parser": "1.10.2",
4650
"concurrently": "4.1.1",
4751
"cross-env": "5.2.0",
48-
"cz-conventional-changelog": "2.1.0",
4952
"eslint": "5.16.0",
5053
"eslint-config-airbnb": "17.1.0",
5154
"eslint-config-prettier": "4.3.0",
@@ -62,10 +65,5 @@
6265
"typescript": "3.5.3",
6366
"wait-on": "3.3.0"
6467
},
65-
"dependencies": {},
66-
"config": {
67-
"commitizen": {
68-
"path": "./node_modules/cz-conventional-changelog"
69-
}
70-
}
68+
"dependencies": {}
7169
}

packages/neuron-ui/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
{
22
"name": "@nervosnetwork/neuron-ui",
3-
"version": "0.16.0-alpha.0",
3+
"version": "0.16.0-alpha.1",
44
"private": true,
55
"author": {
66
"name": "Nervos Core Dev",
77
"email": "dev@nervos.org",
88
"url": "https://github.com/nervosnetwork/neuron"
99
},
10+
"repository": {
11+
"type" : "git",
12+
"url" : "https://github.com/nervosnetwork/neuron"
13+
},
1014
"homepage": "./",
1115
"main": "./build",
1216
"license": "MIT",

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

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useEffect, useMemo } from 'react'
22
import { RouteComponentProps } from 'react-router-dom'
33
import { useTranslation } from 'react-i18next'
44
import {
5-
DetailsList,
5+
ShimmeredDetailsList,
66
TextField,
77
IColumn,
88
DetailsListLayoutMode,
@@ -11,19 +11,21 @@ import {
1111
getTheme,
1212
} from 'office-ui-fabric-react'
1313

14+
import { contextMenu } from 'services/remote'
1415
import { StateWithDispatch } from 'states/stateProvider/reducer'
1516

16-
import { appCalls } from 'services/UILayer'
17-
1817
import { useLocalDescription } from 'utils/hooks'
1918
import { MIN_CELL_WIDTH, Routes } from 'utils/const'
2019
import { localNumberFormatter, shannonToCKBFormatter } from 'utils/formatters'
2120

2221
const Addresses = ({
23-
wallet: { id, addresses = [] },
22+
app: {
23+
loadings: { addressList: isLoading },
24+
},
25+
wallet: { addresses = [], id: walletID },
2426
settings: { showAddressBook = false },
25-
dispatch,
2627
history,
28+
dispatch,
2729
}: React.PropsWithoutRef<StateWithDispatch & RouteComponentProps>) => {
2830
const [t] = useTranslation()
2931
useEffect(() => {
@@ -34,7 +36,7 @@ const Addresses = ({
3436

3537
const { localDescription, onDescriptionPress, onDescriptionFieldBlur, onDescriptionChange } = useLocalDescription(
3638
'address',
37-
id,
39+
walletID,
3840
useMemo(
3941
() =>
4042
addresses.map(({ address: key = '', description = '' }) => ({
@@ -97,15 +99,17 @@ const Addresses = ({
9799
maxWidth: 350,
98100
isResizable: true,
99101
isCollapsible: false,
100-
onRender: (item?: State.Address, idx?: number) => {
101-
return item && undefined !== idx ? (
102+
onRender: (item?: State.Address) => {
103+
return item ? (
102104
<TextField
103105
borderless
104106
title={item.description}
105-
value={localDescription[idx] || ''}
106-
onKeyPress={onDescriptionPress(idx)}
107-
onBlur={onDescriptionFieldBlur(idx)}
108-
onChange={onDescriptionChange(idx)}
107+
value={
108+
(localDescription.find(local => local.key === item.address) || { description: '' }).description || ''
109+
}
110+
onKeyPress={onDescriptionPress(item.address)}
111+
onBlur={onDescriptionFieldBlur(item.address)}
112+
onChange={onDescriptionChange(item.address)}
109113
styles={(props: ITextFieldStyleProps) => {
110114
return {
111115
root: {
@@ -160,27 +164,14 @@ const Addresses = ({
160164
)
161165

162166
return (
163-
<DetailsList
167+
<ShimmeredDetailsList
168+
enableShimmer={isLoading}
164169
checkboxVisibility={CheckboxVisibility.hidden}
165170
layoutMode={DetailsListLayoutMode.justified}
166171
columns={addressColumns.map(col => ({ ...col, name: t(col.name) }))}
167172
items={addresses}
168173
onItemContextMenu={item => {
169-
appCalls.contextMenu({ type: 'addressList', id: item.identifier })
170-
}}
171-
styles={{
172-
contentWrapper: {
173-
selectors: {
174-
'.ms-DetailsRow-cell': {
175-
display: 'flex',
176-
alignItems: 'center',
177-
},
178-
'.text-overflow': {
179-
overflow: 'hidden',
180-
textOverflow: 'ellipsis',
181-
},
182-
},
183-
},
174+
contextMenu({ type: 'addressList', id: item.identifier })
184175
}}
185176
/>
186177
)

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import React, { Component } from 'react'
2-
import { appCalls } from 'services/UILayer'
32
import { Stack, Spinner } from 'office-ui-fabric-react'
3+
import { handleViewError } from 'services/remote'
44

55
const handleError = (error: Error) => {
6-
appCalls.handleViewError(error.toString())
7-
setTimeout(() => {
8-
window.location.reload()
9-
}, 0)
6+
handleViewError(error.toString())
7+
window.location.reload()
108
return { hasError: true }
119
}
1210

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { Stack, Toggle } from 'office-ui-fabric-react'
33
import { useTranslation } from 'react-i18next'
44

55
import { StateWithDispatch } from 'states/stateProvider/reducer'
6-
import actionCreators from 'states/stateProvider/actionCreators'
6+
import { toggleAddressBook } from 'states/stateProvider/actionCreators'
77

88
const GeneralSetting = ({ settings: { showAddressBook }, dispatch }: React.PropsWithoutRef<StateWithDispatch>) => {
99
const [t] = useTranslation()
1010
const onToggle = useCallback(() => {
11-
dispatch(actionCreators.toggleAddressBook())
11+
dispatch(toggleAddressBook())
1212
}, [dispatch])
1313
return (
1414
<Stack tokens={{ childrenGap: 15 }}>

packages/neuron-ui/src/components/History/hooks.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useState, useEffect } from 'react'
22
import { AppActions } from 'states/stateProvider/reducer'
3-
import actionCreators from 'states/stateProvider/actionCreators'
3+
import { updateTransactionList } from 'states/stateProvider/actionCreators/transactions'
44
import { queryParsers } from 'utils/parser'
55

66
const backToTop = () => {
@@ -31,8 +31,7 @@ export const useSearch = (search: string = '', walletID: string = '', dispatch:
3131
type: AppActions.CleanTransactions,
3232
payload: null,
3333
})
34-
35-
dispatch(actionCreators.getTransactions({ ...params, keywords: params.keywords, walletID }))
34+
updateTransactionList({ ...params, keywords: params.keywords, walletID })(dispatch)
3635
}, [search, walletID, dispatch])
3736
return { keywords, onKeywordsChange, setKeywords }
3837
}

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

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,20 @@
11
import React, { useCallback, useEffect } from 'react'
22
import { RouteComponentProps } from 'react-router-dom'
33
import { useTranslation } from 'react-i18next'
4-
import { Stack, SearchBox, getTheme } from 'office-ui-fabric-react'
4+
import { Stack, SearchBox } from 'office-ui-fabric-react'
55
import { Pagination } from '@uifabric/experiments'
6-
import {
7-
Search as SearchIcon,
8-
LinkDown as LinkDownIcon,
9-
LinkBottom as LinkBottomIcon,
10-
LinkTop as LinkTopIcon,
11-
LinkUp as LinkUpIcon,
12-
FormClose as ClearIcon,
13-
} from 'grommet-icons'
146

157
import TransactionList from 'components/TransactionList'
168
import { StateWithDispatch } from 'states/stateProvider/reducer'
179

1810
import { Routes } from 'utils/const'
19-
import { registerIcons } from 'utils/icons'
2011

2112
import { useSearch } from './hooks'
2213

23-
const theme = getTheme()
24-
const { semanticColors } = theme
25-
registerIcons({
26-
icons: {
27-
Search: <SearchIcon size="16px" color={semanticColors.menuIcon} />,
28-
FirstPage: <LinkTopIcon size="16px" color={semanticColors.menuIcon} style={{ transform: 'rotate(-90deg)' }} />,
29-
LastPage: <LinkBottomIcon size="16px" color={semanticColors.menuIcon} style={{ transform: 'rotate(-90deg)' }} />,
30-
PrevPage: <LinkUpIcon size="16px" color={semanticColors.menuIcon} style={{ transform: 'rotate(-90deg)' }} />,
31-
NextPage: <LinkDownIcon size="16px" color={semanticColors.menuIcon} style={{ transform: 'rotate(-90deg)' }} />,
32-
Clear: <ClearIcon size="16px" />,
33-
},
34-
})
35-
3614
const History = ({
15+
app: {
16+
loadings: { transactionList: isLoading },
17+
},
3718
wallet: { id },
3819
chain: {
3920
transactions: { pageNo = 1, pageSize = 15, totalCount = 0, items = [] },
@@ -64,7 +45,7 @@ const History = ({
6445
iconProps={{ iconName: 'Search', styles: { root: { height: '18px' } } }}
6546
/>
6647
</Stack>
67-
<TransactionList walletID={id} items={items} dispatch={dispatch} />
48+
<TransactionList isLoading={isLoading} walletID={id} items={items} dispatch={dispatch} />
6849
<Pagination
6950
selectedPageIndex={pageNo - 1}
7051
pageCount={Math.ceil(totalCount / pageSize)}

0 commit comments

Comments
 (0)