Skip to content

Commit

Permalink
Merge branch 'feat/ddw-809-implement-analytics-part-3' into feat/ddw-…
Browse files Browse the repository at this point in the history
…809-implement-analytics-remaining-tracking
  • Loading branch information
Marcin Mazurek committed Sep 21, 2022
2 parents 24254f4 + e2712fc commit 624d60a
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 33 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Changelog

## vNext
## 5.0.0

### Features

- Added new Mnemonic input component ([PR 2979](https://github.com/input-output-hk/daedalus/pull/2979))

### Fixes

- Fixed blank screen when opening ITN rewards ([PR 3030](https://github.com/input-output-hk/daedalus/pull/3030))
- Ensured non-recommended decimal place setting alert is correctly shown ([PR 3007](https://github.com/input-output-hk/daedalus/pull/3007))
- Disabled the possibility to choose a syncing wallet for ITN rewards and delegation ([PR 3015](https://github.com/input-output-hk/daedalus/pull/3015))

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "daedalus",
"productName": "Daedalus",
"version": "4.12.0",
"version": "5.0.0",
"description": "Cryptocurrency Wallet",
"main": "./dist/main/index.js",
"scripts": {
Expand Down Expand Up @@ -62,8 +62,9 @@
"clear:translations": "rimraf ./translations/messages",
"nix:mainnet": "./nix/yarn-nix-shell.sh mainnet mainnet",
"nix:flight": "./nix/yarn-nix-shell.sh mainnet mainnet_flight",
"nix:preview": "./nix/yarn-nix-shell.sh preview preview",
"nix:preprod": "./nix/yarn-nix-shell.sh preprod preprod",
"nix:selfnode": "./nix/yarn-nix-shell.sh selfnode selfnode",
"nix:testnet": "./nix/yarn-nix-shell.sh testnet testnet",
"byron:wallet:importer": "yarn node-swc utils/api-importer/byron-wallet-importer.ts",
"shelley:wallet:importer": "yarn node-swc utils/api-importer/shelley-wallet-importer.ts",
"mary:wallet:importer": "yarn node-swc utils/api-importer/mary-wallet-importer.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ class Step1ConfigurationDialog extends Component<Props, State> {
<div className={styles.recoveryPhrase}>
<MnemonicInput
{...mnemonicInputProps}
label={intl.formatMessage(messages.recoveryPhraseInputLabel)}
label={intl.formatMessage(messages.recoveryPhraseInputHint)}
availableWords={suggestedMnemonics}
wordCount={ITN_WALLET_RECOVERY_PHRASE_WORD_COUNT}
error={recoveryPhraseField.error}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
.SimpleInput_input:not(.SimpleInput_disabled),
.SimpleInput_input:focus:not(.SimpleInput_disabled),
.SimpleInput_input:hover:not(.SimpleInput_disabled),
.SimpleLink_root {
.SimpleLink_root,
.MnemonicInput_content {
background-color: transparent !important;
}

Expand Down Expand Up @@ -94,7 +95,10 @@
.SimpleInput_input,
.SimpleInput_input::placeholder,
.SimpleInput_input:focus,
.SimpleInput_input:hover {
.SimpleInput_input:hover,
.MnemonicInput_headerSlot,
.MnemonicAutocompleteLayout_inputLabel,
.MnemonicAutocompleteLayout_root {
color: var(--theme-dialog-fullsize-text-color);
}

Expand All @@ -112,7 +116,8 @@
.SimpleInput_input:not(.SimpleInput_disabled),
.SimpleInput_input:focus:not(.SimpleInput_errored),
.SimpleInput_input:hover:not(.SimpleInput_errored),
.SimpleOptions_option:after {
.SimpleOptions_option:after,
.MnemonicAutocompleteLayout_input {
background-color: transparent !important;
border-color: var(--theme-dialog-fullsize-text-color) !important;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,11 @@ class VotingRegistrationDialogContainer extends Component<Props, State> {
const { calculateTransactionFee } = transactions;
const { getAddressesByWalletId } = addresses;
const { getWalletById } = wallets;
const { selectCoins, initiateTransaction } = hardwareWallets;
const {
selectCoins,
initiateTransaction,
updateTxSignRequest,
} = hardwareWallets;
const { prepareVotingData } = voting;
const amount = formattedAmountToLovelace(
`${VOTING_REGISTRATION_FEE_CALCULATION_AMOUNT}`
Expand All @@ -276,12 +280,15 @@ class VotingRegistrationDialogContainer extends Component<Props, State> {
votingData = await prepareVotingData({
walletId: this.selectedWalletId,
});
({ fee } = await selectCoins({
const coinSelection = await selectCoins({
walletId: this.selectedWalletId,
address: address.id,
amount,
metadata: votingData.metadata,
}));
});

updateTxSignRequest(coinSelection);
fee = coinSelection.fee;
} else {
({ fee } = await calculateTransactionFee({
walletId: this.selectedWalletId,
Expand Down
8 changes: 4 additions & 4 deletions source/renderer/app/i18n/locales/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@
"environment.network.alonzo_purple": "Alonzo Purple",
"environment.network.development": "開発",
"environment.network.mainnet": "メインネット",
"environment.network.preprod": "Pre-Prod",
"environment.network.preview": "Preview",
"environment.network.preprod": "プリプロ",
"environment.network.preview": "プレビュー",
"environment.network.selfnode": "Selfnode",
"environment.network.shelley_qa": "Shelley QA",
"environment.network.staging": "ステージング",
Expand Down Expand Up @@ -700,8 +700,8 @@
"test.environment.daedalusFlightLabel": "Cardano Mainnet - Daedalus Flight",
"test.environment.developmentLabel": "開発",
"test.environment.mainnetLabel": "メインネット",
"test.environment.preprodLabel": "Pre-Prod",
"test.environment.previewLabel": "Preview",
"test.environment.preprodLabel": "プリプロ",
"test.environment.previewLabel": "プレビュー",
"test.environment.selfnodeLabel": "Selfnode",
"test.environment.shelleyQaLabel": "Shelley QA",
"test.environment.stagingLabel": "ステージング",
Expand Down
37 changes: 19 additions & 18 deletions source/renderer/app/stores/VotingStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ import { formattedArrayBufferToHexString } from '../utils/formatters';
import walletUtils from '../utils/walletUtils';
import {
VOTING_PHASE_CHECK_INTERVAL,
VOTING_REGISTRATION_TRANSACTION_POLLING_INTERVAL,
VOTING_REGISTRATION_MIN_TRANSACTION_CONFIRMATIONS,
VOTING_REGISTRATION_TRANSACTION_POLLING_INTERVAL,
} from '../config/votingConfig';
import { votingPDFGenerator } from '../utils/votingPDFGenerator';
import {
votingPDFGenerator,
VotingPDFGeneratorResult,
} from '../utils/votingPDFGenerator';
import { i18nContext } from '../utils/i18nContext';
import type { PathRoleIdentityType } from '../utils/hardwareWalletUtils';
import type {
Expand Down Expand Up @@ -425,23 +428,21 @@ export default class VotingStore extends Store {
const { network, isMainnet } = this.environment;
const intl = i18nContext(currentLocale);

try {
await votingPDFGenerator({
nextVotingFundNumber,
qrCode,
walletName,
currentLocale,
currentDateFormat,
currentTimeFormat,
desktopDirectoryPath,
network,
isMainnet,
intl,
});
// @ts-ignore ts-migrate(2554) FIXME: Expected 1 arguments, but got 0.
const result = await votingPDFGenerator({
nextVotingFundNumber,
qrCode,
walletName,
currentLocale,
currentDateFormat,
currentTimeFormat,
desktopDirectoryPath,
network,
isMainnet,
intl,
});

if (result === VotingPDFGeneratorResult.FileSaved) {
this.actions.voting.saveAsPDFSuccess.trigger();
} catch (error) {
throw new Error(error);
}
};
_checkVotingRegistrationTransaction = async () => {
Expand Down
16 changes: 15 additions & 1 deletion source/renderer/app/utils/votingPDFGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const messages = defineMessages({
description: 'PDF author',
},
});

type Params = {
nextVotingFundNumber: number;
qrCode: string;
Expand All @@ -46,6 +47,12 @@ type Params = {
isMainnet: boolean;
intl: Record<string, any>;
};

export enum VotingPDFGeneratorResult {
FileSaved = 'FileSaved',
CancelledByUser = 'CancelledByUser',
}

export const votingPDFGenerator = async ({
nextVotingFundNumber,
qrCode,
Expand All @@ -57,7 +64,7 @@ export const votingPDFGenerator = async ({
network,
isMainnet,
intl,
}: Params) => {
}: Params): Promise<VotingPDFGeneratorResult> => {
// Consolidate data
const title = intl.formatMessage(messages.title, {
nextVotingFundNumber,
Expand Down Expand Up @@ -93,6 +100,11 @@ export const votingPDFGenerator = async ({
};
const dialogPath = await showSaveDialogChannel.send(params);
const filePath = dialogPath.filePath || '';

if (dialogPath.canceled || !filePath) {
return VotingPDFGeneratorResult.CancelledByUser;
}

await generateVotingPDFChannel.send({
title,
currentLocale,
Expand All @@ -106,4 +118,6 @@ export const votingPDFGenerator = async ({
filePath,
author,
});

return VotingPDFGeneratorResult.FileSaved;
};

0 comments on commit 624d60a

Please sign in to comment.