Skip to content
Permalink
Browse files

Merge branch 'feature/ddw-983-implement-transfer-funds-wizard-for-inc…

…entivized-testnet' of github.com:input-output-hk/daedalus into feature/ddw-983-implement-transfer-funds-wizard-for-incentivized-testnet
  • Loading branch information...
tomothespian committed Nov 8, 2019
2 parents e74eb14 + 2641c57 commit 483193791966c90a2d1db3288d6c81ac8863db99
@@ -68,7 +68,9 @@ API docs for pinned cardano-wallet version: https://input-output-hk.github.io/ca
### Updating Upstream Dependencies (cardano-wallet & Jormungandr)
Niv is used to manage the version of upstream dependencies. The versions of these dependencies can be seen in `nix/sources.json`.

Dependencies are updated with the follow nix command: `nix-shell -A devops --run "niv update cardano-wallet"`
Dependencies are updated with the follow nix command:
- Update to the latest master: `nix-shell -A devops --run "niv update cardano-wallet"`
- Update to a specific revision: `nix-shell -A devops --run "niv update cardano-wallet -a rev=1988f22895c45e12506ec83da0496ebdcdd17719"`

## Connect to staging cluster:

@@ -29,10 +29,10 @@
"homepage": null,
"owner": "input-output-hk",
"repo": "cardano-wallet",
"rev": "1988f22895c45e12506ec83da0496ebdcdd17719",
"sha256": "187fnmvqc0x1h3wzd2yhlw4ma7rl6r0j0zc0l2wldwfsbpbzqjb4",
"rev": "bd3d5897659b32abbde77298cb7c665cd29fb3d5",
"sha256": "1gsk335705crpi5sz2fsakjvnyw6mk7hb2wycy984gab1xrlzz4f",
"type": "tarball",
"url": "https://github.com/input-output-hk/cardano-wallet/archive/1988f22895c45e12506ec83da0496ebdcdd17719.tar.gz",
"url": "https://github.com/input-output-hk/cardano-wallet/archive/bd3d5897659b32abbde77298cb7c665cd29fb3d5.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz",
"version": "v2019-10-16"
},
@@ -66,10 +66,10 @@
"homepage": null,
"owner": "input-output-hk",
"repo": "iohk-nix",
"rev": "186acafb0053ca1a06614aa596f00cf12f9ee81d",
"sha256": "0bssy5098gx7d5i8wx42bk60p5pa2m34rvj9mc7f09s3ajd78cvf",
"rev": "8f1720d5890b59781a0eb7b996f8ea33cbf02850",
"sha256": "1b29krkkaqz7amwha91paa9sb4i52qjkymr0vh8rprpdkjhag1nz",
"type": "tarball",
"url": "https://github.com/input-output-hk/iohk-nix/archive/186acafb0053ca1a06614aa596f00cf12f9ee81d.tar.gz",
"url": "https://github.com/input-output-hk/iohk-nix/archive/8f1720d5890b59781a0eb7b996f8ea33cbf02850.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"js-chain-libs": {
@@ -17,6 +17,8 @@ type Props = {
children?: ?Node,
activeWallet?: ?Wallet,
onTransferFunds?: Function,
onWalletAdd?: Function,
hasAnyWallets?: boolean,
};

@observer
@@ -27,14 +29,27 @@ export default class TopBar extends Component<Props> {
leftIcon,
activeWallet,
children,
hasAnyWallets,
onTransferFunds,
onWalletAdd,
} = this.props;

const topBarStyles = classNames([
styles.topBar,
activeWallet ? styles.withWallet : styles.withoutWallet,
]);

const hasLegacyNotification =
activeWallet &&
activeWallet.isLegacy &&
activeWallet.amount > 0 &&
((hasAnyWallets && onTransferFunds) || onWalletAdd);

const onTransferFundsFn =
onTransferFunds && activeWallet
? () => onTransferFunds(activeWallet.id)
: () => {};

const topBarTitle = activeWallet ? (
<span className={styles.walletInfo}>
<span className={styles.walletName}>
@@ -69,10 +84,12 @@ export default class TopBar extends Component<Props> {
)}
{children}
</div>
{activeWallet && activeWallet.isLegacy && onTransferFunds && (
{hasLegacyNotification && (
<LegacyNotification
onLearnMore={() => null}
onTransferFunds={() => onTransferFunds(activeWallet.id)}
onTransferFunds={onTransferFundsFn}
hasAnyWallets={hasAnyWallets}
onWalletAdd={onWalletAdd}
/>
)}
</header>
@@ -29,11 +29,18 @@ const messages = defineMessages({
defaultMessage: '!!!Move all of the ada from this wallet',
description: 'Move all ada action of legacy notification.',
},
addWallet: {
id: 'wallet.legacy.notification.addWallet',
defaultMessage: '!!!Move all of the ada from this wallet',
description: 'Add wallet action of legacy notification.',
},
});

type Props = {
onLearnMore: Function,
onTransferFunds: Function,
hasAnyWallets?: boolean,
onWalletAdd?: boolean,
};

@observer
@@ -44,11 +51,21 @@ export default class LegacyNotification extends Component<Props> {

render() {
const { intl } = this.context;
const { onLearnMore, onTransferFunds } = this.props;
const {
onLearnMore,
onTransferFunds,
hasAnyWallets,
onWalletAdd,
} = this.props;
const title = intl.formatMessage(messages.title);
const description = intl.formatMessage(messages.description);
const actionLearnMore = intl.formatMessage(messages.actionLearnMore);
const actionMove = intl.formatMessage(messages.actionMove);

const buttonLabel = hasAnyWallets
? intl.formatMessage(messages.actionMove)
: intl.formatMessage(messages.addWallet);

const buttonAction = hasAnyWallets ? onTransferFunds : onWalletAdd;

return (
<div className={styles.component}>
@@ -61,12 +78,14 @@ export default class LegacyNotification extends Component<Props> {
onClick={onLearnMore}
skin={ButtonSkin}
/>
<Button
className={styles.actionMove}
label={actionMove}
onClick={onTransferFunds}
skin={ButtonSkin}
/>
{
<Button
className={styles.actionMove}
label={buttonLabel}
onClick={buttonAction}
skin={ButtonSkin}
/>
}
</div>
</div>
);
@@ -41,6 +41,10 @@ export default class TopBarContainer extends Component<Props> {
<WalletTestEnvironmentLabel network={network} />
) : null;

const onWalletAdd = actions.router.goToRoute.trigger({
route: ROUTES.WALLETS.ADD,
});

const onTransferFunds = (sourceWalletId: string) =>
actions.wallets.transferFundsSetSourceWalletId.trigger({
sourceWalletId,
@@ -55,6 +59,8 @@ export default class TopBarContainer extends Component<Props> {
onLeftIconClick={actions.sidebar.toggleSubMenus.trigger}
activeWallet={activeWallet}
onTransferFunds={onTransferFunds}
hasAnyWallets={hasAnyWallets}
onWalletAdd={onWalletAdd}
>
{testnetLabel}
<NodeSyncStatusIcon networkStatus={networkStatus} />
@@ -35,7 +35,7 @@ export default class WalletAddPage extends Component<Props> {
environment: { isMainnet, isTestnet },
} = app;

const walletCreationAction = useNewWalletCreationProcess
const onWalletAdd = useNewWalletCreationProcess
? () => actions.wallets.createWalletBegin.trigger()
: // TODO: Remove once the new wallet creation process is ready
() => actions.dialogs.open.trigger({ dialog: WalletCreateDialog });
@@ -59,7 +59,7 @@ export default class WalletAddPage extends Component<Props> {
<WalletAdd
isMainnet={isMainnet}
isTestnet={isTestnet}
onCreate={walletCreationAction}
onCreate={onWalletAdd}
onRestore={() =>
actions.dialogs.open.trigger({ dialog: WalletRestoreDialog })
}
@@ -457,6 +457,7 @@
"wallet.legacy.badge.label": "!!!Legacy",
"wallet.legacy.notification.actionLearnMore": "!!!Learn more",
"wallet.legacy.notification.actionMove": "!!!Move all of the ada from this wallet",
"wallet.legacy.notification.addWallet": "!!!Move all of the ada from this wallet",
"wallet.legacy.notification.description": "!!!This is a legacy wallet which uses legacy addresses and does not support new features. Please move all of the ada from this legacy wallet to one of the wallets where new features are available. You can also create a brand new wallet for your ada in case you don’t want to move ada to one of your existing wallets. A sequence of screens will guide you through the process.",
"wallet.legacy.notification.title": "!!!Move funds from the legacy wallet",
"wallet.navigation.more": "!!!More",
@@ -1348,6 +1348,20 @@
"column": 14,
"line": 27
}
},
{
"defaultMessage": "!!!Move all of the ada from this wallet",
"description": "Add wallet action of legacy notification.",
"end": {
"column": 3,
"line": 36
},
"file": "source/renderer/app/components/notifications/LegacyNotification.js",
"id": "wallet.legacy.notification.addWallet",
"start": {
"column": 13,
"line": 32
}
}
],
"path": "source/renderer/app/components/notifications/LegacyNotification.json"
@@ -7040,125 +7054,125 @@
"description": "Title in the transfer funds form.",
"end": {
"column": 3,
"line": 22
"line": 26
},
"file": "source/renderer/app/components/wallet/transfer-funds/TransferFundsStep2Dialog.js",
"id": "wallet.transferFunds.dialog2.title",
"start": {
"column": 15,
"line": 18
"line": 22
}
},
{
"defaultMessage": "!!!Confirm transfer from the {sourceWalletName}wallet to the {targetWalletName} wallet.",
"description": "description in the transfer funds form.",
"end": {
"column": 3,
"line": 28
"line": 32
},
"file": "source/renderer/app/components/wallet/transfer-funds/TransferFundsStep2Dialog.js",
"id": "wallet.transferFunds.dialog2.label.description",
"start": {
"column": 15,
"line": 23
"line": 27
}
},
{
"defaultMessage": "!!!To",
"description": "Label To in the transfer funds form",
"end": {
"column": 3,
"line": 33
"line": 37
},
"file": "source/renderer/app/components/wallet/transfer-funds/TransferFundsStep2Dialog.js",
"id": "wallet.transferFunds.dialog2.label.to",
"start": {
"column": 11,
"line": 29
"line": 33
}
},
{
"defaultMessage": "!!!Amount",
"description": "Label Amount in the transfer funds form",
"end": {
"column": 3,
"line": 38
"line": 42
},
"file": "source/renderer/app/components/wallet/transfer-funds/TransferFundsStep2Dialog.js",
"id": "wallet.transferFunds.dialog2.label.amount",
"start": {
"column": 15,
"line": 34
"line": 38
}
},
{
"defaultMessage": "!!!Fees",
"description": "Label Fees in the transfer funds form",
"end": {
"column": 3,
"line": 43
"line": 47
},
"file": "source/renderer/app/components/wallet/transfer-funds/TransferFundsStep2Dialog.js",
"id": "wallet.transferFunds.dialog2.label.fees",
"start": {
"column": 13,
"line": 39
"line": 43
}
},
{
"defaultMessage": "!!!Total",
"description": "Total Fees in the transfer funds form",
"end": {
"column": 3,
"line": 48
"line": 52
},
"file": "source/renderer/app/components/wallet/transfer-funds/TransferFundsStep2Dialog.js",
"id": "wallet.transferFunds.dialog2.label.total",
"start": {
"column": 14,
"line": 44
"line": 48
}
},
{
"defaultMessage": "!!!Transfer funds",
"description": "buttonLabel in the transfer funds form.",
"end": {
"column": 3,
"line": 53
"line": 57
},
"file": "source/renderer/app/components/wallet/transfer-funds/TransferFundsStep2Dialog.js",
"id": "wallet.transferFunds.dialog2.label.buttonLabel",
"start": {
"column": 15,
"line": 49
"line": 53
}
},
{
"defaultMessage": "!!!Type your spending password",
"description": "passphraseFieldPlaceholder in the transfer funds form.",
"end": {
"column": 3,
"line": 58
"line": 62
},
"file": "source/renderer/app/components/wallet/transfer-funds/TransferFundsStep2Dialog.js",
"id": "wallet.transferFunds.dialog2.passphraseFieldPlaceholder",
"start": {
"column": 30,
"line": 54
"line": 58
}
},
{
"defaultMessage": "!!!Spending password",
"description": "passphraseLabel in the transfer funds form.",
"end": {
"column": 3,
"line": 63
"line": 67
},
"file": "source/renderer/app/components/wallet/transfer-funds/TransferFundsStep2Dialog.js",
"id": "wallet.transferFunds.dialog2.passphraseLabel",
"start": {
"column": 19,
"line": 59
"line": 63
}
}
],
@@ -457,6 +457,7 @@
"wallet.legacy.badge.label": "Legacy",
"wallet.legacy.notification.actionLearnMore": "Learn more",
"wallet.legacy.notification.actionMove": "Move all of the ada from this wallet",
"wallet.legacy.notification.addWallet": "Add wallet",
"wallet.legacy.notification.description": "This is a legacy wallet which uses legacy addresses and does not support new features. Please move all of the ada from this legacy wallet to one of the wallets where new features are available. You can also create a brand new wallet for your ada in case you don’t want to move ada to one of your existing wallets. A sequence of screens will guide you through the process.",
"wallet.legacy.notification.title": "Move funds from the legacy wallet",
"wallet.navigation.more": "More",
@@ -457,6 +457,7 @@
"wallet.legacy.badge.label": "!!!Legacy",
"wallet.legacy.notification.actionLearnMore": "!!!Learn more",
"wallet.legacy.notification.actionMove": "!!!Move all of the ada from this wallet",
"wallet.legacy.notification.addWallet": "!!!Move all of the ada from this wallet",
"wallet.legacy.notification.description": "!!!This is a legacy wallet which uses legacy addresses and does not support new features. Please move all of the ada from this legacy wallet to one of the wallets where new features are available. You can also create a brand new wallet for your ada in case you don’t want to move ada to one of your existing wallets. A sequence of screens will guide you through the process.",
"wallet.legacy.notification.title": "!!!Move funds from the legacy wallet",
"wallet.navigation.more": "!!!More",
@@ -457,6 +457,7 @@
"wallet.legacy.badge.label": "",
"wallet.legacy.notification.actionLearnMore": "もっと知る",
"wallet.legacy.notification.actionMove": "すべてのADAをこのウォレットから移す",
"wallet.legacy.notification.addWallet": "ウォレットを追加",
"wallet.legacy.notification.description": "これは旧アドレスを使用している旧タイプのウォレットであり、新機能をサポートしていません。 このウォレットに含まれるすべてのADAを、新機能の使用が可能な新タイプのウォレットに移してください。既存のウォレットへ移動させたくない場合は、新規にウォレットを作成することもできます。画面の指示に従って手続きをしてください。",
"wallet.legacy.notification.title": "旧ウォレットから資金を移してください",
"wallet.navigation.more": "その他",
@@ -457,6 +457,7 @@
"wallet.legacy.badge.label": "!!!Legacy",
"wallet.legacy.notification.actionLearnMore": "!!!Learn more",
"wallet.legacy.notification.actionMove": "!!!Move all of the ada from this wallet",
"wallet.legacy.notification.addWallet": "!!!Move all of the ada from this wallet",
"wallet.legacy.notification.description": "!!!This is a legacy wallet which uses legacy addresses and does not support new features. Please move all of the ada from this legacy wallet to one of the wallets where new features are available. You can also create a brand new wallet for your ada in case you don’t want to move ada to one of your existing wallets. A sequence of screens will guide you through the process.",
"wallet.legacy.notification.title": "!!!Move funds from the legacy wallet",
"wallet.navigation.more": "!!!More",

0 comments on commit 4831937

Please sign in to comment.
You can’t perform that action at this time.