这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bfx-reports-framework
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/error-manager/github-issue-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -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} |

<details>

Expand Down
13 changes: 7 additions & 6 deletions src/error-manager/render-markdown-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ''
}
Expand Down
7 changes: 7 additions & 0 deletions src/helpers/get-debug-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: '-' }

Expand Down Expand Up @@ -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}\
Expand All @@ -125,6 +130,7 @@ Node.js: ${nodeVersion}${eol}\
V8: ${v8Version}${eol}\
OS version: ${osVersion}${eol}\
OS release: ${osType} ${osArch} ${osRelease}\
${bfxApiStagingDetail}
`

return {
Expand All @@ -150,6 +156,7 @@ OS release: ${osType} ${osArch} ${osRelease}\
usedRamMb,
cpuModel,
cpuCount,
isBfxApiStagingUsed,
detail
}
}
4 changes: 3 additions & 1 deletion src/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -25,5 +26,6 @@ module.exports = {
isMainWinAvailable,
productName,
getAlertCustomClassObj,
parseEnvValToBool
parseEnvValToBool,
isBfxApiStaging
}
20 changes: 20 additions & 0 deletions src/helpers/is-bfx-api-staging.js
Original file line number Diff line number Diff line change
@@ -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)
)
}
4 changes: 3 additions & 1 deletion src/trigger-electron-load.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/window-creators.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down Expand Up @@ -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 })

Expand Down