Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
1437697
Add modal window styles
ZIMkaRU Nov 24, 2025
4ff0c35
Add modal window script
ZIMkaRU Nov 24, 2025
28a6e43
Add modal window layout
ZIMkaRU Nov 24, 2025
dcec527
Add modal window name to list
ZIMkaRU Nov 24, 2025
f514c70
Add modal window to obj keeper
ZIMkaRU Nov 24, 2025
ebbdc21
Add fn to create modal window
ZIMkaRU Nov 24, 2025
069fcea
Implement helper for init closed event listener
ZIMkaRU Nov 25, 2025
3bfad2e
Use init closed event listener helper for auto-update ipc
ZIMkaRU Nov 25, 2025
8d06003
Add modal ipc channel handlers
ZIMkaRU Nov 25, 2025
e40a256
Init modal ipc channel handlers
ZIMkaRU Nov 25, 2025
324c589
Register modal event methods in preload script
ZIMkaRU Nov 25, 2025
a55fa0c
Add did-finish-load hook to win creation
ZIMkaRU Nov 26, 2025
2addc00
Handle modal window closed event
ZIMkaRU Nov 26, 2025
cec3098
Add logic to render modal window content
ZIMkaRU Nov 26, 2025
f69d526
Add basic styles for modal window content
ZIMkaRU Nov 26, 2025
3d4b8f2
Add opt to show dev tools for child wins
ZIMkaRU Nov 27, 2025
5df7a07
Add opt to prevent passing parent win
ZIMkaRU Nov 27, 2025
d88a2aa
Add github-markdown css to modal win
ZIMkaRU Nov 27, 2025
ad79179
Enhance button rendering
ZIMkaRU Nov 27, 2025
9644028
Enhance modal win styles
ZIMkaRU Nov 27, 2025
fff84d4
Add svg error icon to modal win
ZIMkaRU Nov 27, 2025
2cc002a
Add ability to pass class name to text container
ZIMkaRU Nov 27, 2025
df846b5
Fix github-markdown-css font-family styles
ZIMkaRU Nov 27, 2025
a44e6aa
Add svg success icon to modal win
ZIMkaRU Nov 27, 2025
11efc0d
Fix loading icon
ZIMkaRU Nov 27, 2025
3586437
Enhance question icon
ZIMkaRU Nov 28, 2025
3e0b246
Enhance info icon
ZIMkaRU Nov 28, 2025
83209a7
Add ability to automatically set focus to btn
ZIMkaRU Nov 28, 2025
074bf0f
Add ability to handle hotkeys for modal win
ZIMkaRU Nov 28, 2025
4feb2bb
Fix modal window scrollbar
ZIMkaRU Dec 1, 2025
1431f91
Enhance icon map usage
ZIMkaRU Dec 1, 2025
923d0a0
Fix modal element height
ZIMkaRU Dec 1, 2025
86198ff
Adjust markdown body font-size
ZIMkaRU Dec 1, 2025
3547004
Implement method to set modal win height
ZIMkaRU Dec 2, 2025
d0f73bb
Register method to set modal win height in preload script
ZIMkaRU Dec 2, 2025
1bf6a2f
Set modal win height considering content
ZIMkaRU Dec 2, 2025
58b10cf
Adjust win sizes
ZIMkaRU Dec 2, 2025
7e21ab1
Set detach mode for win dev tools
ZIMkaRU Dec 2, 2025
a541392
Use new modal window creation flow for reporting error
ZIMkaRU Dec 2, 2025
e58a95d
Show modal window after setting height
ZIMkaRU Dec 3, 2025
4e14db3
Add ability to pass window size
ZIMkaRU Dec 3, 2025
3feac5a
Prevent setting height to content
ZIMkaRU Dec 3, 2025
68a8121
Set init height to 600px for error modal win
ZIMkaRU Dec 3, 2025
1190978
Fix passing modal win response
ZIMkaRU Dec 3, 2025
d862d89
Merge pull request #572 from ZIMkaRU/feature/implement-own-solution-f…
batrudinych Dec 4, 2025
70ca60d
Bump version up to v4.40.0
ZIMkaRU Dec 10, 2025
4424235
Update sub-modules
ZIMkaRU Dec 10, 2025
adc34b9
Add changelog for v4.40.0
ZIMkaRU Dec 10, 2025
35a988c
Merge pull request #573 from ZIMkaRU/feature/release-electron-app
vigan-abd Dec 10, 2025
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
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [4.40.0] - 2025-12-17

### Added

- Implemented its own solution for alert windows for the electron app instead of the `electron-alert` lib usage for cases where we can't delegate alert maintenance to the main UI. PR: [bfx-report-electron#572](https://github.com/bitfinexcom/bfx-report-electron/pull/572)
- Added `USDT0 (Plasma)` and `USDT0 (Polygon)` support in the `Symbol` filters and enhanced mapping flow to show all `active` currencies (even not presented in pairs) instead of the fixed exception list. PR: [bfx-report-ui#992](https://github.com/bitfinexcom/bfx-report-ui/pull/992)
- Implemented `mtsUpdated` value representation in the `Updated At` column for the `Movements` report and also added this column support to the filters. PR: [bfx-report-ui#995](https://github.com/bitfinexcom/bfx-report-ui/pull/995)

### Changed

- Moved report emailing from `rest:ext:sendgrid` to `rest:core:mail` service. PRs: [bfx-report#456](https://github.com/bitfinexcom/bfx-report/pull/456), [bfx-report#457](https://github.com/bitfinexcom/bfx-report/pull/457)
- Excluded 2FA login and password from the error report modal window for the electron app in case the bfx api is not available. PR: [bfx-report#458](https://github.com/bitfinexcom/bfx-report/pull/458)
- Prevented changing params possibility (and related auto-refresh) during the initial sync for the complex reports that require synced data for calculation to avoid generation errors. PR: [bfx-report-ui#994](https://github.com/bitfinexcom/bfx-report-ui/pull/994)
- Prevented `authToken` from being removed from the `URL` if it was available initially after the redirection, according to the specialized needs of the `Customer` Support team. PR: [bfx-report-ui#996](https://github.com/bitfinexcom/bfx-report-ui/pull/996)
- Changed column filter title from `Columns` to `Columns Filter` for more clarity to the users. PR: [bfx-report-ui#997](https://github.com/bitfinexcom/bfx-report-ui/pull/997)
- Removed fees sections from the web and app `Summary` due to deprecation. PR: [bfx-report-ui#998](https://github.com/bitfinexcom/bfx-report-ui/pull/998)

### Fixed

- Excluded current value from language dropdown. PR: [bfx-report-ui#991](https://github.com/bitfinexcom/bfx-report-ui/pull/991)
- Fixed currently selected language displaying issue noted after the recent updates. PR: [bfx-report-ui#993](https://github.com/bitfinexcom/bfx-report-ui/pull/993)

## [4.39.0] - 2025-11-19

### Added
Expand Down
2 changes: 1 addition & 1 deletion bfx-report-ui
Submodule bfx-report-ui updated 38 files
+2 −2 package-lock.json
+1 −1 package.json
+2 −1 public/locales/en/translations.json
+3 −2 public/locales/es-EM/translations.json
+2 −1 public/locales/pt-BR/translations.json
+3 −2 public/locales/ru/translations.json
+3 −2 public/locales/tr/translations.json
+2 −1 public/locales/vi/translations.json
+2 −1 public/locales/zh-CN/translations.json
+2 −1 public/locales/zh-TW/translations.json
+5 −1 src/components/AccountBalance/AccountBalance.js
+0 −93 src/components/AccountSummary/AccountSummary.derivFees.js
+0 −43 src/components/AccountSummary/AccountSummary.feeTierVolume.js
+0 −153 src/components/AccountSummary/AccountSummary.fees.js
+8 −34 src/components/AccountSummary/AccountSummary.js
+0 −87 src/components/AppSummary/AppSummary.fees.js
+2 −12 src/components/AppSummary/AppSummary.js
+6 −1 src/components/AverageWinLoss/AverageWinLoss.js
+1 −0 src/components/ConcentrationRisk/ConcentrationRisk.js
+6 −1 src/components/FeesReport/FeesReport.js
+5 −1 src/components/LoanReport/LoanReport.js
+12 −0 src/components/Movements/Movements.columns.js
+1 −0 src/components/Movements/Movements.js
+5 −1 src/components/TradedVolume/TradedVolume.js
+0 −2 src/state/symbols/constants.js
+3 −3 src/state/symbols/reducer.js
+1 −1 src/state/ui/saga.js
+1 −0 src/ui/ColumnsFilter/ColumnSelector/ColumnSelector.columns.js
+6 −1 src/ui/LangMenu/LangMenu.js
+2 −0 src/ui/MultiPairSelector/MultiPairSelector.js
+2 −0 src/ui/MultiPairSelector/MultiPairSelector.props.js
+16 −0 src/ui/MultiSelect/_MultiSelect.scss
+2 −0 src/ui/MultiSymbolSelector/MultiSymbolSelector.js
+2 −0 src/ui/MultiSymbolSelector/MultiSymbolSelector.props.js
+7 −1 src/ui/ReportTypeSelector/ReportTypeSelector.js
+6 −2 src/ui/Select/Select.js
+7 −2 src/ui/TimeFrameSelector/TimeFrameSelector.js
+17 −10 src/ui/UnrealizedProfitSelector/UnrealizedProfitSelector.js
2 changes: 1 addition & 1 deletion bfx-reports-framework
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.39.0",
"version": "4.40.0",
"repository": "https://github.com/bitfinexcom/bfx-report-electron",
"description": "Reporting tool",
"author": "bitfinex.com",
Expand Down
168 changes: 17 additions & 151 deletions src/error-manager/show-modal-dialog.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,17 @@
'use strict'

const { app, dialog, screen } = require('electron')
const fs = require('fs')
const path = require('path')
const { app, dialog } = require('electron')
const { Converter } = require('showdown')
const Alert = require('electron-alert')
const { rootPath } = require('electron-root-path')
const i18next = require('i18next')

const {
createModalWindow
} = require('../window-creators')
const wins = require('../window-creators/windows')
const spawn = require('../helpers/spawn')
const getAlertCustomClassObj = require(
'../helpers/get-alert-custom-class-obj'
)
const isMainWinAvailable = require(
'../helpers/is-main-win-available'
)
const {
closeAlert
} = require('../modal-dialog-src/utils')
const {
WINDOW_EVENT_NAMES,
addOnceProcEventHandler
} = require('../window-creators/window-event-manager')
const getUIFontsAsCSSString = require(
'../helpers/get-ui-fonts-as-css-string'
)
const ThemeIpcChannelHandlers = require(
'../window-creators/main-renderer-ipc-bridge/theme-ipc-channel-handlers'
)

const mdStyle = fs.readFileSync(path.join(
rootPath, 'node_modules', 'github-markdown-css/github-markdown.css'
))
const fontsStyle = getUIFontsAsCSSString()
const themesStyle = fs.readFileSync(path.join(
__dirname, '../window-creators/layouts/themes.css'
))
const alertStyle = fs.readFileSync(path.join(
__dirname, '../modal-dialog-src/modal-dialog.css'
))
const alertScript = fs.readFileSync(path.join(
__dirname, '../modal-dialog-src/modal-dialog.js'
))

const fonts = `<style>${fontsStyle}</style>`
const themes = `<style>${themesStyle}</style>`
const mdS = `<style>${mdStyle}</style>`
const style = `<style>${alertStyle}</style>`
const script = `<script type="text/javascript">${alertScript}</script>`
const sound = { freq: 'F2', type: 'triange', duration: 1.5 }

const converter = new Converter({
tables: true,
Expand All @@ -59,120 +21,26 @@ const converter = new Converter({
requireSpaceBeforeHeadingText: true
})

const _fireAlert = (params) => {
const _fireAlert = async (params) => {
const {
title = i18next.t('errorManager.errorModalDialog.title'),
html = '',
parentWin,
hasNoParentWin
} = params ?? {}
const win = parentWin ?? wins.mainWindow

if (
!hasNoParentWin &&
!isMainWinAvailable(win)
) {
return { value: false }
}

const {
getCursorScreenPoint,
getDisplayNearestPoint
} = screen
const {
workArea
} = getDisplayNearestPoint(getCursorScreenPoint())
const { height: screenHeight } = workArea
const maxHeight = Math.floor(screenHeight * 0.90)

const alert = new Alert([mdS, fonts, themes, style, script])

const eventHandlerCtx = addOnceProcEventHandler(
WINDOW_EVENT_NAMES.CLOSED,
() => closeAlert(alert),
win
)

const bwOptions = {
frame: false,
transparent: false,
thickFrame: false,
closable: false,
hasShadow: false,
backgroundColor: ThemeIpcChannelHandlers.getWindowBackgroundColor(),
darkTheme: false,
parent: win,
modal: true,
width: 600,
webPreferences: {
contextIsolation: false
}
}
const swalOptions = {
position: 'center',
allowOutsideClick: false,
customClass: getAlertCustomClassObj({
htmlContainer: 'markdown-body'
}),

icon: 'question',
focusConfirm: true,
const res = await createModalWindow({
icon: 'error',
title,
text: html,
textClassName: 'markdown-body',
showConfirmButton: true,
confirmButtonText: i18next.t('errorManager.errorModalDialog.confirmButtonText'),
confirmButtonText: i18next
.t('errorManager.errorModalDialog.confirmButtonText'),
showCancelButton: true,
cancelButtonText: i18next.t('common.cancelButtonText'),
timerProgressBar: false,

...params,
title,
html,

willOpen: () => {
if (
!alert ||
!alert.browserWindow
) return
cancelButtonText: i18next.t('common.cancelButtonText')
}, { hasNoParentWin, height: 600 })

alert.browserWindow.hide()
},
didOpen: () => {
if (
!alert ||
!alert.browserWindow
) return

alert.browserWindow.show()
const { height } = alert.browserWindow
.getContentBounds()
alert.browserWindow.setBounds({
height: height > maxHeight
? maxHeight
: height
})
},
willClose: () => {
if (
!alert ||
!alert.browserWindow
) return

alert.browserWindow.hide()
},
didClose: () => {
eventHandlerCtx.removeListener()
}
}

const res = alert.fire(
swalOptions,
bwOptions,
null,
true,
false,
sound
)

return res
return res?.modalRes ?? {}
}

module.exports = async (params) => {
Expand Down Expand Up @@ -207,13 +75,11 @@ module.exports = async (params) => {
) {
const html = converter.makeHtml(mdIssue)

const {
value
} = await _fireAlert({ html, ...alertOpts })
const res = await _fireAlert({ html, ...alertOpts })

return {
isExit: false,
isReported: value
isReported: res?.dismiss === 'confirm'
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/initialize-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ const ThemeIpcChannelHandlers = require(
const AutoUpdateIpcChannelHandlers = require(
'./window-creators/main-renderer-ipc-bridge/auto-update-ipc-channel-handlers'
)
const ModalIpcChannelHandlers = require(
'./window-creators/main-renderer-ipc-bridge/modal-ipc-channel-handlers'
)
const triggerSyncAfterUpdates = require('./trigger-sync-after-updates')
const triggerElectronLoad = require('./trigger-electron-load')
const runServer = require('./run-server')
Expand Down Expand Up @@ -168,7 +171,8 @@ module.exports = async () => {
TranslationIpcChannelHandlers,
MenuIpcChannelHandlers,
ThemeIpcChannelHandlers,
AutoUpdateIpcChannelHandlers
AutoUpdateIpcChannelHandlers,
ModalIpcChannelHandlers
)

app.disableHardwareAcceleration()
Expand Down
Loading