Skip to content

Commit

Permalink
Merge pull request #791 from nervosnetwork/rc/v0.17.0-alpha.3
Browse files Browse the repository at this point in the history
[ᚬmaster] Rc/v0.17.0 alpha.3
  • Loading branch information
ashchan authored Aug 1, 2019
2 parents 8beef45 + 16f6332 commit 73bd7af
Show file tree
Hide file tree
Showing 24 changed files with 249 additions and 172 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# [0.17.0-alpha.3](https://github.com/nervosnetwork/neuron/compare/v0.17.0-alpha.2...v0.17.0-alpha.3) (2019-08-01)


### Bug Fixes

* connection not found when delete wallet ([2afc7e7](https://github.com/nervosnetwork/neuron/commit/2afc7e7))
* Remove publisherName for win electron-builder configuration ([e1b3121](https://github.com/nervosnetwork/neuron/commit/e1b3121))
* Translation for installing update prompt message ([0540057](https://github.com/nervosnetwork/neuron/commit/0540057))


### Features

* **neuron-ui:** add the story of connection status component, and set the network name to 14px ([e940fdf](https://github.com/nervosnetwork/neuron/commit/e940fdf))
* Only bundle en and zh_CN language folders for mac ([6701659](https://github.com/nervosnetwork/neuron/commit/6701659))
* **neuron-ui:** double click on tx item shows its details ([383db66](https://github.com/nervosnetwork/neuron/commit/383db66))



# [0.17.0-alpha.2](https://github.com/nervosnetwork/neuron/compare/v0.17.0-alpha.1...v0.17.0-alpha.2) (2019-07-31)


Expand Down
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.17.0-alpha.2",
"version": "0.17.0-alpha.3",
"npmClient": "yarn",
"useWorkspaces": true
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "neuron",
"productName": "Neuron",
"description": "CKB Neuron Wallet",
"version": "0.17.0-alpha.2",
"version": "0.17.0-alpha.3",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neuron-ui",
"version": "0.17.0-alpha.2",
"version": "0.17.0-alpha.3",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down
5 changes: 4 additions & 1 deletion packages/neuron-ui/src/components/TransactionList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from 'office-ui-fabric-react'

import { StateDispatch } from 'states/stateProvider/reducer'
import { contextMenu } from 'services/remote'
import { contextMenu, showTransactionDetails } from 'services/remote'

import { useLocalDescription } from 'utils/hooks'
import { shannonToCKBFormatter, uniformTimeFormatter as timeFormatter, uniformTimeFormatter } from 'utils/formatters'
Expand Down Expand Up @@ -203,6 +203,9 @@ const TransactionList = ({
onRenderHeader,
}}
checkboxVisibility={CheckboxVisibility.hidden}
onItemInvoked={item => {
showTransactionDetails(item.hash)
}}
onItemContextMenu={item => {
if (item) {
contextMenu({ type: 'transactionList', id: item.hash })
Expand Down
11 changes: 10 additions & 1 deletion packages/neuron-ui/src/containers/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,16 @@ export const NetworkStatus = ({ name, online }: { name: string; online: boolean
iconName={online ? 'Connected' : 'Disconnected'}
styles={{ root: { display: 'flex', alignItems: 'center' } }}
/>
<Text styles={{ root: [theme.fonts.small] }}>{name}</Text>
<Text
styles={{
root: {
fontSize: '14px',
lineHeight: '14px',
},
}}
>
{name}
</Text>
</Stack>
)
}
Expand Down
71 changes: 1 addition & 70 deletions packages/neuron-ui/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,10 @@
import React from 'react'
import ReactDOM from 'react-dom'
import { HashRouter as Router, Route } from 'react-router-dom'
import { loadTheme, getTheme } from 'office-ui-fabric-react'
import {
AddCircle as AddIcon,
Alert as AlertIcon,
Checkmark as SuccessIcon,
Close as DismissIcon,
Copy as CopyIcon,
Down as ArrowDownIcon,
FormClose as ClearIcon,
FormAdd as CreateIcon,
FormPreviousLink as LeaveIcon,
FormUp as ExpandIcon,
FormUpload as ImportIcon,
LinkBottom as LinkBottomIcon,
LinkDown as LinkDownIcon,
LinkTop as LinkTopIcon,
LinkUp as LinkUpIcon,
Nodes as ConnectedIcon,
Scan as ScanIcon,
Search as SearchIcon,
SubtractCircle as RemoveIcon,
Update as UpdateIcon,
} from 'grommet-icons'

import 'styles/index.scss'
import 'utils/i18n'
import 'utils/loadTheme'
import * as serviceWorker from 'serviceWorker'

import Navbar from 'containers/Navbar'
Expand All @@ -35,53 +13,6 @@ import Main from 'containers/Main'
import Footer from 'containers/Footer'
import ErrorBoundary from 'components/ErrorBoundary'
import withProviders from 'states/stateProvider'
import { registerIcons } from 'utils/icons'

loadTheme({
fonts: {
tiny: { fontSize: '11px' },
xSmall: { fontSize: '12px' },
small: { fontSize: '14px' },
smallPlus: { fontSize: '15px' },
medium: { fontSize: '16px' },
mediumPlus: { fontSize: '17px' },
large: { fontSize: '18px' },
xLarge: { fontSize: '22px' },
xxLarge: { fontSize: '28px' },
superLarge: { fontSize: '42px' },
mega: { fontSize: '72px' },
},
})

const theme = getTheme()
const { semanticColors } = theme

registerIcons({
icons: {
errorbadge: <AlertIcon size="16px" />,
completed: <SuccessIcon size="16px" />,
MiniCopy: <CopyIcon size="small" />,
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)' }} />,
ArrowDown: <ArrowDownIcon size="small" />,
ChevronRightMed: <ExpandIcon size="16px" style={{ transform: 'rotate(90deg) translate(2px, 0px)' }} />,
Scan: <ScanIcon />,
Import: <ImportIcon color="white" />,
Create: <CreateIcon />,
Add: <AddIcon />,
Remove: <RemoveIcon color="red" />,
Copy: <CopyIcon />,
Clear: <ClearIcon size="16px" />,
Dismiss: <DismissIcon size="16px" />,
Leave: <LeaveIcon />,
Connected: <ConnectedIcon size="small" color="green" />,
Disconnected: <AlertIcon size="small" color="red" />,
Updating: <UpdateIcon size="16px" style={{ animation: 'rotate360 3s linear infinite' }} />,
},
})

export const containers: CustomRouter.Route[] = [
{
Expand Down
5 changes: 5 additions & 0 deletions packages/neuron-ui/src/services/remote/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ export const contextMenu = controllerMethodWrapper(CONTROLLER_NAME)(
controller => (params: { type: string; id: string }) => controller.contextMenu(params)
)

export const showTransactionDetails = controllerMethodWrapper(CONTROLLER_NAME)(controller => (hash: string) =>
controller.showTransactionDetails(hash)
)

export default {
getNeuronWalletState,
handleViewError,
contextMenu,
showTransactionDetails,
}
31 changes: 31 additions & 0 deletions packages/neuron-ui/src/stories/NetworkStatus.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react'
import { storiesOf } from '@storybook/react'
import { withKnobs, text, boolean } from '@storybook/addon-knobs'
import { NetworkStatus } from 'containers/Footer'

const states = {
Online: {
name: 'network name',
online: true,
},
Offline: {
name: 'network',
online: false,
},
}

const stories = storiesOf('Connection Status', module).addDecorator(withKnobs)

Object.entries(states).forEach(([title, props]) => {
stories.add(title, () => {
return <NetworkStatus {...props} />
})
})

stories.add('With knobs', () => {
const props = {
name: text('Network name', 'network name'),
online: boolean('online', false),
}
return <NetworkStatus {...props} />
})
7 changes: 5 additions & 2 deletions packages/neuron-ui/src/stories/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import 'styles/index.scss'
import './styles.scss'
import 'utils/i18n'
import 'utils/loadTheme'
import './Overview.stories'
import './Addresses.stories'
import './History.stories'
Expand All @@ -9,5 +13,4 @@ import './NetworkSetting.stories'
import './PasswordRequest.stories'
import './TransactionFeePanel.stories'
import './SyncStatus.stories'
import 'styles/index.scss'
import './styles.scss'
import './NetworkStatus.stories'
75 changes: 75 additions & 0 deletions packages/neuron-ui/src/utils/loadTheme.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import React from 'react'
import { loadTheme, getTheme } from 'office-ui-fabric-react'

import {
AddCircle as AddIcon,
Alert as AlertIcon,
Checkmark as SuccessIcon,
Close as DismissIcon,
Copy as CopyIcon,
Down as ArrowDownIcon,
FormClose as ClearIcon,
FormAdd as CreateIcon,
FormPreviousLink as LeaveIcon,
FormUp as ExpandIcon,
FormUpload as ImportIcon,
LinkBottom as LinkBottomIcon,
LinkDown as LinkDownIcon,
LinkTop as LinkTopIcon,
LinkUp as LinkUpIcon,
Nodes as ConnectedIcon,
Scan as ScanIcon,
Search as SearchIcon,
SubtractCircle as RemoveIcon,
Update as UpdateIcon,
} from 'grommet-icons'

import { registerIcons } from 'utils/icons'

loadTheme({
fonts: {
tiny: { fontSize: '11px' },
xSmall: { fontSize: '12px' },
small: { fontSize: '14px' },
smallPlus: { fontSize: '15px' },
medium: { fontSize: '16px' },
mediumPlus: { fontSize: '17px' },
large: { fontSize: '18px' },
xLarge: { fontSize: '22px' },
xxLarge: { fontSize: '28px' },
superLarge: { fontSize: '42px' },
mega: { fontSize: '72px' },
},
})

const theme = getTheme()
const { semanticColors } = theme

registerIcons({
icons: {
errorbadge: <AlertIcon size="16px" />,
completed: <SuccessIcon size="16px" />,
MiniCopy: <CopyIcon size="small" />,
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)' }} />,
ArrowDown: <ArrowDownIcon size="small" />,
ChevronRightMed: <ExpandIcon size="16px" style={{ transform: 'rotate(90deg) translate(2px, 0px)' }} />,
Scan: <ScanIcon />,
Import: <ImportIcon color="white" />,
Create: <CreateIcon />,
Add: <AddIcon />,
Remove: <RemoveIcon color="red" />,
Copy: <CopyIcon />,
Clear: <ClearIcon size="16px" />,
Dismiss: <DismissIcon size="16px" />,
Leave: <LeaveIcon />,
Connected: <ConnectedIcon size="small" color="green" />,
Disconnected: <AlertIcon size="small" color="red" />,
Updating: <UpdateIcon size="16px" style={{ animation: 'rotate360 3s linear infinite' }} />,
},
})

export default undefined
2 changes: 1 addition & 1 deletion packages/neuron-wallet/electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ dmg:
win:
artifactName: "${productName}-v${version}-${os}-${arch}-installer.${ext}"
icon: assets/images/icon.ico
publisherName: Nervos Foundation
target:
- target: nsis
arch:
Expand All @@ -58,6 +57,7 @@ mac:
gatekeeperAssess: false
entitlements: assets/entitlements.plist
entitlementsInherit: assets/entitlements.plist
electronLanguages: ["en", "zh", "zh_CN"]
target:
- dmg
- zip
Expand Down
4 changes: 2 additions & 2 deletions packages/neuron-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"productName": "Neuron",
"description": "CKB Neuron Wallet",
"homepage": "https://www.nervos.org/",
"version": "0.17.0-alpha.2",
"version": "0.17.0-alpha.3",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down Expand Up @@ -64,7 +64,7 @@
"electron-devtools-installer": "2.2.4",
"electron-notarize": "0.1.1",
"lint-staged": "9.2.0",
"neuron-ui": "0.17.0-alpha.2",
"neuron-ui": "0.17.0-alpha.3",
"rimraf": "2.6.3",
"spectron": "7.0.0"
}
Expand Down
2 changes: 2 additions & 0 deletions packages/neuron-wallet/src/database/chain/ormconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import env from '../../env'
import { InitMigration1561695143591 } from './migrations/1561695143591-InitMigration'
import { AddStatusToTx1562038960990 } from './migrations/1562038960990-AddStatusToTx'

export const CONNECTION_NOT_FOUND_NAME = 'ConnectionNotFoundError'

const dbPath = (networkName: string): string => {
const name = `cell-${networkName}.sqlite`
return path.join(env.fileBasePath, 'cells', name)
Expand Down
11 changes: 10 additions & 1 deletion packages/neuron-wallet/src/listeners/tx-status.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { remote } from 'electron'
import { interval } from 'rxjs'
import { getConnection } from 'typeorm'
import { TransactionStatus } from '../types/cell-types'
import LockUtils from '../models/lock-utils'
import AddressesUsedSubject from '../models/subjects/addresses-used-subject'
import { FailedTransaction } from '../services/tx'
import { CONNECTION_NOT_FOUND_NAME } from '../database/chain/ormconfig'

const { nodeService } = remote.require('./startup/sync-block-task/params')

Expand Down Expand Up @@ -47,7 +49,14 @@ const trackingStatus = async () => {
export const register = () => {
// every 5 seconds
interval(5000).subscribe(async () => {
await trackingStatus()
try {
getConnection()
await trackingStatus()
} catch (err) {
if (err.name !== CONNECTION_NOT_FOUND_NAME) {
throw err
}
}
})
}

Expand Down
3 changes: 1 addition & 2 deletions packages/neuron-wallet/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ export default {
'update-not-available': 'There are currently no updates available.',
'updates-found-do-you-want-to-update': 'An update is available, do you want to update now?',
'update-now': 'Update now',
'updates-downloaded-about-to-quit-and-install':
'Update downloaded. Neuron will quit and install the the update...',
'updates-downloaded-about-to-quit-and-install': 'Update downloaded. Neuron will quit and install the update...',
},
common: {
yes: 'Yes',
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-wallet/src/services/cells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Cell, OutPoint, Input } from '../types/cell-types'
import { CapacityNotEnough } from '../exceptions'
import { OutputStatus } from './tx/params'

export const MIN_CELL_CAPACITY = '6000000000'
export const MIN_CELL_CAPACITY = '6100000000'

/* eslint @typescript-eslint/no-unused-vars: "warn" */
/* eslint no-await-in-loop: "warn" */
Expand Down
Loading

0 comments on commit 73bd7af

Please sign in to comment.