Skip to content

Commit

Permalink
Merge branch 'development' into 3440-fix-forging-details
Browse files Browse the repository at this point in the history
  • Loading branch information
reyraa committed May 3, 2021
2 parents a8eb8ce + 49338db commit 7ab791a
Show file tree
Hide file tree
Showing 181 changed files with 65,532 additions and 41,486 deletions.
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
}
},
"rules": {
"import/no-cycle": "error",
"arrow-parens": "off",
"react/jsx-props-no-spreading": "off",
"jsx-a11y/control-has-associated-label": "off",
"import/no-cycle": "off",
"import/named": "off",
"jsx-a11y/alt-text": "off",
"jsx-a11y/anchor-is-valid": "off",
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.7.0
15.14.0
7 changes: 3 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pipeline {
stage('Install npm dependencies') {
steps {
nvm(getNodejsVersion()) {
sh 'npm install --registry https://npm.lisk.io --no-optional'
sh 'npm ci'
}
}
}
Expand All @@ -26,7 +26,7 @@ pipeline {
"ESLint": {
ansiColor('xterm') {
nvm(getNodejsVersion()) {
sh 'npm run --silent eslint'
sh 'npm run --silent lint'
}
}
},
Expand All @@ -37,9 +37,8 @@ pipeline {
cp -R /home/lisk/fonts/basier-circle src/assets/fonts
cp -R /home/lisk/fonts/gilroy src/assets/fonts
npm run --silent build
npm run --silent build:testnet
npm run install-electron-dependencies
npm run install:electron:dependencies
USE_SYSTEM_XORRISO=true npm run dist:linux
'''
}
Expand Down
2 changes: 1 addition & 1 deletion app/dev-app-update.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
owner: LiskHQ
owner: reyraa
repo: lisk-desktop
provider: github
6 changes: 3 additions & 3 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lisk-desktop",
"version": "2.0.0-alpha.6",
"version": "2.0.0-alpha.7",
"productName": "Lisk",
"description": "Lisk",
"main": "./build/main.js",
Expand All @@ -10,8 +10,8 @@
},
"dependencies": {
"get-port": "5.1.1",
"node-abi": "2.19.3",
"node-abi": "2.26.0",
"node-hid": "2.1.1",
"usb": "1.6.3"
"usb": "1.7.0"
}
}
21 changes: 8 additions & 13 deletions app/server.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
const express = require('express');
const path = require('path');

const server = {
// eslint-disable-next-line max-statements
init: (port) => {
const express = require('express'); // eslint-disable-line
const Path = require('path');
const bodyParser = require('body-parser'); // eslint-disable-line

if (process.env.LISK_HUB_URL) {
return process.env.LISK_HUB_URL;
if (process.env.LISK_DESKTOP_URL) {
return process.env.LISK_DESKTOP_URL;
}

const app = express();

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

app.set('views', Path.join(__dirname, '.'));
app.use(express.static(Path.join(__dirname, '.')));
app.set('views', path.join(__dirname, '.'));
app.use(express.static(path.join(__dirname, '.')));

app.get('*', (req, res) => res.sendFile(Path.join(__dirname, 'index.html')));
app.get('*', (req, res) => res.sendFile(path.join(__dirname, 'index.html')));

// catch 404 and forward to error handler
app.use((req, res, next) => {
Expand Down
8 changes: 4 additions & 4 deletions app/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import updateChecker from './modules/autoUpdater';
import server from '../server';
import i18nSetup from '../../i18n/i18n-setup';
import { storage, setConfig, readConfig } from './modules/storage';
import { hwM } from './modules/hwManager';
// import { hwM } from './modules/hwManager';

hwM.listening();
// hwM.listening();
i18nSetup();

const defaultServerPort = 5659;
Expand Down Expand Up @@ -43,9 +43,9 @@ const createWindow = () => {
if (process.env.DEBUG) {
installExtension([REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS])
// eslint-disable-next-line no-console
.then(name => console.info(`Added Extension: ${name}`))
.then((name) => console.info(`Added Extension: ${name}`))
// eslint-disable-next-line no-console
.catch(err => console.info('An error occurred: ', err));
.catch((err) => console.info('An error occurred: ', err));
}
};

Expand Down
6 changes: 3 additions & 3 deletions app/src/modules/autoUpdater.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export default ({ // eslint-disable-line max-statements
};
autoUpdater.autoDownload = false;

autoUpdater.checkForUpdates();
autoUpdater.checkForUpdatesAndNotify();
setInterval(() => {
autoUpdater.checkForUpdates();
autoUpdater.checkForUpdatesAndNotify();
}, 24 * 60 * 60 * 1000);

autoUpdater.on('error', (error) => {
Expand All @@ -22,7 +22,7 @@ export default ({ // eslint-disable-line max-statements
updater.error = error;
if (error?.toString().indexOf('404 Not Found') === -1) {
// this condition is because of https://github.com/LiskHQ/lisk-desktop/issues/647
dialog.showErrorBox(`${i18n.t('Error')}: `, error.toString());
dialog.showErrorBox(`${i18n.t('Error')}: `, 'There was a problem updating the application');
}
}
});
Expand Down
4 changes: 2 additions & 2 deletions app/src/modules/autoUpdater.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import sinon, { spy, stub } from 'sinon'; // eslint-disable-line import/no-extra
import ipcMock from 'electron-ipc-mock'; // eslint-disable-line import/no-extraneous-dependencies
import autoUpdater from './autoUpdater';

describe('autoUpdater', () => {
describe.skip('autoUpdater', () => {
const version = '1.2.3';
const releaseNotes = 'this notes';
const loadURL = spy();
Expand Down Expand Up @@ -116,7 +116,7 @@ describe('autoUpdater', () => {
expect(params.dialog.showErrorBox).to.not.have.been.calledWith();

callbacks.error('error');
expect(params.dialog.showErrorBox).to.have.been.calledWith('Error: ', 'error');
expect(params.dialog.showErrorBox).to.have.been.calledWith('Error: ', 'There was a problem updating the application');
});

it('should show info box when update downloaded', () => {
Expand Down
1 change: 0 additions & 1 deletion app/src/modules/process.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/* this file is ignored by coverage because it's just a simple wrapper
created to allow mocking `process` in unit tests.
*/
Expand Down
1 change: 0 additions & 1 deletion app/src/modules/win.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,4 @@ const sendEventsFromEventStack = () => {
win.eventStack.length = 0;
};


export default win;
1 change: 0 additions & 1 deletion app/src/modules/win.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ describe('Electron Browser Window Wrapper', () => {
serverMock.expects('init').returns(url);
});


afterEach(() => {
win.browser = null;
win.isUILoaded = false;
Expand Down
2 changes: 2 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module.exports = {
presets: [
['@babel/preset-env', {
useBuiltIns: 'usage',
corejs: 3,
modules: false,
targets: { browsers: ['last 2 versions', 'safari >= 7'] },
},
Expand Down
1 change: 0 additions & 1 deletion config/setupJest.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ ReactRouterDom.withRouter = jest.fn((Component => (
)));
ReactRouterDom.NavLink = ReactRouterDom.Link;


ReactRedux.connect = jest.fn((mapStateToProps, mapDispatchToProps = {}) => ((Component) => {
function MockConnect(props) {
return (
Expand Down
3 changes: 2 additions & 1 deletion config/webpack.config.electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const baseConfig = require('./webpack.config');
const config = {
mode: 'production',
entry: {
main: ['babel-polyfill', `${resolve(__dirname, '../app/src')}/main.js`],
main: `${resolve(__dirname, '../app/src')}/main.js`,
},
output: {
path: resolve(__dirname, '../app/build'),
Expand All @@ -14,6 +14,7 @@ const config = {
target: 'electron-main',
node: {
__dirname: false,
__filename: false,
},
module: {
rules: [
Expand Down
4 changes: 2 additions & 2 deletions config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ const reactConfig = require('./webpack.config.react');
const version = require('../package.json').version;

const config = {
mode: 'production',
output: {
path: resolve(__dirname, '../app', '../app/build'),
path: resolve(__dirname, '../app/build'),
filename: 'bundle.[name].[contenthash].js',
},
mode: 'production',
optimization: {
moduleIds: 'named',
minimizer: [new TerserPlugin({ test: /\.js(\?.*)?$/i })],
Expand Down
1 change: 0 additions & 1 deletion i18n/i18n-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const setup = () => {
return accumulator;
}, {});


return i18n
.init({
fallbackLng: 'en',
Expand Down
1 change: 0 additions & 1 deletion i18n/languages.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

const t = key => key; // This is hack to get the names in common.json
// we have to call t(...) again in src/components/setting/setting.js

Expand Down
1 change: 0 additions & 1 deletion i18n/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,6 @@
"Your account is not safe until you initialize it.": "Your account is not safe until you initialize it.",
"Your account just received {{amount}} {{token}} {{message}}": "Your account just received {{amount}} {{token}} {{message}}",
"Your balance will be transfered in a few seconds.": "Your balance will be transfered in a few seconds.",
"Your message": "Your message",
"Your nickname": "Your nickname",
"Your tokens and passphrase are safe.": "Your tokens and passphrase are safe.",
"[Tomorrow], hh:mm A": "[Tomorrow], hh:mm A",
Expand Down
14 changes: 14 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ module.exports = {
'src/i18n-scanner.js',
'src/main.js',
'src/tests.js',
'/app/src/modules/autoUpdater.js',
'src/actions/settings.js',
'src/actions/bookmarks.js',
'src/actions/liskService.js',
Expand Down Expand Up @@ -96,6 +97,19 @@ module.exports = {
'src/components/toolbox/tabsContainer/tabsContainer.js',
'src/components/toolbox/copyToClipboard/index.js',
'src/components/toolbox/dropdown/toolBoxDropdown.js',
'src/components/toolbox/hardwareWalletIllustration/index.js',
'src/components/toolbox/switcher/index.js',
'src/components/toolbox/demo.js',
'src/components/toolbox/animation/demo.js',
'src/components/toolbox/calendar/demo.js',
'src/components/toolbox/hardwareWalletIllustration/demo.js',
'src/components/toolbox/illustration/demo.js',
'src/components/toolbox/onboarding/demo.js',
'src/components/toolbox/pageHeader/demo.js',
'src/components/toolbox/pageHeader/index.js',
'src/components/toolbox/passphraseInput/demo.js',
'src/components/toolbox/spinner/demo.js',
'src/components/toolbox/switcher/demo.js',
'src/components/toolbox/demoRenderer.js',
'src/components/toolbox/table/empty.js',
'src/components/toolbox/table/header.js',
Expand Down
1 change: 0 additions & 1 deletion libs/hwManager/communication.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ const subscribeToDeviceDisconnected = (fn) => {
IPC.on(IPC_MESSAGES.HW_DISCONNECTED, (event, response) => fn(response));
};


const getDeviceList = () => (
executeCommand(IPC_MESSAGES.GET_CONNECTED_DEVICES_LIST, null)
);
Expand Down
1 change: 0 additions & 1 deletion libs/hwManager/constants.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

export const ADD_DEVICE = 'add';
export const REMOVE_DEVICE = 'remove';
export const RESPONSE = 'result';
Expand Down
1 change: 0 additions & 1 deletion libs/hwManager/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export const subscribe = (receiver, { event, action }) => {
});
};


export default {
createCommand,
publish,
Expand Down
43 changes: 0 additions & 43 deletions libs/multiStep/element.js

This file was deleted.

Loading

0 comments on commit 7ab791a

Please sign in to comment.