Skip to content

Commit

Permalink
Merge branch 'develop' into release/5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmain committed Aug 31, 2022
2 parents 8b3a058 + 18d103f commit 2e05bbb
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 30 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### 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
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 @@ -157,8 +157,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 @@ -682,8 +682,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 @@ -423,23 +426,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 2e05bbb

Please sign in to comment.