Skip to content

Commit

Permalink
Merge pull request #745 from nervosnetwork/rc/v0.16.0-alpha.1
Browse files Browse the repository at this point in the history
[ᚬmaster] Rc/v0.16.0 alpha.1
  • Loading branch information
ashchan authored Jul 26, 2019
2 parents 7f85ccd + e3b975f commit 1fc1a0c
Show file tree
Hide file tree
Showing 88 changed files with 1,518 additions and 1,510 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# [0.16.0-alpha.1](https://github.com/nervosnetwork/neuron/compare/v0.16.0-alpha.0...v0.16.0-alpha.1) (2019-07-26)


### Bug Fixes

* **neuron-wallet:** check min capacity ([ad77232](https://github.com/nervosnetwork/neuron/commit/ad77232))


### Features

* Trigger auto update on app launch ([a2ad858](https://github.com/nervosnetwork/neuron/commit/a2ad858))
* **neuron-ui:** call generate mnemonic method from neuron-wallet in neuron-ui with remote module ([5a27c7b](https://github.com/nervosnetwork/neuron/commit/5a27c7b))
* **neuron-ui:** call networks controller's methods by remote module ([c4bc431](https://github.com/nervosnetwork/neuron/commit/c4bc431))
* **neuron-ui:** call transactions controller methods with remote module ([4751817](https://github.com/nervosnetwork/neuron/commit/4751817))
* **neuron-ui:** remove UILayer ([f2f3145](https://github.com/nervosnetwork/neuron/commit/f2f3145))
* **neuron-ui:** subscribe current network id from neuron-wallet in neuron-ui ([1173622](https://github.com/nervosnetwork/neuron/commit/1173622))
* **package:** Rename package task to release, publish to GitHub ([e3d473e](https://github.com/nervosnetwork/neuron/commit/e3d473e))
* call methods of app controller with remote module ([cdc93a0](https://github.com/nervosnetwork/neuron/commit/cdc93a0))
* subscribe network list from neuron-wallet in neuron-ui ([b56ae1c](https://github.com/nervosnetwork/neuron/commit/b56ae1c))



25 changes: 6 additions & 19 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ jobs:
- script: yarn test:e2e
name: Test

- job: Package
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
- job: Release
condition: eq(variables['build.sourceBranch'], 'refs/heads/master')
pool:
vmImage: 'macos-10.14'
steps:
Expand All @@ -127,27 +127,14 @@ jobs:
displayName: 'Download Windows Signing Certificate'
inputs:
secureFile: Neuron_win.p12
- script: yarn package
name: Build
- script: yarn release
name: Release
displayName: 'Sign and Release'
env:
CSC_LINK: $(macSiginingCertificate.secureFilePath)
CSC_KEY_PASSWORD: $(macSiginingCertificatePassword)
WIN_CSC_LINK: $(winSiginingCertificate.secureFilePath)
WIN_CSC_KEY_PASSWORD: $(winSiginingCertificatePassword)
APPLE_ID: $(appleId)
APPLE_ID_PASSWORD: $(appleIdPassword)
- task: GitHubRelease@0
inputs:
gitHubConnection: nervos-bot
repositoryName: nervosnetwork/neuron
action: edit
tag: $(Build.SourceBranchName)
assets: |
$(Build.SourcesDirectory)/release/*.zip
$(Build.SourcesDirectory)/release/*.dmg
$(Build.SourcesDirectory)/release/*.exe
$(Build.SourcesDirectory)/release/*.deb
$(Build.SourcesDirectory)/release/*.AppImage
assetUploadMode: replace
isPreRelease: true
addChangeLog: false
GH_TOKEN: $(ghToken)
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": [
"packages/*"
],
"version": "0.16.0-alpha.0",
"version": "0.16.0-alpha.1",
"npmClient": "yarn",
"useWorkspaces": true
}
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
"name": "@nervosnetwork/neuron",
"productName": "Neuron",
"description": "CKB Neuron Wallet",
"version": "0.16.0-alpha.0",
"version": "0.16.0-alpha.1",
"private": true,
"author": {
"name": "Nervos Core Dev",
"email": "[email protected]",
"url": "https://github.com/nervosnetwork/neuron"
},
"repository": {
"type" : "git",
"url" : "https://github.com/nervosnetwork/neuron"
},
"license": "MIT",
"engines": {
"node": ">= 12.0",
Expand All @@ -25,7 +29,7 @@
"clean": "lerna run --stream clean",
"prebuild": "yarn clean",
"build": "lerna run --stream build",
"package": "yarn build && ./scripts/copy-ui-files.sh && ./scripts/package.sh",
"release": "yarn build && ./scripts/copy-ui-files.sh && ./scripts/release.sh",
"test": "lerna run --parallel test",
"test:e2e": "yarn build && ./scripts/copy-ui-files.sh && lerna run --parallel test:e2e",
"lint": "lerna run --stream lint",
Expand All @@ -45,7 +49,6 @@
"@typescript-eslint/parser": "1.10.2",
"concurrently": "4.1.1",
"cross-env": "5.2.0",
"cz-conventional-changelog": "2.1.0",
"eslint": "5.16.0",
"eslint-config-airbnb": "17.1.0",
"eslint-config-prettier": "4.3.0",
Expand All @@ -62,10 +65,5 @@
"typescript": "3.5.3",
"wait-on": "3.3.0"
},
"dependencies": {},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
"dependencies": {}
}
6 changes: 5 additions & 1 deletion packages/neuron-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"name": "@nervosnetwork/neuron-ui",
"version": "0.16.0-alpha.0",
"version": "0.16.0-alpha.1",
"private": true,
"author": {
"name": "Nervos Core Dev",
"email": "[email protected]",
"url": "https://github.com/nervosnetwork/neuron"
},
"repository": {
"type" : "git",
"url" : "https://github.com/nervosnetwork/neuron"
},
"homepage": "./",
"main": "./build",
"license": "MIT",
Expand Down
47 changes: 19 additions & 28 deletions packages/neuron-ui/src/components/Addresses/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useMemo } from 'react'
import { RouteComponentProps } from 'react-router-dom'
import { useTranslation } from 'react-i18next'
import {
DetailsList,
ShimmeredDetailsList,
TextField,
IColumn,
DetailsListLayoutMode,
Expand All @@ -11,19 +11,21 @@ import {
getTheme,
} from 'office-ui-fabric-react'

import { contextMenu } from 'services/remote'
import { StateWithDispatch } from 'states/stateProvider/reducer'

import { appCalls } from 'services/UILayer'

import { useLocalDescription } from 'utils/hooks'
import { MIN_CELL_WIDTH, Routes } from 'utils/const'
import { localNumberFormatter, shannonToCKBFormatter } from 'utils/formatters'

const Addresses = ({
wallet: { id, addresses = [] },
app: {
loadings: { addressList: isLoading },
},
wallet: { addresses = [], id: walletID },
settings: { showAddressBook = false },
dispatch,
history,
dispatch,
}: React.PropsWithoutRef<StateWithDispatch & RouteComponentProps>) => {
const [t] = useTranslation()
useEffect(() => {
Expand All @@ -34,7 +36,7 @@ const Addresses = ({

const { localDescription, onDescriptionPress, onDescriptionFieldBlur, onDescriptionChange } = useLocalDescription(
'address',
id,
walletID,
useMemo(
() =>
addresses.map(({ address: key = '', description = '' }) => ({
Expand Down Expand Up @@ -97,15 +99,17 @@ const Addresses = ({
maxWidth: 350,
isResizable: true,
isCollapsible: false,
onRender: (item?: State.Address, idx?: number) => {
return item && undefined !== idx ? (
onRender: (item?: State.Address) => {
return item ? (
<TextField
borderless
title={item.description}
value={localDescription[idx] || ''}
onKeyPress={onDescriptionPress(idx)}
onBlur={onDescriptionFieldBlur(idx)}
onChange={onDescriptionChange(idx)}
value={
(localDescription.find(local => local.key === item.address) || { description: '' }).description || ''
}
onKeyPress={onDescriptionPress(item.address)}
onBlur={onDescriptionFieldBlur(item.address)}
onChange={onDescriptionChange(item.address)}
styles={(props: ITextFieldStyleProps) => {
return {
root: {
Expand Down Expand Up @@ -160,27 +164,14 @@ const Addresses = ({
)

return (
<DetailsList
<ShimmeredDetailsList
enableShimmer={isLoading}
checkboxVisibility={CheckboxVisibility.hidden}
layoutMode={DetailsListLayoutMode.justified}
columns={addressColumns.map(col => ({ ...col, name: t(col.name) }))}
items={addresses}
onItemContextMenu={item => {
appCalls.contextMenu({ type: 'addressList', id: item.identifier })
}}
styles={{
contentWrapper: {
selectors: {
'.ms-DetailsRow-cell': {
display: 'flex',
alignItems: 'center',
},
'.text-overflow': {
overflow: 'hidden',
textOverflow: 'ellipsis',
},
},
},
contextMenu({ type: 'addressList', id: item.identifier })
}}
/>
)
Expand Down
8 changes: 3 additions & 5 deletions packages/neuron-ui/src/components/ErrorBoundary/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import React, { Component } from 'react'
import { appCalls } from 'services/UILayer'
import { Stack, Spinner } from 'office-ui-fabric-react'
import { handleViewError } from 'services/remote'

const handleError = (error: Error) => {
appCalls.handleViewError(error.toString())
setTimeout(() => {
window.location.reload()
}, 0)
handleViewError(error.toString())
window.location.reload()
return { hasError: true }
}

Expand Down
4 changes: 2 additions & 2 deletions packages/neuron-ui/src/components/GeneralSetting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { Stack, Toggle } from 'office-ui-fabric-react'
import { useTranslation } from 'react-i18next'

import { StateWithDispatch } from 'states/stateProvider/reducer'
import actionCreators from 'states/stateProvider/actionCreators'
import { toggleAddressBook } from 'states/stateProvider/actionCreators'

const GeneralSetting = ({ settings: { showAddressBook }, dispatch }: React.PropsWithoutRef<StateWithDispatch>) => {
const [t] = useTranslation()
const onToggle = useCallback(() => {
dispatch(actionCreators.toggleAddressBook())
dispatch(toggleAddressBook())
}, [dispatch])
return (
<Stack tokens={{ childrenGap: 15 }}>
Expand Down
5 changes: 2 additions & 3 deletions packages/neuron-ui/src/components/History/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useEffect } from 'react'
import { AppActions } from 'states/stateProvider/reducer'
import actionCreators from 'states/stateProvider/actionCreators'
import { updateTransactionList } from 'states/stateProvider/actionCreators/transactions'
import { queryParsers } from 'utils/parser'

const backToTop = () => {
Expand Down Expand Up @@ -31,8 +31,7 @@ export const useSearch = (search: string = '', walletID: string = '', dispatch:
type: AppActions.CleanTransactions,
payload: null,
})

dispatch(actionCreators.getTransactions({ ...params, keywords: params.keywords, walletID }))
updateTransactionList({ ...params, keywords: params.keywords, walletID })(dispatch)
}, [search, walletID, dispatch])
return { keywords, onKeywordsChange, setKeywords }
}
Expand Down
29 changes: 5 additions & 24 deletions packages/neuron-ui/src/components/History/index.tsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,20 @@
import React, { useCallback, useEffect } from 'react'
import { RouteComponentProps } from 'react-router-dom'
import { useTranslation } from 'react-i18next'
import { Stack, SearchBox, getTheme } from 'office-ui-fabric-react'
import { Stack, SearchBox } from 'office-ui-fabric-react'
import { Pagination } from '@uifabric/experiments'
import {
Search as SearchIcon,
LinkDown as LinkDownIcon,
LinkBottom as LinkBottomIcon,
LinkTop as LinkTopIcon,
LinkUp as LinkUpIcon,
FormClose as ClearIcon,
} from 'grommet-icons'

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

import { Routes } from 'utils/const'
import { registerIcons } from 'utils/icons'

import { useSearch } from './hooks'

const theme = getTheme()
const { semanticColors } = theme
registerIcons({
icons: {
Search: <SearchIcon size="16px" color={semanticColors.menuIcon} />,
FirstPage: <LinkTopIcon size="16px" color={semanticColors.menuIcon} style={{ transform: 'rotate(-90deg)' }} />,
LastPage: <LinkBottomIcon size="16px" color={semanticColors.menuIcon} style={{ transform: 'rotate(-90deg)' }} />,
PrevPage: <LinkUpIcon size="16px" color={semanticColors.menuIcon} style={{ transform: 'rotate(-90deg)' }} />,
NextPage: <LinkDownIcon size="16px" color={semanticColors.menuIcon} style={{ transform: 'rotate(-90deg)' }} />,
Clear: <ClearIcon size="16px" />,
},
})

const History = ({
app: {
loadings: { transactionList: isLoading },
},
wallet: { id },
chain: {
transactions: { pageNo = 1, pageSize = 15, totalCount = 0, items = [] },
Expand Down Expand Up @@ -64,7 +45,7 @@ const History = ({
iconProps={{ iconName: 'Search', styles: { root: { height: '18px' } } }}
/>
</Stack>
<TransactionList walletID={id} items={items} dispatch={dispatch} />
<TransactionList isLoading={isLoading} walletID={id} items={items} dispatch={dispatch} />
<Pagination
selectedPageIndex={pageNo - 1}
pageCount={Math.ceil(totalCount / pageSize)}
Expand Down
Loading

0 comments on commit 1fc1a0c

Please sign in to comment.