Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
Merge branch 'develop' into LIVE-448
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrogerlux authored Feb 21, 2022
2 parents bc046e3 + 400dda1 commit 203877f
Show file tree
Hide file tree
Showing 154 changed files with 316,511 additions and 6,941 deletions.
4 changes: 1 addition & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## 🖤 Expectations to reach

PR must pass CI, merge develop if conflicts, do not force push. Thanks!
PR must pass CI, rebase develop if conflicts. Thanks!

- **on QA**: at least one of these two checkboxes must be checked:
- [ ] a specific test planned is defined on Jira
Expand All @@ -18,8 +18,6 @@ PR must pass CI, merge develop if conflicts, do not force push. Thanks!
- [ ] Option 1: **no impact**: The changes of this PR have ZERO impact on the userland (invisible for users)
- [ ] Option 2: **atomic delivery**: the changes is atomic and complete (no partial delivery)

PR must pass CI, merge develop if conflicts, do not force push. Thanks!

<!--
If expectations aren't met, please document it carefully (on the reason you can't check it) and what do you need from maintainers.
-->
16 changes: 16 additions & 0 deletions .github/workflows/auto-merge-crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Merge Crowdin PR
on:
check_suite:
types: [completed]

jobs:
auto-merge:
runs-on: ubuntu-latest
steps:
- name: auto-merge
if: github.event.check_suite.conclusion == "success" && github.event.check_suite.pull_requests != "" && contains(github.event.check_suite.pull_requests[0].head.ref, 'l10n')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.check_suite.pull_requests[0].number }}
run: |
gh pr merge $PR -s --admin
10 changes: 10 additions & 0 deletions .github/workflows/bundle-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ jobs:
name: ${{ steps.post-version.outputs.version }}-mac.dmg
path: dist/${{ steps.post-version.outputs.name }}-${{ steps.post-version.outputs.version }}-mac.dmg

clean-macos-runner:
runs-on: [ledger-live, macos]
needs: [bundle-macos]
steps:
- name: Clean working directory
run: |
cd $RUNNER_WORKSPACE
cd ..
rm -r *
start-runner:
name: "[Runner] start ec2 instance"
needs: check-if-fork
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/checklist-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: "PR | Checklist"
on:
pull_request:
branches:
- develop
types: [opened, reopened]

jobs:
comment-on-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{github.event.pull_request.head.repo.full_name}}
persist-credentials: false
- name: comment on PR (support and bugfix branches)
if: contains(github.head_ref, 'support/') || contains(github.head_ref, 'bugfix/')
uses: actions/github-script@v6
with:
script: |
await github.rest.issues.createComment({
owner: "LedgerHQ",
repo: "ledger-live-desktop",
issue_number: "${{ github.event.pull_request.number }}",
body: `
Thanks for your contribution.
To be able to merge in _develop_ branch, you need to:
- [ ] pass the CI
- [ ] if needed, run \`/generate-screenshots\`
- [ ] have a dev review
- [ ] have a QA review
- [ ] if needed, \`/upgrade-llc\`
### Why /generate-screenshots ?
If your PR contains UI related changes,
it might be necessary to regenerate screenshots.
### Why /upgrade-llc ?
If your PR requires an update to the ledger-live-common library,
once the PR is merged on develop on ledger-live-common side,
you need to run \`/upgrade-llc\` to switch back to ledger-live-common@develop here before merging.
`
});
- name: comment on PR (feature branches)
if: contains(github.head_ref, 'feat/')
uses: actions/github-script@v6
with:
script: |
await github.rest.issues.createCommitComment({
owner: "LedgerHQ",
repo: "ledger-live-desktop",
issue_number: "${{ github.event.pull_request.number }}",
body: `
Thanks for your contribution.
To be groomed for next release, you need to:
- [ ] pass the CI
- [ ] if needed, run \`/generate-screenshots\`
- [ ] have a dev review
- [ ] have a QA review
### Why /generate-screenshots ?
If your PR contains UI related changes,
it might be necessary to regenerate screenshots.
`
});
2 changes: 1 addition & 1 deletion .github/workflows/generate-screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: add reaction to PR
uses: actions/github-script@v5
uses: actions/github-script@v6
with:
script: |
github.rest.reactions.createForIssueComment({
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ui-tests-reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: download artifacts
uses: actions/github-script@v5
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
unzip images-windows-latest.json.zip
rm tests-reports.zip playwright-results-windows-latest.zip playwright-results-linux.zip images-linux.json.zip images-windows-latest.json.zip
- name: parse images
uses: actions/github-script@v5
uses: actions/github-script@v6
with:
script: |
const fs = require("fs");
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
jestoutput: jest.txt
# - name: comment (manual trigger)
# if: github.event.workflow_dispatch != ''
# uses: actions/github-script@v5
# uses: actions/github-script@v6
# with:
# script: |
# const fs = require("fs");
Expand All @@ -156,7 +156,7 @@ jobs:
# });
- name: comment
if: github.event.workflow_run != ''
uses: actions/github-script@v5
uses: actions/github-script@v6
with:
script: |
await github.rest.repos.createCommitComment({
Expand Down
2 changes: 1 addition & 1 deletion cryptoassets.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
| Polkadot | DOT | YES | polkadot |
| Polygon | MATIC | YES | polygon |
| Qtum | QTUM | YES | qtum |
| Solana | SOL | YES | solana |
| Stakenet | XSN | YES | stakenet |
| Stellar | XLM | YES | stellar |
| Tezos | XTZ | YES | tezos |
Expand Down Expand Up @@ -89,7 +90,6 @@
| Ravencoin | RVN | NO | ravencoin |
| Resistance | RES | NO | resistance |
| Rise | RISE | NO | rise |
| Solana | SOL | NO | solana |
| Songbird | SGB | NO | songbird |
| Thundercore | TT | NO | thundercore |
| TomoChain | TOMO | NO | tomo |
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@ledgerhq/hw-transport-http": "6.24.1",
"@ledgerhq/hw-transport-node-hid-singleton": "6.24.1",
"@ledgerhq/ledger-core": "6.14.5",
"@ledgerhq/live-common": "^21.32.4",
"@ledgerhq/live-common": "^21.32.5",
"@ledgerhq/logs": "6.10.0",
"@ledgerhq/react-ui": "^0.7.3",
"@open-wc/webpack-import-meta-loader": "^0.4.7",
Expand Down Expand Up @@ -102,6 +102,7 @@
"react-lottie": "^1.2.3",
"react-markdown": "^4.3.0",
"react-motion": "^0.5.2",
"react-prismazoom": "^3.0.0",
"react-redux": "^7.2.6",
"react-router-dom": "^5.2.0",
"react-select": "^3.2.0",
Expand Down
41 changes: 39 additions & 2 deletions renderer.webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,43 @@ const babelPlugins = require("./babel.plugins");
const UnusedWebpackPlugin = require("unused-webpack-plugin");
const CopyPlugin = require("copy-webpack-plugin");

const packagesToTranspile = [
'@polkadot/api',
'@polkadot/api-derive',
'@polkadot/keyring',
'@polkadot/networks',
'@polkadot/rpc-augment',
'@polkadot/rpc-core',
'@polkadot/rpc-provider',
'@polkadot/types',
'@polkadot/types-known',
'@polkadot/ui-shared',
'@polkadot/util',
'@polkadot/util-crypto',
'@polkadot/x-bigint',
'@polkadot/x-fetch',
'@polkadot/x-global',
'@polkadot/x-randomvalues',
'@polkadot/x-textdecoder',
'@polkadot/x-textencoder',
'@polkadot/x-ws',
'@polkadot/react-identicon',
]

const exceptionToTranspile = (path_ruled) => {
// DO transpile these packages
if (packagesToTranspile.some(pkg => path_ruled.match(pkg))) {
return false;
}

// Ignore all other modules that are in node_modules
if (path_ruled.match(/node_modules/)) {
return true;
}

else return false;
}

const babelConfig = {
presets: [
[
Expand Down Expand Up @@ -89,14 +126,14 @@ module.exports = {
rules: [
{
test: /\.(ts)x?$/,
exclude: /node_modules/,
exclude: exceptionToTranspile,
loader: "babel-loader",
options: babelTsConfig,
},
{
test: /\.js$/i,
loader: "babel-loader",
exclude: /node_modules/,
exclude: exceptionToTranspile,
options: babelConfig,
},
{
Expand Down
1 change: 1 addition & 0 deletions src/config/urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const urls = {
"https://support.ledger.com/hc/en-us/articles/360021039173-Choose-network-fees?docs=true",
recipientAddressInfo:
"https://support.ledger.com/hc/en-us/articles/4404389453841-Receive-crypto-assets?docs=true",
managerAppLearnMore: "https://support.ledger.com/hc/en-us/categories/4404376139409?docs=true",
privacyPolicy: {
en:
"https://shop.ledger.com/pages/privacy-policy?utm_source=ledger_live_desktop&utm_medium=self_referral&utm_content=privacy",
Expand Down
1 change: 1 addition & 0 deletions src/live-common-set-supported-currencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ setSupportedCurrencies([
"ethereum",
"bsc",
"polkadot",
"solana",
"ripple",
"litecoin",
"polygon",
Expand Down
6 changes: 6 additions & 0 deletions src/renderer/Default.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import React, { useEffect, useRef } from "react";
import styled from "styled-components";
import { Redirect, Route, Switch, useLocation } from "react-router-dom";
import { FeatureToggle } from "@ledgerhq/live-common/lib/featureFlags";
import TrackAppStart from "~/renderer/components/TrackAppStart";
import { BridgeSyncProvider } from "~/renderer/bridge/BridgeSyncContext";
import { SyncNewAccounts } from "~/renderer/bridge/SyncNewAccounts";
Expand Down Expand Up @@ -57,6 +58,8 @@ import FirmwareUpdateBanner from "~/renderer/components/FirmwareUpdateBanner";
import Market from "~/renderer/screens/market";
// $FlowFixMe
import MarketCoinScreen from "~/renderer/screens/market/MarketCoinScreen";
// $FlowFixMe
import Learn from "~/renderer/screens/learn";

export const TopBannerContainer: ThemedComponent<{}> = styled.div`
position: sticky;
Expand Down Expand Up @@ -214,6 +217,9 @@ export default function Default() {
render={props => <MarketCoinScreen {...props} />}
/>
<Route path="/market" render={props => <Market {...props} />} />
<FeatureToggle feature="learn">
<Route path="/learn" render={props => <Learn {...props} />} />
</FeatureToggle>
</Switch>
</Page>
<Drawer />
Expand Down
1 change: 1 addition & 0 deletions src/renderer/animations/nanoSP/1PlugAndPinCode/dark.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/renderer/animations/nanoSP/1PlugAndPinCode/light.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/renderer/animations/nanoSP/2FirmwareUpdating/dark.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/renderer/animations/nanoSP/3EnterPinCode/dark.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/renderer/animations/nanoSP/3EnterPinCode/light.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/renderer/animations/nanoSP/4QuitApp/dark.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/renderer/animations/nanoSP/4QuitApp/light.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/renderer/animations/nanoSP/5AllowManager/dark.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/renderer/animations/nanoSP/5AllowManager/light.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/renderer/animations/nanoSP/6OpenApp/dark.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/renderer/animations/nanoSP/6OpenApp/light.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/renderer/animations/nanoSP/7Validate/dark.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/renderer/animations/nanoSP/7Validate/light.json

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions src/renderer/components/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,10 @@ export type Props = {
eventProperties?: Object,
mr?: number,
mx?: number,
innerRef?: any,
};

class Button extends PureComponent<
class ButtonInner extends PureComponent<
Props,
{
isFocused: boolean,
Expand Down Expand Up @@ -347,7 +348,7 @@ class Button extends PureComponent<

render() {
const { isFocused } = this.state;
const { disabled } = this.props;
const { disabled, innerRef } = this.props;
const { onClick, children, isLoading, event, eventProperties, ...rest } = this.props;
const isClickDisabled = disabled || isLoading;
const onClickHandler = e => {
Expand All @@ -361,6 +362,7 @@ class Button extends PureComponent<
return (
<Base
{...rest}
ref={innerRef}
onClick={isClickDisabled ? undefined : onClickHandler}
isFocused={isFocused}
onFocus={this.handleFocus}
Expand All @@ -377,4 +379,8 @@ class Button extends PureComponent<
}
}

const Button: React$ComponentType<Props> = React.forwardRef((props, ref) => (
<ButtonInner {...props} innerRef={ref} />
));

export default Button;
4 changes: 2 additions & 2 deletions src/renderer/components/ByteSize.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ const ByteSize = ({

// FIXME it should be on live-common side
const bytes = Math.ceil(value / blockSize) * blockSize;
const i = Math.floor(Math.log(bytes) / Math.log(k));
const i = Math.floor(Math.log(bytes) / Math.log(k)) || 1; // Nb no more bytes
const rawSize = parseFloat(bytes / Math.pow(k, i));
const dm = i > 1 ? Math.max(0, decimals) : 0;
const dm = rawSize < 1 ? 1 : i > 1 ? Math.max(0, decimals) : 0;

const divider = Math.pow(10, dm);
const toFormat = rawSize * divider;
Expand Down
Loading

1 comment on commit 203877f

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint outputs ✅

Tests outputs ✅

PASS src/generate-cryptoassets-md.test.js

Test Suites: 1 skipped, 1 passed, 1 of 2 total
Tests: 5 skipped, 1 passed, 6 total
Snapshots: 0 total
Time: 2.963 s
Test results written to: report.json

Diff output ❌

    <strong>linux</strong>

    | Actual | Diff | Expected |
    |:------:|:----:|:--------:|
  
      | market-page-actual | market-page-diff | market-page-expected |
      | ![market-page-actual](https://i.imgur.com/Ej1pDFD.png) | ![market-page-diff](https://i.imgur.com/R5RJ7nI.png) | ![market-page-expected](https://i.imgur.com/HvHPPiK.png) |
    


    <strong>windows</strong>

    | Actual | Diff | Expected |
    |:------:|:----:|:--------:|
  
      | market-page-actual | market-page-diff | market-page-expected |
      | ![market-page-actual](https://i.imgur.com/ARgnHrX.png) | ![market-page-diff](https://i.imgur.com/xrObGw9.png) | ![market-page-expected](https://i.imgur.com/XaDtmlx.png) |
    
      | app-updater-idle-actual | app-updater-idle-diff | app-updater-idle-expected |
      | ![app-updater-idle-actual](https://i.imgur.com/hwIy970.png) | ![app-updater-idle-diff](https://i.imgur.com/Lhr2I8a.png) | ![app-updater-idle-expected](https://i.imgur.com/VHVFVix.png) |

Please sign in to comment.