View on GitHub
File Changes
m
+3/-1
### 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:

                      
        "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"
    },
        "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": {
  children?: ?Node,
  activeWallet?: ?Wallet,
  onTransferFunds?: Function,
+
  onWalletAdd?: Function,
+
  hasAnyWallets?: boolean,
};

                      
@observer
      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}>
          )}
          {children}
        </div>
-
        {activeWallet && activeWallet.isLegacy && onTransferFunds && (
+
        {hasLegacyNotification && (
          <LegacyNotification
            onLearnMore={() => null}
-
            onTransferFunds={() => onTransferFunds(activeWallet.id)}
+
            onTransferFunds={onTransferFundsFn}
+
            hasAnyWallets={hasAnyWallets}
+
            onWalletAdd={onWalletAdd}
          />
        )}
      </header>
    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

                      
  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}>
            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>
    );
      <WalletTestEnvironmentLabel network={network} />
    ) : null;

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

                      
    const onTransferFunds = (sourceWalletId: string) =>
      actions.wallets.transferFundsSetSourceWalletId.trigger({
        sourceWalletId,
        onLeftIconClick={actions.sidebar.toggleSubMenus.trigger}
        activeWallet={activeWallet}
        onTransferFunds={onTransferFunds}
+
        hasAnyWallets={hasAnyWallets}
+
        onWalletAdd={onWalletAdd}
      >
        {testnetLabel}
        <NodeSyncStatusIcon networkStatus={networkStatus} />
      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 });
        <WalletAdd
          isMainnet={isMainnet}
          isTestnet={isTestnet}
-
          onCreate={walletCreationAction}
+
          onCreate={onWalletAdd}
          onRestore={() =>
            actions.dialogs.open.trigger({ dialog: WalletRestoreDialog })
          }
  "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",
          "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"
        "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
        }
      }
    ],
  "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",
  "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",
  "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": "その他",
  "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",
  "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",
import { observer, inject } from 'mobx-react';
import { get } from 'lodash';
import { action } from '@storybook/addon-actions';
+
import { boolean } from '@storybook/addon-knobs';

                      
// Assets and helpers
import { CATEGORIES_BY_NAME } from '../../../source/renderer/app/config/sidebarConfig';
      showSubMenuToggle
      showSubMenus={this.isShowingSubMenus}
      leftIcon={this.isShowingSubMenus ? menuIconOpened : menuIconClosed}
+
      onTransferFunds={action('onTransferFunds')}
+
      onWalletAdd={action('onWalletAdd')}
+
      hasAnyWallets={boolean('hasAnyWallets', true)}
    >
      <NodeSyncStatusIcon
        networkStatus={{
  },
  {
    id: '2',
-
    name: 'Legacy',
+
    name: 'Legacy with funds',
    amount: new BigNumber(55.555),
    hasPassword: false,
    passwordUpdateDate: new Date(),
  },
  {
    id: '3',
+
    name: 'Legacy with no funds',
+
    amount: new BigNumber(0),
+
    hasPassword: false,
+
    passwordUpdateDate: new Date(),
+
    syncState: { data: null, tag: 'synced' },
+
    isLegacy: true,
+
    recoveryPhraseVerificationDate: moment()
+
      .subtract(200, 'days')
+
      .toDate(),
+
  },
+
  {
+
    id: '4',
    name: 'Restoring',
    amount: new BigNumber(12.345),
    hasPassword: false,
  'Rosalind',
  'Dorothy',
  'Gertrude',
+
  'Irène',
]

                      
const API_PORT = process.env.API_PORT || 8088