Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release version 4.25.0 #388

Merged
merged 8 commits into from
Jul 31, 2024
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
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,61 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [4.25.0] - 2024-07-31

### Added

- Added transaction tax report. PRs: [bfx-reports-framework#373](https://github.com/bitfinexcom/bfx-reports-framework/pull/373), [bfx-reports-framework#378](https://github.com/bitfinexcom/bfx-reports-framework/pull/378), [bfx-reports-framework#379](https://github.com/bitfinexcom/bfx-reports-framework/pull/379), [bfx-reports-framework#380](https://github.com/bitfinexcom/bfx-reports-framework/pull/380), [bfx-reports-framework#381](https://github.com/bitfinexcom/bfx-reports-framework/pull/381), [bfx-reports-framework#382](https://github.com/bitfinexcom/bfx-reports-framework/pull/382), [bfx-reports-framework#383](https://github.com/bitfinexcom/bfx-reports-framework/pull/383), [bfx-reports-framework#384](https://github.com/bitfinexcom/bfx-reports-framework/pull/384), [bfx-reports-framework#385](https://github.com/bitfinexcom/bfx-reports-framework/pull/385)
- Increased the math precision of the trx tax report using `bignumber.js`. PR: [bfx-reports-framework#386](https://github.com/bitfinexcom/bfx-reports-framework/pull/386)
- Added test coverage for the transaction tax report. PR: [bfx-reports-framework#387](https://github.com/bitfinexcom/bfx-reports-framework/pull/387)
- Added unit test for core `look-up-trades` fn of the transaction tax report. PR: [bfx-reports-framework#388](https://github.com/bitfinexcom/bfx-reports-framework/pull/388)
- Added ability to select `EXCHANGE` trades for the trx tax report. PR: [bfx-reports-framework#389](https://github.com/bitfinexcom/bfx-reports-framework/pull/389)
- Added `_isInvoicePayOrder`, `_isAirdropOnWallet`, `_isMarginFundingPayment`, `_isAffiliateRebate`, `_isStakingPayments` ledgers to movements. PR: [bfx-reports-framework#391](https://github.com/bitfinexcom/bfx-reports-framework/pull/391)
- Added ability to show taxable payment amounts in the tax report. PR: [bfx-reports-framework#392](https://github.com/bitfinexcom/bfx-reports-framework/pull/392)
- Added perc progress of the trx tax report based on transactions that should be converted to USD using the pub-trade endpoint. PR: [bfx-reports-framework#394](https://github.com/bitfinexcom/bfx-reports-framework/pull/394)
- Added ability to send `IPC` messages when the trx tax report is ready. This is used in the electronjs environment to show a native OS notification to the app in case the tax report is being generated in the background. PR: [bfx-reports-framework#397](https://github.com/bitfinexcom/bfx-reports-framework/pull/397)
- Added ability to overwrite common interrupter when query bfx api. PR: [bfx-report#371](https://github.com/bitfinexcom/bfx-report/pull/371)
- Added interruption ability in case rate limit. When getting `Rate Limit` or `cool down` due to `Rate Limit` for 1min occurs, it needs to provide a feature to interrupt the tax report and sync being processed. PR: [bfx-report#373](https://github.com/bitfinexcom/bfx-report/pull/373)
- Added `TRY` to the FOREX ccy list. PR: [bfx-report#377](https://github.com/bitfinexcom/bfx-report/pull/377)
- Added `CSV`/`PDF` formatter for the tax report `source` field to follow the UI view, eg show `AIRDROP_ON_WALLET` as `Airdrop on wallet`. PR: [bfx-report#381](https://github.com/bitfinexcom/bfx-report/pull/381)
- Added `source` field to `CSV`/`PDF` of the tax report to follow the UI view. PR: [bfx-reports-framework#398](https://github.com/bitfinexcom/bfx-reports-framework/pull/398)
- Added ability to show the native notification in the electron app in case the tax report is being generated in the background. There we check if the main window is invisible show a notification otherwise don't. PR: [bfx-report-electron#386](https://github.com/bitfinexcom/bfx-report-electron/pull/386)
- Implemented UI representation for the new Tax Report. PR: [bfx-report-ui#816](https://github.com/bitfinexcom/bfx-report-ui/pull/816)
- Implemented dismissable `Disclaimer` message for the new `Tax Report`. PR: [bfx-report-ui#831](https://github.com/bitfinexcom/bfx-report-ui/pull/831)
- Implemented `Source` column representation for the new Tax Report and formatted like `Airdrop on wallet`. PR: [bfx-report-ui#836](https://github.com/bitfinexcom/bfx-report-ui/pull/836)
- Implemented generation `progress` representation for the new `Tax Report`. Implemented notification on `Tax Report` generation finish. PR: [bfx-report-ui#837](https://github.com/bitfinexcom/bfx-report-ui/pull/837)

### Changed

- Refactored DB models to be moved to separate files for easier supporting and readability. PR: [bfx-reports-framework#393](https://github.com/bitfinexcom/bfx-reports-framework/pull/393)
- Refactored sync schema to be moved to separate files for easier supporting and readability. PR: [bfx-reports-framework#395](https://github.com/bitfinexcom/bfx-reports-framework/pull/395)
- Refactored and optimizes `CollapsedTable` component. PR: [bfx-report-ui#815](https://github.com/bitfinexcom/bfx-report-ui/pull/815)
- Reworked and optimized `Spot` report column configuration getters. PR: [bfx-report-ui#817](https://github.com/bitfinexcom/bfx-report-ui/pull/817)
- Refactored and optimized the `DateFormatSelector` component. PR: [bfx-report-ui#818](https://github.com/bitfinexcom/bfx-report-ui/pull/818)
- Reworked and optimized `Funding Bids & Offers`, `Funding Loans (Unused)` and `Funding Credits (Used)` reports column configuration getters. Extended unified cell getter customizability for the cases when the tooltip content should be formatted differently from the main cell content. PR: [bfx-report-ui#819](https://github.com/bitfinexcom/bfx-report-ui/pull/819)
- Reworked and optimized the `LangMenu` component in a more performant way and reduces redundant code to avoid potential issues in the future. PR: [bfx-report-ui#820](https://github.com/bitfinexcom/bfx-report-ui/pull/820)
- Enhanced and unified `Ledgers`, `Funding Earnings`, `Staking Earnings` and `Affiliates Earnings` reports configuration getters. PR: [bfx-report-ui#821](https://github.com/bitfinexcom/bfx-report-ui/pull/821)
- Reworked and optimized the `Export` menu toggler component in a more performant way and reduces redundant code. PR: [bfx-report-ui#822](https://github.com/bitfinexcom/bfx-report-ui/pull/822)
- Reworked and optimized `Public Trades`, `Public Funding` and `Derivatives` reports column configuration getters. Implemented unified `formatType` utility for better reusability. PR: [bfx-report-ui#823](https://github.com/bitfinexcom/bfx-report-ui/pull/823)
- Reworked and optimized the `NavSwitcher` component and improved props linting. PR: [bfx-report-ui#824](https://github.com/bitfinexcom/bfx-report-ui/pull/824)
- Reworked and optimized `Invoices` report columns configuration getters. Implemented unified `getLinkCell` and `getJsonFormattedCell` utilities for better reusability. PR: [bfx-report-ui#827](https://github.com/bitfinexcom/bfx-report-ui/pull/827)
- Reworked and optimized the `ShowMilliseconds` component in a more performant way and reduces redundant code. PR: [bfx-report-ui#828](https://github.com/bitfinexcom/bfx-report-ui/pull/828)
- Prevented the `Tax Report` loading state still active in cases when the `emitTrxTaxReportGenerationInBackgroundToOne` event returns an `error` during report generation. PR: [bfx-report-ui#832](https://github.com/bitfinexcom/bfx-report-ui/pull/832)

### Fixed

- Strengthened consistency data for export. PR: [bfx-report#372](https://github.com/bitfinexcom/bfx-report/pull/372)
- Fixed pub-trade price lookup for the trx tax report. PR: [bfx-reports-framework#390](https://github.com/bitfinexcom/bfx-reports-framework/pull/390)
- Fixed the tax report if bfx-api `pub-trades` endpoint does not return array. PR: [bfx-reports-framework#396](https://github.com/bitfinexcom/bfx-reports-framework/pull/396)
- Prevented requests duplication on `Tax Report` refreshing in some cases. PR: [bfx-report-ui#833](https://github.com/bitfinexcom/bfx-report-ui/pull/833)
- Fixed issue with showing the sync state in some cases when the scheduler launches the synchronization. PR: [bfx-report-ui#835](https://github.com/bitfinexcom/bfx-report-ui/pull/835)
- Fixed `disabling` the `Authenticate` button during the `2FA` login flow to prevent the possibility of requests with the same token duplication and related errors. PR: [bfx-report-ui#838](https://github.com/bitfinexcom/bfx-report-ui/pull/838)

### Security

- Added `dependabot` config for the ability to open new PRs against the `staging` branch. Also bumped `pug` version to `3.0.3` to have a [security improvement](https://github.com/pugjs/pug/pull/3438). PR: [bfx-report#380](https://github.com/bitfinexcom/bfx-report/pull/380)
- Bumped `braces` from `3.0.2` to `3.0.3`. PR: [bfx-report-ui#826](https://github.com/bitfinexcom/bfx-report-ui/pull/826)

## [4.24.0] - 2024-05-08

### Added
Expand Down
2 changes: 1 addition & 1 deletion bfx-report-ui
Submodule bfx-report-ui updated 74 files
+13 −9 package-lock.json
+1 −1 package.json
+28 −6 public/locales/en/translations.json
+1 −1 src/components/AffiliatesEarnings/AffiliatesEarnings.js
+3 −3 src/components/Auth/LoginOtp/LoginOtp.js
+19 −101 src/components/Derivatives/Derivatives.columns.js
+25 −109 src/components/FundingCreditHistory/FundingCreditHistory.columns.js
+22 −99 src/components/FundingLoanHistory/FundingLoanHistory.columns.js
+19 −90 src/components/FundingOfferHistory/FundingOfferHistory.columns.js
+1 −1 src/components/FundingPayment/FundingPayment.js
+0 −18 src/components/Header/Export/Export.container.js
+10 −11 src/components/Header/Export/Export.js
+1 −1 src/components/Header/Export/index.js
+35 −149 src/components/Invoices/Invoices.columns.js
+114 −189 src/components/Ledgers/Ledgers.columns.js
+1 −1 src/components/Ledgers/Ledgers.js
+80 −133 src/components/PublicFunding/PublicFunding.columns.js
+1 −1 src/components/PublicFunding/PublicFunding.js
+78 −137 src/components/PublicTrades/PublicTrades.columns.js
+1 −1 src/components/PublicTrades/PublicTrades.js
+1 −1 src/components/StakingPayments/StakingPayments.js
+0 −73 src/components/TaxReport/Result/Balances.columns.js
+0 −35 src/components/TaxReport/Result/Result.container.js
+0 −286 src/components/TaxReport/Result/Result.js
+0 −1 src/components/TaxReport/Result/index.js
+0 −38 src/components/TaxReport/Snapshot/Snapshot.container.js
+0 −132 src/components/TaxReport/Snapshot/Snapshot.js
+0 −19 src/components/TaxReport/Snapshot/Snapshots.props.js
+0 −1 src/components/TaxReport/Snapshot/index.js
+112 −0 src/components/TaxReport/TaxReport.columns.js
+0 −18 src/components/TaxReport/TaxReport.container.js
+28 −0 src/components/TaxReport/TaxReport.disclaimer.js
+111 −74 src/components/TaxReport/TaxReport.js
+33 −0 src/components/TaxReport/TaxReport.loader.js
+0 −7 src/components/TaxReport/TaxReport.props.js
+0 −7 src/components/TaxReport/TaxReport.sections.js
+61 −11 src/components/TaxReport/_TaxReport.scss
+1 −1 src/components/TaxReport/index.js
+55 −94 src/components/Tickers/Tickers.columns.js
+1 −1 src/components/Tickers/Tickers.js
+4 −13 src/state/query/saga.js
+2 −0 src/state/sync/saga.js
+18 −41 src/state/taxReport/actions.js
+10 −6 src/state/taxReport/constants.js
+45 −147 src/state/taxReport/reducer.js
+31 −52 src/state/taxReport/saga.js
+15 −42 src/state/taxReport/selectors.js
+2 −2 src/styles/themes/_dark.scss
+44 −45 src/ui/CollapsedTable/CollapsedTable.js
+1 −3 src/ui/CollapsedTable/index.js
+3 −0 src/ui/DataTable/_DataTable.scss
+0 −18 src/ui/DateFormatSelector/DateFormatSelector.container.js
+22 −26 src/ui/DateFormatSelector/DateFormatSelector.js
+0 −9 src/ui/DateFormatSelector/DateFormatSelector.props.js
+1 −3 src/ui/DateFormatSelector/index.js
+0 −13 src/ui/ExportButton/ExportButton.container.js
+0 −20 src/ui/ExportButton/ExportButton.js
+0 −3 src/ui/ExportButton/index.js
+1 −1 src/ui/JSONFormat/_JSONFormat.scss
+0 −18 src/ui/LangMenu/LangMenu.container.js
+15 −12 src/ui/LangMenu/LangMenu.js
+0 −8 src/ui/LangMenu/LangMenu.props.js
+1 −3 src/ui/LangMenu/index.js
+25 −10 src/ui/NavSwitcher/NavSwitcher.js
+0 −9 src/ui/NavSwitcher/NavSwitcher.props.js
+1 −3 src/ui/NavSwitcher/index.js
+0 −18 src/ui/ShowMilliseconds/ShowMilliseconds.container.js
+17 −25 src/ui/ShowMilliseconds/ShowMilliseconds.js
+0 −11 src/ui/ShowMilliseconds/ShowMilliseconds.props.js
+1 −3 src/ui/ShowMilliseconds/index.js
+32 −0 src/ui/TaxStrategySelector/TaxStrategySelector.js
+1 −0 src/ui/TaxStrategySelector/index.js
+12 −0 src/ui/utils.js
+50 −0 src/utils/columns.js
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.24.0",
"version": "4.25.0",
"repository": "https://github.com/bitfinexcom/bfx-report-electron",
"description": "Reporting tool",
"author": "bitfinex.com",
Expand Down
3 changes: 3 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ const allowedProcessMessagesSet = _getAllowedStatesSet({
'READY_MIGRATIONS',
'ERROR_MIGRATIONS',

'READY_TRX_TAX_REPORT',
'ERROR_TRX_TAX_REPORT',

'ALL_TABLE_HAVE_BEEN_CLEARED',
'ALL_TABLE_HAVE_NOT_BEEN_CLEARED',

Expand Down
5 changes: 5 additions & 0 deletions src/initialize-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ module.exports = async () => {
await app.whenReady()
await enforceMacOSAppLocation()

// https://www.electronjs.org/docs/latest/tutorial/notifications#windows
if (process.platform === 'win32') {
app.setAppUserModelId(app.name)
}

const pathToUserData = app.getPath('userData')
const pathToUserDocuments = app.getPath('documents')

Expand Down
16 changes: 16 additions & 0 deletions src/manage-worker-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const isMainWinAvailable = require(
'./helpers/is-main-win-available'
)
const { showWindow } = require('./helpers/manage-window')
const showNotification = require('./show-notification')
const PROCESS_MESSAGES = require(
'../bfx-reports-framework/workers/loc.api/process.message.manager/process.messages'
)
Expand Down Expand Up @@ -236,6 +237,21 @@ module.exports = (ipc) => {

ipc.send({ state: PROCESS_STATES.REMOVE_ALL_TABLES })
}
if (
(
state === PROCESS_MESSAGES.READY_TRX_TAX_REPORT ||
state === PROCESS_MESSAGES.ERROR_TRX_TAX_REPORT
) &&
!wins?.mainWindow?.isVisible()
) {
const isError = state === PROCESS_MESSAGES.ERROR_TRX_TAX_REPORT
const body = isError
? 'An unexpected error occurred while generating the tax report!'
: 'Your tax report is ready!'
const urgency = isError ? 'critical' : 'normal'

showNotification({ body, urgency })
}
} catch (err) {
console.error(err)
}
Expand Down
26 changes: 26 additions & 0 deletions src/show-notification/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use strict'

const { Notification } = require('electron')
const path = require('path')

const icon = path.join(__dirname, '../../build/icons/64x64.png')

module.exports = (params) => {
if (!Notification.isSupported()) {
return
}

const notification = new Notification({
title: 'Bitfinex Report',
body: 'Notification',
silent: false,
timeoutType: 'never',
urgency: 'normal',
icon,

...params
})
notification.show()

return notification
}