diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e928112..ce8271e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [4.7.1] - 2023-06-07 + +### Added + +- Added a note to the electron app that `BFX API Staging` is used. PR: [bfx-report-electron#207](https://github.com/bitfinexcom/bfx-report-electron/pull/207) +- Added app download section available for the web users and corresponding logic where they can get the latest `Reports App` version for their OS. PR: [bfx-report-ui#657](https://github.com/bitfinexcom/bfx-report-ui/pull/657) +- Implemented displaying accounts group name (if available) for multiple accounts instead of the primary account email on the main `Sign In` screen for better clearance to the users. Implemented the possibility of changing existing accounts groups names for multiple accounts. PR: [bfx-report-ui#659](https://github.com/bitfinexcom/bfx-report-ui/pull/659) + +### Changed + +- Increased `getAccountSummary` request timeout to `30s`, the rest requests will use `20s` timeout for the `bfx-api-node-rest` lib. PR: [bfx-report#293](https://github.com/bitfinexcom/bfx-report/pull/293) +- Added `3` retries instead of `2` when catching `Rate Limit` error to help users to go through sync in the electron app. PR: [bfx-report#294](https://github.com/bitfinexcom/bfx-report/pull/294) +- Implemented navigation via tabs between `Balances` and `Movements` reports in the `Wallets` sub-section. Expanded `My Account` and `My History` sections by default for better UX. Actualized several sub-sections naming. PR: [bfx-report-ui#658](https://github.com/bitfinexcom/bfx-report-ui/pull/658) + +### Fixed + +- Fixed issue with reloading UI page via the menu bar options. In the electron env need to `trigger-electron-load` event after running `Force Reload` and `Reload` menu commands with express api port. PR: [bfx-report-electron#206](https://github.com/bitfinexcom/bfx-report-electron/pull/206) + ## [4.7.0] - 2023-05-24 ### Added diff --git a/bfx-report-ui b/bfx-report-ui index d4da2fbc..27f7e397 160000 --- a/bfx-report-ui +++ b/bfx-report-ui @@ -1 +1 @@ -Subproject commit d4da2fbc737ed223971865df30f33627a0fe0d5b +Subproject commit 27f7e397a18002621b879b14dbdea62fd50715f7 diff --git a/bfx-reports-framework b/bfx-reports-framework index 814a4f4d..121b23d0 160000 --- a/bfx-reports-framework +++ b/bfx-reports-framework @@ -1 +1 @@ -Subproject commit 814a4f4df2d5250de7f9409dbb37076170863a03 +Subproject commit 121b23d0bc4a83affc1c0c7d492b15e6bdb0f49d diff --git a/package.json b/package.json index e3f8d2a3..a64dbfdd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bfx-report-electron", - "version": "4.7.0", + "version": "4.7.1", "repository": "https://github.com/bitfinexcom/bfx-report-electron", "description": "Reporting tool", "author": "bitfinex.com", diff --git a/src/error-manager/github-issue-template.md b/src/error-manager/github-issue-template.md index 184e6489..11c3c131 100644 --- a/src/error-manager/github-issue-template.md +++ b/src/error-manager/github-issue-template.md @@ -16,6 +16,7 @@ ${description} | CPUs | ${cpuModel} x ${cpuCount} | | RAM | ${totalRamGb}GB (${freeRamGb}GB free) | | App RAM limit | ${ramLimitMb}Mb (${usedRamMb}MB used) | +| Is BFX API Staging used | ${isBfxApiStagingUsed} |
diff --git a/src/error-manager/render-markdown-template.js b/src/error-manager/render-markdown-template.js index 9d78f91c..9ec892fa 100644 --- a/src/error-manager/render-markdown-template.js +++ b/src/error-manager/render-markdown-template.js @@ -42,13 +42,14 @@ const _renderMarkdownTemplate = ( const str = template.replace(placeholderPattern, (match) => { const propName = match.replace('${', '').replace('}', '') + if (typeof params?.[propName] === 'boolean') { + params[propName] = params[propName] + ? 'Yes' + : 'No' + } if ( - !params || - typeof params !== 'object' || - ( - !Number.isFinite(params[propName]) && - typeof params[propName] !== 'string' - ) + !Number.isFinite(params?.[propName]) && + typeof params?.[propName] !== 'string' ) { return '' } diff --git a/src/helpers/get-debug-info.js b/src/helpers/get-debug-info.js index 8ae5e7f6..41e240ad 100644 --- a/src/helpers/get-debug-info.js +++ b/src/helpers/get-debug-info.js @@ -9,6 +9,7 @@ const { getAppUpdateConfigSync } = require('../auto-updater') const packageJson = require(path.join(appDir, 'package.json')) const productName = require('./product-name') +const isBfxApiStaging = require('./is-bfx-api-staging') let lastCommit = { hash: '-', date: '-' } @@ -114,6 +115,10 @@ module.exports = (eol = os.EOL) => { ) ? `https://${provider}.com/${owner}/${repo}` : repository + const isBfxApiStagingUsed = isBfxApiStaging() + const bfxApiStagingDetail = isBfxApiStagingUsed + ? `${eol}Is BFX API Staging used: Yes` + : '' const detail = `\ Version: ${version}${eol}\ @@ -125,6 +130,7 @@ Node.js: ${nodeVersion}${eol}\ V8: ${v8Version}${eol}\ OS version: ${osVersion}${eol}\ OS release: ${osType} ${osArch} ${osRelease}\ +${bfxApiStagingDetail} ` return { @@ -150,6 +156,7 @@ OS release: ${osType} ${osArch} ${osRelease}\ usedRamMb, cpuModel, cpuCount, + isBfxApiStagingUsed, detail } } diff --git a/src/helpers/index.js b/src/helpers/index.js index ee064e8a..ef19af8b 100644 --- a/src/helpers/index.js +++ b/src/helpers/index.js @@ -15,6 +15,7 @@ const isMainWinAvailable = require( const productName = require('./product-name') const getAlertCustomClassObj = require('./get-alert-custom-class-obj') const parseEnvValToBool = require('./parse-env-val-to-bool') +const isBfxApiStaging = require('./is-bfx-api-staging') module.exports = { getFreePort, @@ -25,5 +26,6 @@ module.exports = { isMainWinAvailable, productName, getAlertCustomClassObj, - parseEnvValToBool + parseEnvValToBool, + isBfxApiStaging } diff --git a/src/helpers/is-bfx-api-staging.js b/src/helpers/is-bfx-api-staging.js new file mode 100644 index 00000000..8517d237 --- /dev/null +++ b/src/helpers/is-bfx-api-staging.js @@ -0,0 +1,20 @@ +'use strict' + +const { rootPath } = require('electron-root-path') +const path = require('path') + +const reportServiceConfig = require(path.join( + rootPath, + 'bfx-reports-framework/config/service.report.json' +)) +const pattern = /(staging)|(test)/i + +module.exports = () => { + const { restUrl } = reportServiceConfig ?? {} + + return !!( + restUrl && + typeof restUrl === 'string' && + pattern.test(restUrl) + ) +} diff --git a/src/trigger-electron-load.js b/src/trigger-electron-load.js index 0e114814..ad2c27bd 100644 --- a/src/trigger-electron-load.js +++ b/src/trigger-electron-load.js @@ -14,9 +14,11 @@ const triggerElectronLoadStr = fs.readFileSync( ) const placeholderPattern = /\$\{apiPort\}/ +let cachedExpressApiPort = null module.exports = (args) => { - const { expressApiPort = null } = args ?? {} + const { expressApiPort = cachedExpressApiPort } = args ?? {} + cachedExpressApiPort = expressApiPort const scriptStr = triggerElectronLoadStr.replace( placeholderPattern, expressApiPort diff --git a/src/window-creators.js b/src/window-creators.js index 6fc4a598..2e620aba 100644 --- a/src/window-creators.js +++ b/src/window-creators.js @@ -23,6 +23,7 @@ const { hideWindow, centerWindow } = require('./helpers/manage-window') +const isBfxApiStaging = require('./helpers/is-bfx-api-staging') const publicDir = path.join(__dirname, '../bfx-report-ui/build') const loadURL = serve({ directory: publicDir }) @@ -222,6 +223,11 @@ const createMainWindow = async ({ if (isDevEnv) { wins.mainWindow.webContents.openDevTools() } + if (isBfxApiStaging()) { + const title = wins.mainWindow.getTitle() + + wins.mainWindow.setTitle(`${title} - BFX API STAGING USED`) + } createMenu({ pathToUserData, pathToUserDocuments })