View on GitHub
File Changes
m
+1/-1

                      
### Chores

                      
-
- Integration of the V2 API ([PR 1557](https://github.com/input-output-hk/daedalus/pull/1557))
+
- Use improved `NumericInput` component of `React-Polymorph` v0.9.0 ([1511](https://github.com/input-output-hk/daedalus/pull/1511))
- Added minimum heights of main app window for different environments (Windows, Linux, MacOS) ([1485](https://github.com/input-output-hk/daedalus/pull/1485))
- Removed "Ada Redemption" feature ([PR 1510](https://github.com/input-output-hk/daedalus/pull/1510))
- Changed `themes:check` to `themes:check:createTheme` and added a 4 part "Theme Management in Daedalus" tutorial series to a README document in the themes directory ([PR 1525](https://github.com/input-output-hk/daedalus/pull/1525))
      | title          | amount         |
      | my transaction | <WRONG_AMOUNT> |
    Then I should see the following error messages on the wallet send form:
-
      | message                               |
-
      | wallet.send.form.errors.invalidAmount |
+
      | message |
+
      | <ERROR> |

                      
    Examples:
-
      | WRONG_AMOUNT |
-
      | 45000000001  |
-
      | 0            |
+
      | WRONG_AMOUNT | ERROR                                        |
+
      | 99999999     | api.errors.NotEnoughFundsForTransactionError |
+
      | 0            | wallet.send.form.errors.invalidAmount        |

                      
When(/^I select Japanese language$/, function() {
  return this.waitAndClick(
-
    '//*[@class="SimpleOptions_label"][contains(text(), "Japanese")]'
+
    '//*[@class="SimpleOptions_option"]//*[contains(text(), "Japanese")]'
  );
});

                      

                      
When(/^I select "Strict" assurance level$/, function() {
  return this.waitAndClick(
-
    '//*[@class="SimpleOptions_label"][contains(text(), "Strict")]'
+
    '//*[@class="SimpleOptions_option"]//*[contains(text(), "Strict")]'
  );
});

                      
m
+1/-1
    "react-lottie": "1.2.3",
    "react-markdown": "3.1.0",
    "react-number-format": "3.0.3",
-
    "react-polymorph": "0.8.7",
+
    "react-polymorph": "0.9.0-rc.15",
    "react-router": "3.2.1",
    "react-svg-inline": "2.1.0",
    "react-virtualized": "9.21.0",
  },
};

                      
+
const ALLOWED_ERROR_EXCEPTION_PATHS = [
+
  '/api/internal/next-update', // when nextAdaUpdate receives a 404, it isn't an error
+
];
+

                      
function typedRequest<Response>(
  httpOptions: RequestOptions,
  queryParams?: {},
  rawBodyParams?: any
  // requestOptions?: { returnMeta: boolean }
): Promise<Response> {
  return new Promise((resolve, reject) => {
-
    const allowedErrorExceptionPaths = [
-
      '/api/internal/next-update', // when nextAdaUpdate receives a 404, it isn't an error
-
    ];
    const options: RequestOptions = Object.assign({}, httpOptions);
    // const { returnMeta } = Object.assign({}, requestOptions);
    let hasRequestBody = false;
    }

                      
    // @API TODO:  Delete once HTTPS is supported by the new API
-
    const httpOnlyOptions = {
-
      ...options,
-
      hostname: options.hostname,
-
      method: options.method,
-
      path: options.path,
-
      port: options.port,
-
    };
+
    const httpOnlyOptions = omit(options, ['ca', 'cert', 'key']);

                      
    // @API TODO: Uncomment / switch once HTTPS is supported by the new API
    // const httpsRequest = global.https.request(options);
      response.on('end', () => {
        try {
          const { statusCode, statusMessage } = response;
-
          const successResponse =
+
          const isSuccessResponse =
            (statusCode >= 200 && statusCode <= 206) ||
            (statusCode === 404 &&
-
              includes(allowedErrorExceptionPaths, options.path));
+
              includes(ALLOWED_ERROR_EXCEPTION_PATHS, options.path));

                      
-
          if (successResponse) {
+
          if (isSuccessResponse) {
            const data =
              statusCode === 404
                ? 'null'
            }
            resolve(JSON.parse(body));
          } else if (body) {
+
            // Error response with a body
            const parsedBody = JSON.parse(body);
            if (parsedBody.code && parsedBody.message) {
              reject(parsedBody);
            } else {
-
              // TODO: find a way to record this case and report to the backend team
-
              reject(new Error('Unknown response from backend.'));
+
              reject(new Error('Unknown API response'));
            }
          } else {
-
            // TODO: find a way to record this case and report to the backend team
-
            reject(new Error('Unknown response from backend.'));
+
            // Error response without a body
+
            reject(new Error('Unknown API response'));
          }
        } catch (error) {
          // Handle internal server errors (e.g. HTTP 500 - 'Something went wrong')
import WalletSendConfirmationDialog from './WalletSendConfirmationDialog';
import WalletSendConfirmationDialogContainer from '../../containers/wallet/dialogs/WalletSendConfirmationDialogContainer';
import {
-
  formattedAmountToBigNumber,
  formattedAmountToNaturalUnits,
  formattedAmountToLovelace,
} from '../../utils/formatters';
          placeholder: `0.${'0'.repeat(
            this.props.currencyMaxFractionalDigits
          )}`,
-
          value: '',
+
          value: null,
          validators: [
            async ({ field, form }) => {
-
              const amountValue = field.value;
-
              if (amountValue === '') {
+
              if (field.value === null) {
                this._resetTransactionFee();
                return [
                  false,
                  this.context.intl.formatMessage(messages.fieldIsRequired),
                ];
              }
+
              const amountValue = field.value.toString();
              const isValid = await this.props.validateAmount(
                formattedAmountToNaturalUnits(amountValue)
              );
    const { intl } = this.context;
    const {
      currencyUnit,
-
      currencyMaxIntegerDigits,
      currencyMaxFractionalDigits,
      isDialogOpen,
      isRestoreActive,
    const receiverField = form.$('receiver');
    const receiverFieldProps = receiverField.bind();
    const amountFieldProps = amountField.bind();
-
    const amount = formattedAmountToBigNumber(amountFieldProps.value);
+

                      
+
    const amount = new BigNumber(amountFieldProps.value || 0);

                      
    let fees = null;
    let total = null;
                  {...amountFieldProps}
                  className="amount"
                  label={intl.formatMessage(messages.amountLabel)}
-
                  maxBeforeDot={currencyMaxIntegerDigits}
-
                  maxAfterDot={currencyMaxFractionalDigits}
+
                  numberLocaleOptions={{
+
                    minimumFractionDigits: currencyMaxFractionalDigits,
+
                  }}
                  error={transactionFeeError || amountField.error}
                  onChange={value => {
                    this._isCalculatingFee = true;
-
                    amountField.onChange(value || '');
+
                    amountField.onChange(value);
                  }}
                  // AmountInputSkin props
                  currency={currencyUnit}
                  fees={fees}
                  total={total}
                  skin={AmountInputSkin}
                  onKeyPress={this.handleSubmitOnEnter}
+
                  allowSigns={false}
                />
              </div>

                      

                      
        {isDialogOpen(WalletSendConfirmationDialog) ? (
          <WalletSendConfirmationDialogContainer
-
            amount={amountFieldProps.value}
+
            amount={amount.toFormat(currencyMaxFractionalDigits)}
            receiver={receiverFieldProps.value}
            totalAmount={total}
            transactionFee={fees}
  "wallet.transaction.type.exchange": "!!!Währungsumtausch",
  "wallet.transactions.no.transactions": "!!!Keine Transaktionen vorhanden",
  "wallet.transactions.no.transactions.found": "!!!Keine Transaktionen gefunden"
-
}
+
}
\ No newline at end of file
        "description": "Label for the \"Title\" text input in the wallet send form.",
        "end": {
          "column": 3,
-
          "line": 37
+
          "line": 36
        },
        "file": "source/renderer/app/components/wallet/WalletSendForm.js",
        "id": "wallet.send.form.title.label",
        "start": {
          "column": 14,
-
          "line": 33
+
          "line": 32
        }
      },
      {
        "defaultMessage": "!!!E.g: Money for Frank",
        "description": "Hint inside the \"Receiver\" text input in the wallet send form.",
        "end": {
          "column": 3,
-
          "line": 43
+
          "line": 42
        },
        "file": "source/renderer/app/components/wallet/WalletSendForm.js",
        "id": "wallet.send.form.title.hint",
        "start": {
          "column": 13,
-
          "line": 38
+
          "line": 37
        }
      },
      {
        "defaultMessage": "!!!Receiver",
        "description": "Label for the \"Receiver\" text input in the wallet send form.",
        "end": {
          "column": 3,
-
          "line": 48
+
          "line": 47
        },
        "file": "source/renderer/app/components/wallet/WalletSendForm.js",
        "id": "wallet.send.form.receiver.label",
        "start": {
          "column": 17,
-
          "line": 44
+
          "line": 43
        }
      },
      {
        "defaultMessage": "!!!Wallet Address",
        "description": "Hint inside the \"Receiver\" text input in the wallet send form.",
        "end": {
          "column": 3,
-
          "line": 54
+
          "line": 53
        },
        "file": "source/renderer/app/components/wallet/WalletSendForm.js",
        "id": "wallet.send.form.receiver.hint",
        "start": {
          "column": 16,
-
          "line": 49
+
          "line": 48
        }
      },
      {
        "defaultMessage": "!!!Amount",
        "description": "Label for the \"Amount\" number input in the wallet send form.",
        "end": {
          "column": 3,
-
          "line": 59
+
          "line": 58
        },
        "file": "source/renderer/app/components/wallet/WalletSendForm.js",
        "id": "wallet.send.form.amount.label",
        "start": {
          "column": 15,
-
          "line": 55
+
          "line": 54
        }
      },
      {
        "defaultMessage": "!!!Description",
        "description": "Label for the \"description\" text area in the wallet send form.",
        "end": {
          "column": 3,
-
          "line": 65
+
          "line": 64
        },
        "file": "source/renderer/app/components/wallet/WalletSendForm.js",
        "id": "wallet.send.form.description.label",
        "start": {
          "column": 20,
-
          "line": 60
+
          "line": 59
        }
      },
      {
        "defaultMessage": "!!!You can add a message if you want",
        "description": "Hint in the \"description\" text area in the wallet send form.",
        "end": {
          "column": 3,
-
          "line": 70
+
          "line": 69
        },
        "file": "source/renderer/app/components/wallet/WalletSendForm.js",
        "id": "wallet.send.form.description.hint",
        "start": {
          "column": 19,
-
          "line": 66
+
          "line": 65
        }
      },
      {
        "defaultMessage": "!!!Next",
        "description": "Label for the next button on the wallet send form.",
        "end": {
          "column": 3,
-
          "line": 75
+
          "line": 74
        },
        "file": "source/renderer/app/components/wallet/WalletSendForm.js",
        "id": "wallet.send.form.next",
        "start": {
          "column": 19,
-
          "line": 71
+
          "line": 70
        }
      },
      {
        "defaultMessage": "!!!Please enter a valid address.",
        "description": "Error message shown when invalid address was entered.",
        "end": {
          "column": 3,
-
          "line": 80
+
          "line": 79
        },
        "file": "source/renderer/app/components/wallet/WalletSendForm.js",
        "id": "wallet.send.form.errors.invalidAddress",
        "start": {
          "column": 18,
-
          "line": 76
+
          "line": 75
        }
      },
      {
        "defaultMessage": "!!!Please enter a valid amount.",
        "description": "Error message shown when invalid amount was entered.",
        "end": {
          "column": 3,
-
          "line": 85
+
          "line": 84
        },
        "file": "source/renderer/app/components/wallet/WalletSendForm.js",
        "id": "wallet.send.form.errors.invalidAmount",
        "start": {
          "column": 17,
-
          "line": 81
+
          "line": 80
        }
      },
      {
        "defaultMessage": "!!!Please enter a title with at least 3 characters.",
        "description": "Error message shown when invalid transaction title was entered.",
        "end": {
          "column": 3,
-
          "line": 91
+
          "line": 90
        },
        "file": "source/renderer/app/components/wallet/WalletSendForm.js",
        "id": "wallet.send.form.errors.invalidTitle",
        "start": {
          "column": 16,
-
          "line": 86
+
          "line": 85
        }
      },
      {
        "defaultMessage": "!!!This wallet is currently being synced with the blockchain. While synchronisation is in progress transacting is not possible and transaction history is not complete.",
        "description": "Syncing transactions message shown during async wallet restore in the wallet send form.",
        "end": {
          "column": 3,
-
          "line": 98
+
          "line": 97
        },
        "file": "source/renderer/app/components/wallet/WalletSendForm.js",
        "id": "wallet.send.form.syncingTransactionsMessage",
        "start": {
          "column": 30,
-
          "line": 92
+
          "line": 91
        }
      }
    ],
  "wallet.transaction.type.exchange": "Exchange",
  "wallet.transactions.no.transactions": "No transactions",
  "wallet.transactions.no.transactions.found": "No transactions found"
-
}
+
}
\ No newline at end of file
  "wallet.transaction.type.exchange": "!!!Konverzija",
  "wallet.transactions.no.transactions": "!!!Nema transakcija",
  "wallet.transactions.no.transactions.found": "!!!Ne postoje transakcije koje zadovoljavaju uvjete pretraživanja"
-
}
+
}
\ No newline at end of file
  "wallet.transaction.type.exchange": "!!!Exchange",
  "wallet.transactions.no.transactions": "!!!No transactions",
  "wallet.transactions.no.transactions.found": "!!!No transactions found"
-
}
+
}
\ No newline at end of file
  "wallet.transaction.type.exchange": "!!!Exchange",
  "wallet.transactions.no.transactions": "!!!No transactions",
  "wallet.transactions.no.transactions.found": "!!!No transactions found"
-
}
+
}
\ No newline at end of file
m
+3/-3
  dependencies:
    prop-types "^15.6.0"

                      
-
  version "0.8.7"
-
  resolved "https://registry.yarnpkg.com/react-polymorph/-/react-polymorph-0.8.7.tgz#1f31c509006736bf1334ed2fa2386b4c74f19e3b"
+
  version "0.9.0-rc.15"
+
  resolved "https://registry.yarnpkg.com/react-polymorph/-/react-polymorph-0.9.0-rc.15.tgz#aff039bc034b9baa03289308042d4e98cd46f6ed"
  dependencies:
    create-react-context "0.2.2"
    create-react-ref "0.1.0"