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
12 changes: 12 additions & 0 deletions src/components/RecordTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ module.exports = {
{{ data.row.fiat }}
</span>

<span
v-else-if="data.column.field === 'vendorField'"
>
{{ data.row.vendorField }}
</span>

<span
v-else-if="data.column.field === 'id'"
class="flex items-center"
Expand Down Expand Up @@ -139,6 +145,12 @@ module.exports = {
sortable: false,
tdClass: 'whitespace-no-wrap'
},
{
label: 'Smartbridge',
field: 'vendorField',
sortable: true,
tdClass: 'whitespace-no-wrap'
},
{
label: 'ID',
sortable: false,
Expand Down
2 changes: 2 additions & 0 deletions src/components/modals/ExportRecordsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ module.exports = {
date: true,
crypto: true,
fiat: true,
vendorField: true,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the stored options need to be merged with the default options, otherwise the vendorField toggle won't be visible, something like:

    exportOptions () {
      const defaultOptions = {
        delimiter: ',',
        includeHeaders: true,
        columns: {
          date: true,
          crypto: true,
          fiat: true,
          vendorField: true,
          id: true
        }
      }

      const storedOptions = walletApi.storage.get('exportOptions', true)

      if (!storedOptions) {
        return defaultOptions
      }

      const columns = {
        ...defaultOptions.columns,
        ...storedOptions.columns
      }

      return {
        ...defaultOptions,
        ...storedOptions,
        columns
      }
    },

id: true
}
}
Expand All @@ -121,6 +122,7 @@ module.exports = {
date: 'Date',
crypto: 'Crypto Amount',
fiat: 'Fiat Amount',
vendorField: 'Smartbridge',
id: 'Transaction ID'
}
return labels[column]
Expand Down
3 changes: 2 additions & 1 deletion src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ module.exports = {

async __handleExportRecordsModalEvent (event, options) {
this.closeExportRecordsModal()

if (event === 'confirm') {
this.setOption('exportOptions', options.exportOptions)

Expand Down Expand Up @@ -695,6 +695,7 @@ module.exports = {
date: 'Date',
crypto: `Crypto Amount (${this.profile.network.token})`,
fiat: `Fiat Amount (${this.profile.currency})`,
vendorField: 'Smartbridge',
id: 'Transaction ID'
}

Expand Down
1 change: 1 addition & 0 deletions src/services/market.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class MarketService {
id: transaction.id,
date: transactionDate,
crypto: cryptoAmount.toString(),
vendorField: transaction.vendorField,
fiat: historicalPrice ? cryptoAmount.times(historicalPrice).toString() : 'n/a'
})
}
Expand Down