Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] Latest Production to Develop after 4.22 #3247

Merged
merged 26 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ce3eb1a
Version bump: 4.21.1
vsubhuman Jun 13, 2023
72967e2
Downgrade chromedriver to 113
vsubhuman Jun 13, 2023
c01458a
feat: add content hash for webpack output file names
neuodev Jun 22, 2023
42e31ad
Merge branch 'develop' into Ahmed/webpack-fname
neuodev Jun 22, 2023
3c85c83
Merge branch 'release/4.21.1' into release/4.22.0
vsubhuman Jun 23, 2023
0a8e1d9
Merge remote-tracking branch 'origin/develop' into release/4.22.0
vsubhuman Jun 23, 2023
0cc950e
Updated Ergo banner to display when any Ergo wallet is present at all…
vsubhuman Jun 23, 2023
49ed3ae
Fixed banner style and text
vsubhuman Jun 23, 2023
e2b6d28
Merge branch 'release/4.22.0' into ruslan/ergo-banner-update
vsubhuman Jun 23, 2023
fe6e535
flow fixes
vsubhuman Jun 27, 2023
0365f87
Merge pull request #3243 from Emurgo/ruslan/ergo-banner-update
vsubhuman Jun 27, 2023
491eab4
fixing quantity sorting
vsubhuman Jun 28, 2023
01a1710
flow fixes
vsubhuman Jun 28, 2023
84e2a4f
Merge pull request #3244 from Emurgo/fix/YOEXT-622/sorting-by-quantity
vsubhuman Jun 28, 2023
fe802c0
Merge pull request #3232 from Emurgo/release/4.21.1
vsubhuman Jun 29, 2023
026719e
Merge branch 'production' into release/4.22.0
vsubhuman Jun 29, 2023
0f53eb2
Merge branch 'release/4.22.0' into Ahmed/webpack-fname
vsubhuman Jun 29, 2023
1fad12f
Merge pull request #3241 from Emurgo/Ahmed/webpack-fname
vsubhuman Jun 29, 2023
f6c4987
added vietnamese translation to the UI
vsubhuman Jun 29, 2023
a8fc825
Merge pull request #3245 from Emurgo/ruslan/enable-vietnamese-transla…
vsubhuman Jun 30, 2023
b5ed22c
added vietnamese flag to the language selector
vsubhuman Jun 30, 2023
a8d9b95
Merge pull request #3246 from Emurgo/ruslan/adding-vietnamese-flag
vsubhuman Jun 30, 2023
70ede97
Adding missing vietnamese locale. Moving locales definition to the tr…
vsubhuman Jun 30, 2023
b25eb73
flow fix
vsubhuman Jun 30, 2023
e984112
Version bump: 4.22.0
vsubhuman Jun 30, 2023
d3756c3
Merge pull request #3242 from Emurgo/release/4.22.0
vsubhuman Jul 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ files:
it: it-IT
sk: sk-SK
cs: cs-CZ
vi: vi-VN
- source: /packages/yoroi-extension/app/i18n/locales/**/en-US.md
translation: /packages/yoroi-extension/app/i18n/locales/**/%locale%.md
languages_mapping:
Expand All @@ -34,4 +35,5 @@ files:
it: it-IT
sk: sk-SK
cs: cs-CZ
vi: vi-VN
content_segmentation: 0
35 changes: 2 additions & 33 deletions packages/yoroi-extension/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,9 @@ import { observer } from 'mobx-react';
import { Router } from 'react-router-dom';
import type { RouterHistory } from 'react-router-dom';
import { addLocaleData, IntlProvider } from 'react-intl';
import en from 'react-intl/locale-data/en';
import ko from 'react-intl/locale-data/ko';
import ja from 'react-intl/locale-data/ja';
import zh from 'react-intl/locale-data/zh';
import ru from 'react-intl/locale-data/ru';
import de from 'react-intl/locale-data/de';
import fr from 'react-intl/locale-data/fr';
import nl from 'react-intl/locale-data/nl';
import pt from 'react-intl/locale-data/pt';
import id from 'react-intl/locale-data/id';
import es from 'react-intl/locale-data/es';
import it from 'react-intl/locale-data/it';
import tr from 'react-intl/locale-data/tr';
import cs from 'react-intl/locale-data/cs';
import sk from 'react-intl/locale-data/sk';
import { observable, autorun, runInAction } from 'mobx';
import { Routes } from './Routes';
import { translations } from './i18n/translations';
import { locales, translations } from './i18n/translations';
import type { StoresMap } from './stores';
import type { ActionsMap } from './actions';
import { changeToplevelTheme, MuiThemes } from './styles/utils';
Expand All @@ -39,23 +24,7 @@ import Support from './components/widgets/Support';
import { trackNavigation } from './api/analytics';

// https://github.com/yahoo/react-intl/wiki#loading-locale-data
addLocaleData([
...en,
...ko,
...ja,
...zh,
...ru,
...de,
...fr,
...nl,
...pt,
...id,
...es,
...it,
...tr,
...cs,
...sk,
]);
addLocaleData(locales);

type Props = {|
+stores: StoresMap,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ export default class TestnetWarningBanner extends Component<Props> {
<div className={styles.ergoWarning}>
<span key="0" className={styles.shelleyTestnetWarningIcon}><ShelleyTestnetWarningSvg /></span>
<div className={styles.text}>
NOTE: Unfortunately the Ergo network support will be dropped from Yoroi in the near future.
NOTE: Due to the planned gradual termination of the Ergo wallets support in Yoroi extension,
<br />
Starting with the next version any Ergo wallets in the list will be visible, but not operational!
<br />
Please make sure to migrate your Ergo funds and wallets to another application.
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}

.ergoWarning {
height: 60px;
height: 90px;
display: flex;
justify-content: center;
align-items: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const SORTING_COLUMNS = {
name: string,
id: string,
amount: string,
amountForSorting?: BigNumber,
|}
type Props = {|
+assetsList: Asset[],
Expand Down Expand Up @@ -136,6 +137,10 @@ export default class AssetsList extends Component<Props, State> {
this.setState({ sortingDirection: newSortDirection })

if (field === 'amount') {
const dedicatedField = 'amountForSorting';
if (a[dedicatedField] != null && b[dedicatedField] != null) {
return compareNumbers(a[dedicatedField], b[dedicatedField], newSortDirection)
}
return compareNumbers(a[field], b[field], newSortDirection)
}
// Other fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { Link } from 'react-router-dom';
import { ROUTES } from '../../../routes-config';
import CopyToClipboardText from '../../widgets/CopyToClipboardLabel';
import { ListEmpty } from './ListEmpty';
import BigNumber from 'bignumber.js';

const SORTING_DIRECTIONS = {
UP: 'UP',
Expand All @@ -48,6 +49,7 @@ export type Asset = {|
name: string,
id: string,
amount: string,
amountForSorting?: BigNumber,
|};
type Props = {|
+assetsList: Asset[],
Expand Down Expand Up @@ -90,6 +92,10 @@ function TokenList({ assetsList: list, shouldHideBalance, intl }: Props & Intl):
setState({ ...state, sortingDirection: newSortDirection });

if (field === SORTING_COLUMNS.AMOUNT) {
const dedicatedField = 'amountForSorting';
if (a[dedicatedField] != null && b[dedicatedField] != null) {
return compareNumbers(a[dedicatedField], b[dedicatedField], newSortDirection);
}
return compareNumbers(a[field], b[field], newSortDirection);
}
// Other fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class FlagLabel extends Component<Props> {
return (

<div className={styles.wrapper}>
<span className={styles.flag}><SvgElem /></span>
<span className={styles.flag}>{ typeof svg === 'string' ? svg : (<SvgElem />)}</span>
<span>{label}</span>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ export default class BannerContainer extends Component<InjectedOrGenerated<Gener
render(): Node {
const serverStatus = this.generated.stores.serverConnectionStore.checkAdaServerStatus;

const { selected } = this.generated.stores.wallets;
const { selected, publicDerivers } = this.generated.stores.wallets;
const isWalletTestnet = selected == null
? false
: isTestnet(selected.getParent().getNetworkInfo());
const isWalletErgo = selected == null
? false
: isErgo(selected.getParent().getNetworkInfo());
const isAnyWalletErgo = publicDerivers?.some(w => isErgo(w.getParent().getNetworkInfo())) ?? false;

const deprecationBanner = this.getDeprecationBanner();
return (
Expand All @@ -47,7 +45,7 @@ export default class BannerContainer extends Component<InjectedOrGenerated<Gener
{serverStatus !== ServerStatusErrors.Healthy && (
<ServerErrorBanner errorType={serverStatus} />
)}
<TestnetWarningBanner isTestnet={isWalletTestnet} isErgo={isWalletErgo} />
<TestnetWarningBanner isTestnet={isWalletTestnet} isErgo={isAnyWalletErgo} />
{!environment.isProduction() && <NotProductionBanner />}
{deprecationBanner}
</>
Expand Down Expand Up @@ -88,7 +86,10 @@ export default class BannerContainer extends Component<InjectedOrGenerated<Gener
tokenInfoStore: {|
tokenInfo: TokenInfoMap,
|},
wallets: {| selected: null | PublicDeriver<> |},
wallets: {|
publicDerivers?: Array<PublicDeriver<>>,
selected: null | PublicDeriver<>,
|},
|},
actions: {||},
|} {
Expand All @@ -109,6 +110,7 @@ export default class BannerContainer extends Component<InjectedOrGenerated<Gener
tokenInfo: stores.tokenInfoStore.tokenInfo,
},
wallets: {
publicDerivers: stores.wallets.publicDerivers,
selected: stores.wallets.selected,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,10 @@ export default class NoticeBoardPage extends Component<InjectedOrGenerated<Gener
|},
|},
stores: {|
wallets: {|
selected: null | PublicDeriver<>
|},
wallets: {
selected: null | PublicDeriver<>,
...
},
tokenInfoStore: {|
tokenInfo: TokenInfoMap,
|},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default class TokensPageRevamp extends Component<InjectedOrGenerated<Gene
name: truncateToken(getTokenStrictName(token.info) ?? '-'),
id: getTokenIdentifierIfExists(token.info) ?? '-',
amount: [beforeDecimal, afterDecimal].join(''),
amountForSorting: shiftedAmount,
}
});
})();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default class WalletAssetsPage extends Component<InjectedOrGenerated<Gene
name: truncateToken(getTokenStrictName(token.info) ?? '-'),
id: (getTokenIdentifierIfExists(token.info) ?? '-'),
amount: [beforeDecimal, afterDecimal].join(''),
amountForSorting: shiftedAmount,
}
});
})();
Expand Down
4 changes: 4 additions & 0 deletions packages/yoroi-extension/app/i18n/global-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ const globalMessages: * = defineMessages({
id: 'global.language.slovak',
defaultMessage: '!!!Slovak',
},
languageVietnamese: {
id: 'global.language.vietnamese',
defaultMessage: '!!!Vietnamese',
},
addressLabel: {
id: 'wallet.receive.confirmationDialog.addressLabel',
defaultMessage: '!!!Address',
Expand Down
5 changes: 3 additions & 2 deletions packages/yoroi-extension/app/i18n/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
"global.language.slovak": "Slovak",
"global.language.spanish": "Español",
"global.language.turkish": "Turkish",
"global.language.vietnamese": "Vietnamese",
"global.passwordInstructionsPaperWallet": "Note: Paper Wallet password needs to be at least <strong>10 characters</strong> long.",
"global.publicKey.explanation": "Public keys allow seeing the wallet history for the wallet, but does <strong>not</strong> allow to spend or move the funds in any way (private key is <strong>not</strong> included)",
"global.receive": "Receive",
Expand Down Expand Up @@ -462,11 +463,11 @@
"wallet.add.page.hw.tooltip": "Create or restore a Yoroi wallet<br/>using a Ledger or Trezor hardware wallet.",
"wallet.add.page.restore.title": "Restore wallet",
"wallet.add.page.restore.tooltip": "Enter a 15-word recovery phrase<br/>to restore an already-existing Yoroi wallet,<br/>or import an existing Yoroi paper wallet.",
"wallet.add.page.revamp.backButtonLabel": "Back to current wallet",
"wallet.add.page.revamp.connectHardwareWallet": "Connect hardware wallet",
"wallet.add.page.revamp.createWallet": "Create new wallet",
"wallet.add.page.revamp.restoreWallet": "Restore existing wallet",
"wallet.add.page.revamp.subtitle": "Light wallet for Cardano assets",
"wallet.add.page.revamp.backButtonLabel": "Back to current wallet",
"wallet.add.page.subtitle.label": "Yoroi light wallet for Cardano",
"wallet.add.page.title": "Your gateway <br> to the <br> financial world",
"wallet.address.category.addressBook": "Addresses that do not belong to you, but are relevant to your wallet",
Expand Down Expand Up @@ -1061,4 +1062,4 @@
"yoroiTransfer.waiting.progressInfo.checkingAddresses": "Checking addresses funds",
"yoroiTransfer.waiting.progressInfo.restoringAddresses": "Fetching addresses",
"yoroiTransfer.waiting.title.label": "Wallet is being restored"
}
}
42 changes: 41 additions & 1 deletion packages/yoroi-extension/app/i18n/translations.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
// @flow
import en from 'react-intl/locale-data/en';
import ko from 'react-intl/locale-data/ko';
import ja from 'react-intl/locale-data/ja';
import zh from 'react-intl/locale-data/zh';
import ru from 'react-intl/locale-data/ru';
import de from 'react-intl/locale-data/de';
import fr from 'react-intl/locale-data/fr';
import nl from 'react-intl/locale-data/nl';
import pt from 'react-intl/locale-data/pt';
import id from 'react-intl/locale-data/id';
import es from 'react-intl/locale-data/es';
import it from 'react-intl/locale-data/it';
import tr from 'react-intl/locale-data/tr';
import cs from 'react-intl/locale-data/cs';
import sk from 'react-intl/locale-data/sk';
import vi from 'react-intl/locale-data/vi';
import globalMessages from './global-messages';
import type { $npm$ReactIntl$MessageDescriptor } from 'react-intl';
import { ReactComponent as EnglishFlag } from '../assets/images/flags/english.inline.svg';
Expand All @@ -16,9 +32,28 @@ import { ReactComponent as IndonesianFlag } from '../assets/images/flags/indone
import { ReactComponent as TurkishFlag } from '../assets/images/flags/turkish.inline.svg';
import { ReactComponent as CzechFlag } from '../assets/images/flags/czech.inline.svg';
import { ReactComponent as SlovakFlag } from '../assets/images/flags/slovak.inline.svg';
import { ReactComponent as VietnameseFlag } from '../assets/images/flags/vietnamese.inline.svg';

// This is essentially bulk require
export const locales: any = Object.freeze([
...en,
...ko,
...ja,
...zh,
...ru,
...de,
...fr,
...nl,
...pt,
...id,
...es,
...it,
...tr,
...cs,
...sk,
...vi,
]);

// This is essentially bulk require
// $FlowExpectedError[prop-missing] require.context comes from webpack
const req = require.context('./locales', true, /\.json.*$/, 'lazy');
export const translations: {|
Expand Down Expand Up @@ -116,5 +151,10 @@ export const LANGUAGES: Array<LanguageType> = [
value: 'sk-SK',
label: globalMessages.languageSlovak,
svg: SlovakFlag
},
{
value: 'vi-VN',
label: globalMessages.languageVietnamese,
svg: VietnameseFlag
}
];
2 changes: 1 addition & 1 deletion packages/yoroi-extension/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/yoroi-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yoroi",
"version": "4.21.0",
"version": "4.22.0",
"description": "Cardano ADA wallet",
"scripts": {
"dev:build": "rimraf dev/ && babel-node scripts/build --type=debug",
Expand Down
4 changes: 2 additions & 2 deletions packages/yoroi-extension/webpack/prodConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ const baseProdConfig = (env /*: EnvParams */) /*: * */ => ({
},
output: {
path: path.join(__dirname, '../build/js'),
filename: '[name].bundle.js',
chunkFilename: '[name].chunk.js',
filename: '[name].[contenthash].bundle.js',
chunkFilename: '[name].[contenthash].chunk.js',
publicPath: env.publicPath == null ? defaultPublicPath : env.publicPath,
},
plugins: [
Expand Down
Loading