Skip to content

Commit

Permalink
Merge pull request #254 from bitfinexcom/staging
Browse files Browse the repository at this point in the history
Release version 4.11.0
  • Loading branch information
ezewer authored Sep 20, 2023
2 parents 49d2c91 + 8acc363 commit 2288c56
Show file tree
Hide file tree
Showing 24 changed files with 73 additions and 64 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-electron-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ env:
jobs:
linux-win-docker-builder:
timeout-minutes: 90
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
echo "IS_BFX_API_STAGING=1" >> $GITHUB_ENV
- uses: actions/setup-node@v3
with:
node-version: 16.20.0
node-version: 18.15.0
- name: Cache Electron binaries
id: electron-cache
uses: actions/cache@v3
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [4.11.0] - 2023-09-20

### Added

- Added ability to show success dialog for `CSV` exporting only after the `emitCsvGenerationCompletedToOne` event was sent by the backend for better understanding by users when the exporting process actually completed. PR: [bfx-report-ui#698](https://github.com/bitfinexcom/bfx-report-ui/pull/698)
- Added the possibility of tweaking the ability to auto-start sync after the auto-update of the electron app via the `Preferences` menu: `shouldNotSyncOnStartupAfterUpdate` flag received on sign in. PR: [bfx-report-ui#699](https://github.com/bitfinexcom/bfx-report-ui/pull/699)
- Implemented [extra information](https://docs.bitfinex.com/reference/movement-info) handling and representation for the `Movements` report. PR: [bfx-report-ui#702](https://github.com/bitfinexcom/bfx-report-ui/pull/702)
- Implemented `LNX (LN-BTC)` availability in the `Symbol` selector. PR: [bfx-report-ui#703](https://github.com/bitfinexcom/bfx-report-ui/pull/703)

### Changed

- Decreased `candles` request limit to `30 reqs/min` to prevent `Rate Limit` restriction. PR: [bfx-reports-framework#316](https://github.com/bitfinexcom/bfx-reports-framework/pull/316)
- Improved server availability error message to be persistent. PR: [bfx-reports-framework#317](https://github.com/bitfinexcom/bfx-reports-framework/pull/317)
- Updated `Nodejs` to `v18` in `Docker` containers and fixes UI dependencies installation under container. PR: [bfx-reports-framework#318](https://github.com/bitfinexcom/bfx-reports-framework/pull/318)
- Bumped `Electron` version up to `v25` to have under hood `Nodejs` `v18`. PRs: [bfx-report-electron#251](https://github.com/bitfinexcom/bfx-report-electron/pull/251), [bfx-report-ui#701](https://github.com/bitfinexcom/bfx-report-ui/pull/701)
- Prevented showing error modal dialog due to `inet` issue. When the sync starts we send a ping request to `BFX API` to check that API is available. The idea is to not show error modal dialog for issues, just show error toast via UI when fetching the corresponding error with progress event via WS. PR: [bfx-report-electron#252](https://github.com/bitfinexcom/bfx-report-electron/pull/252)
- Reworked and enhanced `Columns` filter to display the actual selected filters quantity for better clearance to the users. Reworked refresh button representation according to the design updates. PR: [bfx-report-ui#697](https://github.com/bitfinexcom/bfx-report-ui/pull/697)
- Improved user notification when data should be synced. Implemented synchronization auto-initiation if not syncing at the moment. PR: [bfx-report-ui#700](https://github.com/bitfinexcom/bfx-report-ui/pull/700)
- Updated translations for UI. PR: [bfx-report-ui#704](https://github.com/bitfinexcom/bfx-report-ui/pull/704)

### Fixed
- Bumped `better-sqlite3` driver up to `8.6.0` to have this fix: `random "database is locked" timeouts` [better-sqlite3#597](https://github.com/WiseLibs/better-sqlite3/issues/597). And also to have the ability to launch the db driver on `Nodejs` `v18` under Electron env. PR: [bfx-facs-db-better-sqlite#6](https://github.com/bitfinexcom/bfx-facs-db-better-sqlite/pull/6)
- Fixed the `always-on-top` state for the `loading` window. Commit: [bfx-report-electron#251/commit#be0af27](https://github.com/bitfinexcom/bfx-report-electron/pull/251/commits/be0af278d0145558706230e2d688dbe682903f2d)

## [4.10.0] - 2023-08-23

### Added
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.linux-builder
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM electronuserland/builder:16
FROM electronuserland/builder:18

ARG NODE_VERSION="16.20.0"
ARG NODE_VERSION="18.15.0"

ENV IS_BFX_API_STAGING=${IS_BFX_API_STAGING:-0}
ENV IS_DEV_ENV=${IS_DEV_ENV:-0}
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.mac-builder
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM electronuserland/builder:16
FROM electronuserland/builder:18

ARG NODE_VERSION="16.20.0"
ARG NODE_VERSION="18.15.0"

ENV IS_BFX_API_STAGING=${IS_BFX_API_STAGING:-0}
ENV IS_DEV_ENV=${IS_DEV_ENV:-0}
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.ui-builder
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM electronuserland/builder:16
FROM electronuserland/builder:18

ARG NODE_VERSION="16.20.0"
ARG NODE_VERSION="18.17.1"

ENV IS_BFX_API_STAGING=${IS_BFX_API_STAGING:-0}
ENV IS_DEV_ENV=${IS_DEV_ENV:-0}
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.win-builder
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM electronuserland/builder:16-wine
FROM electronuserland/builder:18-wine

ARG NODE_VERSION="16.20.0"
ARG NODE_VERSION="18.15.0"

ENV IS_BFX_API_STAGING=${IS_BFX_API_STAGING:-0}
ENV IS_DEV_ENV=${IS_DEV_ENV:-0}
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ Download the correspondent binary according your operating system. Available the
## Setup

Functionality has been tested on `Ubuntu 20.04 LTS`
Functionality has been tested on `Ubuntu 22.04 LTS`

### Main Structure

To simplify setup/build/publish processes the following bash scripts are provided:

- `./scripts/setup.sh` - CLI as an easy way to get through the setup process. It will launch `./scripts/sync-repo.sh` script and then setup the development environment
- `./scripts/sync-repo.sh` - CLI to fetch the last changes of the repository/sub-modules from the main remote repo
- `./scripts/launch.sh` - CLI to launch docker-compose services to build releases and publish executable artifacts of the electron app with the last fetched changes
- `./scripts/launch.sh` - CLI to launch Docker Compose services to build releases and publish executable artifacts of the electron app with the last fetched changes

Additional bash scripts:

Expand All @@ -37,14 +37,14 @@ Additional bash scripts:

The setup was tested with the following dependencies:

- Docker version 20.10.12
- docker-compose version 1.29.2
- Docker version 24.0.6
- Docker Compose version 2.21.0
- git version 2.24.1

To install `Docker`/`docker-compose` check the corresponding sections of the official docs:
To install `Docker`/`Docker Compose` check the corresponding sections of the official docs:

- [install Docker](https://docs.docker.com/engine/install)
- [install docker-compose](https://docs.docker.com/compose/install)
- [install Docker Compose](https://docs.docker.com/compose/install) Compose V2 is included with all currently supported versions of Docker Desktop
- if you don’t want to preface the docker command with sudo, create a Unix group called docker and add users to it, [check the doc](https://docs.docker.com/engine/install/linux-postinstall)

### Setup electron app
Expand Down Expand Up @@ -121,7 +121,7 @@ export IS_AUTO_UPDATE_BEING_TESTED=true

For doing builds for other platforms please have [Multi Platform Build](https://www.electron.build/multi-platform-build) in consideration

To launch docker-compose services to build releases and publish executable artifacts of the electron app available the `./scripts/launch.sh` bash script.
To launch Docker Compose services to build releases and publish executable artifacts of the electron app available the `./scripts/launch.sh` bash script.
Available the following arguments:

```console
Expand Down
2 changes: 1 addition & 1 deletion bfx-report-ui
Submodule bfx-report-ui updated 66 files
+2 −1 .eslintrc.json
+1 −1 dependabot.yml
+8,516 −32,240 package-lock.json
+7 −6 package.json
+22 −2 public/locales/en/translations.json
+242 −28 public/locales/es-EM/translations.json
+65 −28 public/locales/pt-BR/translations.json
+69 −32 public/locales/ru/translations.json
+78 −41 public/locales/tr/translations.json
+255 −39 public/locales/zh-CN/translations.json
+254 −38 public/locales/zh-TW/translations.json
+5 −0 src/components/ErrorDialog/ErrorDialog.constants.js
+4 −0 src/components/ErrorDialog/ErrorDialog.container.js
+19 −4 src/components/ErrorDialog/ErrorDialog.js
+5 −4 src/components/ExportDialog/ExportDialog.container.js
+15 −5 src/components/ExportDialog/ExportDialog.js
+259 −0 src/components/ExtraInfoDialog/ExtraInfoDialog.columns.js
+62 −0 src/components/ExtraInfoDialog/ExtraInfoDialog.js
+26 −0 src/components/ExtraInfoDialog/_ExtraInfoDialog.scss
+1 −0 src/components/ExtraInfoDialog/index.js
+2 −0 src/components/Main/Main.js
+23 −0 src/components/Movements/Movements.columns.js
+2 −0 src/components/Movements/Movements.container.js
+9 −0 src/components/Movements/Movements.js
+7 −0 src/components/Preferences/Preferences.js
+2 −0 src/icons/index.js
+3 −0 src/icons/plus.svg
+3 −1 src/index.js
+8 −0 src/state/auth/actions.js
+1 −0 src/state/auth/constants.js
+6 −0 src/state/auth/reducer.js
+19 −0 src/state/auth/saga.js
+2 −0 src/state/auth/selectors.js
+16 −0 src/state/movements/actions.js
+2 −0 src/state/movements/constants.js
+7 −0 src/state/movements/reducer.js
+30 −0 src/state/movements/saga.js
+2 −0 src/state/movements/selectors.js
+8 −0 src/state/query/actions.js
+1 −0 src/state/query/constants.js
+6 −0 src/state/query/reducer.js
+16 −2 src/state/query/saga.js
+2 −0 src/state/query/selectors.js
+4 −1 src/state/symbols/reducer.js
+8 −0 src/state/sync/saga.js
+7 −0 src/state/ui/actions.js
+1 −0 src/state/ui/constants.js
+7 −0 src/state/ui/reducer.js
+2 −0 src/state/ui/selectors.js
+2 −1 src/state/ws/constants.js
+9 −0 src/state/ws/saga.js
+1 −0 src/styles/index.scss
+1 −1 src/ui/CollapsedTable/CollapsedTable.js
+1 −0 src/ui/ColumnsFilter/ColumnSelector/ColumnSelector.columns.js
+33 −0 src/ui/ColumnsFilter/ColumnsFilter.helpers.js
+9 −10 src/ui/ColumnsFilter/ColumnsFilter.js
+24 −3 src/ui/ColumnsFilter/_ColumnsFilter.scss
+2 −1 src/ui/MultiSelect/_MultiSelect.scss
+12 −15 src/ui/RefreshButton/RefreshButton.js
+2 −13 src/ui/RefreshButton/_RefreshButton.scss
+1 −3 src/ui/RefreshButton/index.js
+33 −1 src/ui/Select/_Select.scss
+21 −0 src/ui/SyncAfterUpdatePref/SyncAfterUpdatePref.js
+1 −0 src/ui/SyncAfterUpdatePref/index.js
+1 −1 src/ui/TimeRange/_TimeRange.scss
+3 −0 src/utils/columns.js
2 changes: 0 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.7'

services:
ui-builder:
container_name: ui-builder
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "bfx-report-electron",
"version": "4.10.0",
"version": "4.11.0",
"repository": "https://github.com/bitfinexcom/bfx-report-electron",
"description": "Reporting tool",
"author": "bitfinex.com",
"main": "index.js",
"engine": {
"node": ">=14.16.0"
"node": ">=18.15.0"
},
"license": "Apache-2.0",
"dependencies": {
Expand All @@ -19,7 +19,7 @@
"cron-validate": "1.4.3",
"ed25519-supercop": "2.0.1",
"electron-alert": "0.1.20",
"electron-log": "4.4.1",
"electron-log": "4.4.8",
"electron-root-path": "1.0.16",
"electron-updater": "5.3.0",
"extract-zip": "2.0.1",
Expand All @@ -36,7 +36,7 @@
"devDependencies": {
"@mapbox/node-pre-gyp": "1.0.6",
"app-builder-bin": "4.1.0",
"electron": "21.3.3",
"electron": "25.8.1",
"electron-builder": "23.6.0",
"mocha": "10.2.0",
"standard": "16.0.4"
Expand Down
4 changes: 2 additions & 2 deletions scripts/helpers/install-backend-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function installBackendDeps {
cd "$ROOT"
echo -e "\n${COLOR_BLUE}Installing the main dev deps...${COLOR_NORMAL}"
rm -rf ./node_modules
npm i --development --no-audit --progress=false
npm i --development --no-audit --progress=false --force
npm ls --depth=0 --only=dev 1<&-

export npm_config_target_platform="$targetPlatform"
Expand All @@ -55,7 +55,7 @@ function installBackendDeps {
export npm_config_disturl="$DIST_URL"

echo -e "\n${COLOR_BLUE}Installing the main prod deps...${COLOR_NORMAL}"
npm i --production --include=dev --no-audit --progress=false
npm i --production --include=dev --no-audit --progress=false --force
rm -rf "$ROOT/node_modules/ed25519-supercop/build"
checkNodeModulesDir "$ROOT"
depsErr=$(npm ls --depth=0 --only=prod 2>&1 >/dev/null | grep -E -v "missing: eslint|--omit=dev" || [[ $? == 1 ]])
Expand Down
8 changes: 2 additions & 6 deletions scripts/helpers/install-nodejs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ script as required NodeJS version!${COLOR_NORMAL}" >&2
exit 1
fi

version="${1:-"16.20.0"}"
version="${1:-"18.15.0"}"

echo -e "\n${COLOR_BLUE}Installing the NodeJS v$version...${COLOR_NORMAL}"

Expand All @@ -25,11 +25,7 @@ unlink /usr/local/CHANGELOG.md
unlink /usr/local/LICENSE
unlink /usr/local/README.md

# https://github.com/npm/npm/issues/4531
npm config set unsafe-perm true

npm cache clear --force
npm install --global [email protected]
npm config set node_gyp $(npm prefix -g)/lib/node_modules/node-gyp/bin/node-gyp.js
npm install --global [email protected]

echo -e "\n${COLOR_GREEN}The NodeJS has been installed successful${COLOR_NORMAL}"
2 changes: 1 addition & 1 deletion scripts/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ if [ $syncSubModules == 1 ]; then
source "$ROOT/scripts/sync-repo.sh" "-wue"
fi

docker-compose up $composeCommonFlags $uiBuilderService \
docker compose up $composeCommonFlags $uiBuilderService \
$linuxBuilderService $winBuilderService $macBuilderService

if [ $buildLinux == 1 ]; then
Expand Down
3 changes: 2 additions & 1 deletion src/auto-updater/bfx.mac.updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const path = require('path')
const fs = require('fs')
const fsPromises = require('fs/promises')
const { spawn } = require('child_process')
const { MacUpdater } = require('electron-updater')
const extract = require('extract-zip')
Expand Down Expand Up @@ -54,7 +55,7 @@ class BfxMacUpdater extends MacUpdater {
const dist = path.join(root, '..')
const exec = path.join(root, 'Contents/MacOS/Bitfinex Report')

await fs.promises.rmdir(root, { recursive: true })
await fsPromises.rm(root, { recursive: true })

await extract(
downloadedFilePath,
Expand Down
6 changes: 2 additions & 4 deletions src/change-reports-folder.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const electron = require('electron')
const { dialog, BrowserWindow } = require('electron')

const { CSV_PATH_VERSION } = require('./const')

Expand All @@ -14,10 +14,8 @@ const relaunch = require('./relaunch')
const { getConfigsKeeperByName } = require('./configs-keeper')

module.exports = ({ pathToUserDocuments }) => {
const dialog = electron.dialog || electron.remote.dialog

return async () => {
const win = electron.BrowserWindow.getFocusedWindow()
const win = BrowserWindow.getFocusedWindow()

try {
const {
Expand Down
3 changes: 2 additions & 1 deletion src/error-manager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ const _isLogSkipped = (log) => {
str.includes('contextIsolation is deprecated') ||
str.includes('ERR_INTERNET_DISCONNECTED') ||
// Skip error when can't get code signature on mac
str.includes('Could not get code signature')
str.includes('Could not get code signature') ||
str.includes('ERR_BFX_API_SERVER_IS_NOT_AVAILABLE')
)
)
}
Expand Down
6 changes: 2 additions & 4 deletions src/export-db.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const path = require('path')
const electron = require('electron')
const { dialog, BrowserWindow } = require('electron')

const { InvalidFilePathError } = require('./errors')
const { zip } = require('./archiver')
Expand All @@ -23,8 +23,6 @@ module.exports = ({
pathToUserData,
pathToUserDocuments
}) => {
const dialog = electron.dialog || electron.remote.dialog

const _timestamp = (new Date()).toISOString().split('.')[0]
const timestamp = _timestamp.replace(/[:]/g, '-')
const defaultPath = path.join(
Expand All @@ -37,7 +35,7 @@ module.exports = ({
const secretKeyPath = path.join(pathToUserData, SECRET_KEY_FILE_NAME)

return async () => {
const win = electron.BrowserWindow.getFocusedWindow()
const win = BrowserWindow.getFocusedWindow()

try {
const {
Expand Down
3 changes: 1 addition & 2 deletions src/helpers/manage-window.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const electron = require('electron')
const { screen } = require('electron')

const hideWindow = (win, opts) => {
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -74,7 +74,6 @@ const showWindow = (win, opts) => {
}

const centerWindow = (win, workArea) => {
const screen = electron.screen || electron.remote.screen
const {
getCursorScreenPoint,
getDisplayNearestPoint
Expand Down
6 changes: 2 additions & 4 deletions src/import-db.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const electron = require('electron')
const { dialog, BrowserWindow } = require('electron')

const {
InvalidFilePathError,
Expand Down Expand Up @@ -38,10 +38,8 @@ module.exports = ({
pathToUserData,
pathToUserDocuments
}) => {
const dialog = electron.dialog || electron.remote.dialog

return async () => {
const win = electron.BrowserWindow.getFocusedWindow()
const win = BrowserWindow.getFocusedWindow()

try {
const {
Expand Down
6 changes: 2 additions & 4 deletions src/relaunch.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
const electron = require('electron')

module.exports = () => {
const app = electron.app || electron.remote.app

const options = {
args: process.argv.slice(1).concat(['--relaunch'])
}
Expand All @@ -14,6 +12,6 @@ module.exports = () => {
options.args.unshift('--appimage-extract-and-run')
}

app.relaunch(options)
app.exit(0)
electron.app.relaunch(options)
electron.app.exit(0)
}
5 changes: 2 additions & 3 deletions src/show-message-modal-dialog.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
'use strict'

const electron = require('electron')
const { dialog, BrowserWindow } = require('electron')

module.exports = async (win, opts = {}) => {
const dialog = electron.dialog || electron.remote.dialog
const _win = win && typeof win === 'object'
? win
: electron.BrowserWindow.getFocusedWindow()
: BrowserWindow.getFocusedWindow()

const {
response: btnId,
Expand Down
3 changes: 2 additions & 1 deletion src/window-creators.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ const _createWindow = async (
}

if (!pathname) {
await createLoadingWindow()
const props = await createLoadingWindow()
props.win.setAlwaysOnTop(true)

return res
}
Expand Down
Loading

0 comments on commit 2288c56

Please sign in to comment.