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 committed Feb 11, 2022
2 parents 2f2a728 + 998926a commit bad3a21
Show file tree
Hide file tree
Showing 241 changed files with 2,231 additions and 701 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/bundle-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

bundle-macos:
name: "[macOS] Build"
runs-on: macos-latest
runs-on: [ledger-live, macos]
needs: cancel-previous
steps:
- uses: actions/checkout@v2
Expand All @@ -45,6 +45,8 @@ jobs:
- uses: actions/setup-node@main
with:
node-version: 14.x
- name: install yarn
run: npm i -g yarn
- name: set git user
run: |
git config user.email "team-live@ledger.fr"
Expand All @@ -70,6 +72,8 @@ jobs:
VERSION: ${{ steps.version.outputs.clean }}-sha.${{ github.sha }}
run: yarn version --new-version="$VERSION"
- name: build the app
env:
CSC_IDENTITY_AUTO_DISCOVERY: false
run: yarn build-ci
- uses: ledgerhq/actions/packages/get-package-infos@main
id: post-version
Expand Down
78 changes: 63 additions & 15 deletions .github/workflows/generate-screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: "Generate | Screenshots"
on:
issue_comment:
types: [created]
workflow_dispatch:
inputs:
pr:
description: pr number
required: true

jobs:
check-if-fork:
Expand All @@ -11,7 +16,7 @@ jobs:
steps:
- name: check if we are on a forked repo
id: forked
run: echo "::set-output name=forked::$(${{github.event.issue.pull_request.head.repo.full_name != github.repository }})"
run: echo "::set-output name=forked::$(${{github.event.issue.pull_request != '' && github.event.issue.pull_request.head.repo.full_name != github.repository || false }})"

add-reaction:
needs: [check-if-fork]
Expand Down Expand Up @@ -43,7 +48,7 @@ jobs:
start-runner:
name: "[Runner] start ec2 instance"
needs: [add-reaction]
# needs: [add-reaction]
uses: ledgerhq/actions/.github/workflows/start-linux-runner.yml@main
with:
instance-type: c5.4xlarge
Expand Down Expand Up @@ -87,7 +92,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y gh
- name: checkout PR
run: gh pr checkout ${{ github.event.issue.number }}
run: gh pr checkout ${{ github.event.issue.number || github.event.inputs.pr }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v2
Expand Down Expand Up @@ -116,15 +121,15 @@ jobs:
git pull --rebase
git push
generate-screenshots:
needs: [add-reaction]
name: "[${{ matrix.os }}] Screenshots"
strategy:
fail-fast: false
matrix:
# os: [macos-latest, windows-latest]
os: [windows-latest]
runs-on: ${{ matrix.os }}
generate-screenshots-windows:
# needs: [add-reaction]
name: "[Windows] Screenshots"
# strategy:
# fail-fast: false
# matrix:
# # os: [macos-latest, windows-latest]
# os: [windows-latest]
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
Expand All @@ -135,7 +140,7 @@ jobs:
git config user.email "team-live@ledger.fr"
git config user.name "Team Live"
- name: checkout PR
run: gh pr checkout ${{ github.event.issue.number }}
run: gh pr checkout ${{ github.event.issue.number || github.event.inputs.pr }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v2
Expand All @@ -151,7 +156,7 @@ jobs:
run: npx playwright install-deps
- name: build electron app
run: yarn build
- name: generate new screenshots (${{ matrix.os }})
- name: generate new screenshots (windows)
run: yarn playwright-update-snapshots --retries 0
- name: status
id: status
Expand All @@ -160,6 +165,49 @@ jobs:
if: steps.status.outputs.status != 0
run: |
git add .
git commit -m 'update screenshots (${{ matrix.os }})'
git commit -m 'update screenshots (windows)'
git pull --rebase
git push
# generate-screenshots-macos:
# # needs: [add-reaction]
# name: "[macOS] Screenshots"
# runs-on: [ledger-live, macos]
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - name: set git user
# run: |
# git config user.email "team-live@ledger.fr"
# git config user.name "Team Live"
# - name: install gh
# run: brew install gh
# - name: checkout PR
# run: gh pr checkout ${{ github.event.issue.number || github.event.inputs.pr }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - uses: actions/setup-node@v2
# with:
# node-version: 14.x
# - name: install yarn
# run: npm i -g yarn
# - name: install dependencies
# env:
# JOBS: max
# run: yarn --frozen-lockfile --network-timeout 100000
# - name: install operating system dependencies
# run: npx playwright install-deps
# - name: build electron app
# run: yarn build
# - name: generate new screenshots (macOS)
# run: yarn playwright-update-snapshots --retries 0
# - name: status
# id: status
# run: echo "::set-output name=status::$(git status --porcelain | wc -l)"
# - name: commit
# if: steps.status.outputs.status != 0
# run: |
# git add .
# git commit -m 'update screenshots (macOs)'
# git pull --rebase
# git push
78 changes: 63 additions & 15 deletions .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,14 @@ jobs:
needs: [start-runner, prepare-runner]
runs-on: ${{ needs.start-runner.outputs.label }}
steps:
- uses: actions/checkout@v2
- name: checkout feature branch for testing
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{github.event.pull_request.head.repo.full_name}}
persist-credentials: false
- uses: actions/setup-node@v2
- name: setup node
uses: actions/setup-node@v2
if: always()
with:
node-version: 14.x
Expand Down Expand Up @@ -234,15 +236,10 @@ jobs:
tests/artifacts/coverage
tests/artifacts/videos
ui-tests:
ui-tests-windows:
needs: cancel-previous
name: "[${{ matrix.os }}] UI"
strategy:
fail-fast: false
matrix:
# os: [macos-latest, windows-latest]
os: [windows-latest]
runs-on: ${{ matrix.os}}
name: "[Windows] UI"
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
Expand All @@ -263,7 +260,7 @@ jobs:
env:
INSTRUMENT_BUILD: true
run: yarn build
- name: run ui tests (${{ matrix.os }})
- name: run ui tests (windows)
run: yarn playwright
- name: upload diffs to imgur
if: always()
Expand All @@ -272,20 +269,71 @@ jobs:
with:
path: tests/artifacts/test-results
workspace: ${{ github.workspace }}
os: ${{ matrix.os }}
os: windows-latest
- name: upload images
if: always()
uses: actions/upload-artifact@v2
with:
name: images-${{ matrix.os }}.json
path: images-${{ matrix.os }}.json
name: images-windows-latest.json
path: images-windows-latest.json
- name: upload ci suggested screenshots
if: always()
uses: actions/upload-artifact@v2
with:
name: playwright-results-${{ matrix.os }}
name: playwright-results-windows-latest
path: |
tests/artifacts/test-results
tests/artifacts/html-report
tests/artifacts/coverage
tests/artifacts/videos
# ui-tests-macos:
# needs: cancel-previous
# name: "[macOS] UI"
# runs-on: [ledger-live, macos]
# 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
# - uses: actions/setup-node@v2
# with:
# node-version: 14.x
# - name: install yarn
# run: npm i -g yarn
# - name: install dependencies
# env:
# JOBS: max
# run: yarn --frozen-lockfile --network-timeout 100000
# - name: install operating system dependencies
# run: npx playwright install-deps
# - name: build electron app
# env:
# INSTRUMENT_BUILD: true
# run: yarn build
# - name: run ui tests (macos)
# run: yarn playwright
# - name: upload diffs to imgur
# if: always()
# uses: ledgerhq/actions/packages/upload-images@main
# id: imgur
# with:
# path: tests/artifacts/test-results
# workspace: ${{ github.workspace }}
# os: macos
# - name: upload images
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: images-macos.json
# path: images-macos.json
# - name: upload ci suggested screenshots
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: playwright-results-macos
# path: |
# tests/artifacts/test-results
# tests/artifacts/html-report
# tests/artifacts/coverage
# tests/artifacts/videos
4 changes: 2 additions & 2 deletions cryptoassets.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@
| Binance Smart Chain | MDT | 0x668DB7aa38eaC6B40c9D13dBE61361DC4c4611d1 | Measurable Data Token | countervalues disabled | bsc/bep20/measurable_data_token |
| Binance Smart Chain | HERO | 0xD40bEDb44C081D2935eebA6eF5a3c8A31A1bBE13 | Metahero | | bsc/bep20/metahero |
| Binance Smart Chain | MILK | 0x8E9f5173e16Ff93F81579d73A7f9723324d6B6aF | Milk Protocol | countervalues disabled | bsc/bep20/milk_protocol |
| Binance Smart Chain | MIST | 0x68E374F856bF25468D365E539b700b648Bf94B67 | Mist | | bsc/bep20/mist |
| Binance Smart Chain | MIST | 0x68E374F856bF25468D365E539b700b648Bf94B67 | Mist | countervalues disabled | bsc/bep20/mist |
| Binance Smart Chain | MIX | 0xB67754f5b4C704A24d2db68e661b2875a4dDD197 | Mix | | bsc/bep20/mix |
| Binance Smart Chain | MBOX | 0x3203c9E46cA618C8C1cE5dC67e7e9D75f5da2377 | Mobox | | bsc/bep20/mobox |
| Binance Smart Chain | MDA | 0xd72aA9e1cDDC2F6D6e0444580002170fbA1f8eED | Moeda Loyalty Points | countervalues disabled | bsc/bep20/moeda_loyalty_points |
Expand Down Expand Up @@ -4857,7 +4857,7 @@
| Ethereum | RSV | 0x196f4727526eA7FB1e17b2071B3d8eAA38486988 | Reserve | countervalues disabled | ethereum/erc20/reserve |
| Ethereum | RSV | 0x1C5857e110CD8411054660F60B5De6a6958CfAE2 | Reserve (old) | delisted, countervalues disabled | ethereum/erc20/reserve_ |
| Ethereum | RSR | 0x320623b8E4fF03373931769A31Fc52A4E78B5d70 | Reserve Rights | | ethereum/erc20/reserve_rights |
| Ethereum | RSR_ | 0x8762db106B2c2A0bccB3A80d1Ed41273552616E8 | Reserve Rights | | ethereum/erc20/reserve_rights_old |
| Ethereum | RSR_ | 0x8762db106B2c2A0bccB3A80d1Ed41273552616E8 | Reserve Rights (legacy) | | ethereum/erc20/reserve_rights_old |
| Ethereum | RES | 0x0a9f693FcE6F00A51A8e0db4351B5a8078B4242e | Resfinex | | ethereum/erc20/resfinex |
| Ethereum | REST | 0x6753795d67eD0b2b65B57FC45C7Ac0F53b55f4FE | Restore | | ethereum/erc20/restore |
| Ethereum | REV | 0x2ef52Ed7De8c5ce03a4eF0efbe9B7450F2D7Edc9 | Revain | delisted, countervalues disabled | ethereum/erc20/revain |
Expand Down
19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"license": "MIT",
"private": true,
"main": "./.webpack/main.bundle.js",
"version": "2.38.1",
"version": "2.38.2",
"scripts": {
"start:prod": "electron ./.webpack/main.bundle.js",
"start": "cross-env NODE_ENV=development node ./tools/main.js",
Expand Down Expand Up @@ -42,17 +42,18 @@
"dependencies": {
"@electron/remote": "^1.2.1",
"@hot-loader/react-dom": "^17.0.1",
"@ledgerhq/devices": "6.20.0",
"@ledgerhq/devices": "6.24.1",
"@ledgerhq/electron-updater": "^4.2.2",
"@ledgerhq/errors": "6.10.0",
"@ledgerhq/hw-transport": "6.20.0",
"@ledgerhq/hw-transport-http": "6.20.0",
"@ledgerhq/hw-transport-node-hid-singleton": "6.23.1",
"@ledgerhq/hw-transport": "6.24.1",
"@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.0",
"@ledgerhq/live-common": "^21.32.4",
"@ledgerhq/logs": "6.10.0",
"@ledgerhq/react-ui": "^0.7.3",
"@polkadot/react-identicon": "0.87.6",
"@open-wc/webpack-import-meta-loader": "^0.4.7",
"@polkadot/react-identicon": "0.89.2",
"@tippyjs/react": "^4.2.6",
"@trust/keyto": "^1.0.1",
"@xstate/inspect": "^0.4.1",
Expand All @@ -67,6 +68,7 @@
"dotenv": "^8.2.0",
"electron-context-menu": "^2.5.2",
"ethereumjs-tx": "^2.1.1",
"firebase": "^9.6.6",
"focus-trap": "^6.6.1",
"form-data": "^3.0.0",
"fuse.js": "^3.6.1",
Expand Down Expand Up @@ -148,7 +150,7 @@
"@babel/preset-react": "^7.13.13",
"@babel/preset-typescript": "^7.15.0",
"@octokit/rest": "^18.12.0",
"@playwright/test": "^1.16.1",
"@playwright/test": "1.17.2",
"@storybook/addon-actions": "^6.3.12",
"@storybook/addon-essentials": "^6.3.12",
"@storybook/addon-links": "^6.3.12",
Expand Down Expand Up @@ -202,6 +204,7 @@
"nyc": "^15.1.0",
"playwright": "1.17",
"prettier": "^1.19.1",
"serve": "^13.0.2",
"style-loader": "^1.2.1",
"typescript": "^4.4.4",
"unused-webpack-plugin": "^2.4.0",
Expand Down
4 changes: 4 additions & 0 deletions renderer.webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ module.exports = {
exclude: /node_modules/,
options: babelConfig,
},
{
test: /\.js$/i,
loader: require.resolve('@open-wc/webpack-import-meta-loader'),
},
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
Expand Down
5 changes: 4 additions & 1 deletion src/main/window-lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ export const loadWindow = async () => {
};

export async function createMainWindow({ dimensions, positions }: any, settings: any) {
theme = settings && settings.theme ? settings.theme : "null";
theme =
settings && settings.theme && ["light", "dark"].includes(settings.theme)
? settings.theme
: "null";

// TODO renderer should provide the saved window rectangle
const width = dimensions ? dimensions.width : DEFAULT_WINDOW_WIDTH;
Expand Down
2 changes: 1 addition & 1 deletion src/preloader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ window.api = {

const theme = new URLSearchParams(window.location.search).get("theme");
const osTheme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
const palette = palettes[theme !== "null" ? theme : osTheme];
const palette = palettes[theme !== "null" ? theme : osTheme] || palettes.dark;
remote.getCurrentWindow().setBackgroundColor(palette.background.default);

window.addEventListener("DOMContentLoaded", () => {
Expand Down
Loading

1 comment on commit bad3a21

@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.561 s
Test results written to: report.json

Diff output ✅

Please sign in to comment.