|
|
@ -14,86 +14,72 @@ import { GfEntityLogoComponent } from '../entity-logo'; |
|
|
|
import { GfValueComponent } from '../value'; |
|
|
|
import { GfAccountsTableComponent } from './accounts-table.component'; |
|
|
|
|
|
|
|
const mockAccounts = [ |
|
|
|
const accounts = [ |
|
|
|
{ |
|
|
|
id: '1', |
|
|
|
name: 'Checking Account', |
|
|
|
allocationInPercentage: null, |
|
|
|
balance: 278, |
|
|
|
balanceInBaseCurrency: 278, |
|
|
|
comment: null, |
|
|
|
createdAt: new Date('2025-06-01T06:52:49.063Z'), |
|
|
|
currency: 'USD', |
|
|
|
balance: 15000, |
|
|
|
value: 15000, |
|
|
|
valueInBaseCurrency: 15000, |
|
|
|
transactionCount: 25, |
|
|
|
allocationInPercentage: 0.15, |
|
|
|
id: '460d7401-ca43-4ed4-b08e-349f1822e9db', |
|
|
|
isExcluded: false, |
|
|
|
comment: 'Primary checking account', |
|
|
|
name: 'Coinbase Account', |
|
|
|
platform: { |
|
|
|
name: 'Bank of America', |
|
|
|
url: 'https://www.bankofamerica.com' |
|
|
|
id: '8dc24b88-bb92-4152-af25-fe6a31643e26', |
|
|
|
name: 'Coinbase', |
|
|
|
url: 'https://www.coinbase.com' |
|
|
|
}, |
|
|
|
createdAt: new Date(), |
|
|
|
updatedAt: new Date(), |
|
|
|
platformId: 'bofa', |
|
|
|
userId: 'user1' |
|
|
|
platformId: '8dc24b88-bb92-4152-af25-fe6a31643e26', |
|
|
|
transactionCount: 0, |
|
|
|
updatedAt: new Date('2025-06-01T06:52:49.063Z'), |
|
|
|
userId: '081aa387-487d-4438-83a4-3060eb2a016e', |
|
|
|
value: 278, |
|
|
|
valueInBaseCurrency: 278 |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: '2', |
|
|
|
name: 'Trading Account', |
|
|
|
currency: 'USD', |
|
|
|
balance: 5000, |
|
|
|
value: 125000, |
|
|
|
valueInBaseCurrency: 125000, |
|
|
|
transactionCount: 127, |
|
|
|
allocationInPercentage: 0.65, |
|
|
|
isExcluded: false, |
|
|
|
allocationInPercentage: null, |
|
|
|
balance: 12000, |
|
|
|
balanceInBaseCurrency: 12000, |
|
|
|
comment: null, |
|
|
|
platform: { |
|
|
|
name: 'Interactive Brokers', |
|
|
|
url: 'https://www.interactivebrokers.com' |
|
|
|
}, |
|
|
|
createdAt: new Date(), |
|
|
|
updatedAt: new Date(), |
|
|
|
platformId: 'ibkr', |
|
|
|
userId: 'user1' |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: '3', |
|
|
|
name: 'Savings Account', |
|
|
|
currency: 'EUR', |
|
|
|
balance: 20000, |
|
|
|
value: 20000, |
|
|
|
valueInBaseCurrency: 21600, |
|
|
|
transactionCount: 8, |
|
|
|
allocationInPercentage: 0.2, |
|
|
|
createdAt: new Date('2025-06-01T06:48:53.055Z'), |
|
|
|
currency: 'USD', |
|
|
|
id: '6d773e31-0583-4c85-a247-e69870b4f1ee', |
|
|
|
isExcluded: false, |
|
|
|
comment: 'Emergency fund', |
|
|
|
name: 'Private Banking Account', |
|
|
|
platform: { |
|
|
|
name: 'Deutsche Bank', |
|
|
|
url: 'https://www.deutsche-bank.de' |
|
|
|
id: '43e8fcd1-5b79-4100-b678-d2229bd1660d', |
|
|
|
name: 'J.P. Morgan', |
|
|
|
url: 'https://www.jpmorgan.com' |
|
|
|
}, |
|
|
|
createdAt: new Date(), |
|
|
|
updatedAt: new Date(), |
|
|
|
platformId: 'db', |
|
|
|
userId: 'user1' |
|
|
|
platformId: '43e8fcd1-5b79-4100-b678-d2229bd1660d', |
|
|
|
transactionCount: 0, |
|
|
|
updatedAt: new Date('2025-06-01T06:48:53.055Z'), |
|
|
|
userId: '081aa387-487d-4438-83a4-3060eb2a016e', |
|
|
|
value: 12000, |
|
|
|
valueInBaseCurrency: 12000 |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: '4', |
|
|
|
name: 'Excluded Account', |
|
|
|
currency: 'USD', |
|
|
|
balance: 1000, |
|
|
|
value: 1000, |
|
|
|
valueInBaseCurrency: 1000, |
|
|
|
transactionCount: 3, |
|
|
|
allocationInPercentage: 0, |
|
|
|
isExcluded: true, |
|
|
|
allocationInPercentage: null, |
|
|
|
balance: 150.2, |
|
|
|
balanceInBaseCurrency: 150.2, |
|
|
|
comment: null, |
|
|
|
createdAt: new Date('2025-05-31T13:00:13.940Z'), |
|
|
|
currency: 'USD', |
|
|
|
id: '776bd1e9-b2f6-4f7e-933d-18756c2f0625', |
|
|
|
isExcluded: false, |
|
|
|
name: 'Trading Account', |
|
|
|
platform: { |
|
|
|
name: 'Local Credit Union', |
|
|
|
url: null |
|
|
|
id: '9da3a8a7-4795-43e3-a6db-ccb914189737', |
|
|
|
name: 'Interactive Brokers', |
|
|
|
url: 'https://interactivebrokers.com' |
|
|
|
}, |
|
|
|
createdAt: new Date(), |
|
|
|
updatedAt: new Date(), |
|
|
|
platformId: 'lcu', |
|
|
|
userId: 'user1' |
|
|
|
platformId: '9da3a8a7-4795-43e3-a6db-ccb914189737', |
|
|
|
transactionCount: 12, |
|
|
|
valueInBaseCurrency: 95693.70321466809, |
|
|
|
updatedAt: new Date('2025-06-01T06:53:10.569Z'), |
|
|
|
userId: '081aa387-487d-4438-83a4-3060eb2a016e', |
|
|
|
value: 95693.70321466809 |
|
|
|
} |
|
|
|
]; |
|
|
|
|
|
|
@ -121,28 +107,9 @@ export default { |
|
|
|
|
|
|
|
type Story = StoryObj<GfAccountsTableComponent>; |
|
|
|
|
|
|
|
export const Loading: Story = { |
|
|
|
args: { |
|
|
|
accounts: [], |
|
|
|
baseCurrency: 'USD', |
|
|
|
deviceType: 'desktop', |
|
|
|
locale: 'en-US', |
|
|
|
showActions: false, |
|
|
|
showAllocationInPercentage: false, |
|
|
|
showBalance: true, |
|
|
|
showFooter: true, |
|
|
|
showTransactions: true, |
|
|
|
showValue: true, |
|
|
|
showValueInBaseCurrency: true, |
|
|
|
totalBalanceInBaseCurrency: 0, |
|
|
|
totalValueInBaseCurrency: 0, |
|
|
|
transactionCount: 0 |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
export const Default: Story = { |
|
|
|
args: { |
|
|
|
accounts: mockAccounts, |
|
|
|
accounts, |
|
|
|
baseCurrency: 'USD', |
|
|
|
deviceType: 'desktop', |
|
|
|
locale: 'en-US', |
|
|
@ -153,65 +120,27 @@ export const Default: Story = { |
|
|
|
showTransactions: true, |
|
|
|
showValue: true, |
|
|
|
showValueInBaseCurrency: true, |
|
|
|
totalBalanceInBaseCurrency: 56600, |
|
|
|
totalValueInBaseCurrency: 161600, |
|
|
|
transactionCount: 163 |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
export const WithActions: Story = { |
|
|
|
args: { |
|
|
|
accounts: mockAccounts, |
|
|
|
baseCurrency: 'USD', |
|
|
|
deviceType: 'desktop', |
|
|
|
locale: 'en-US', |
|
|
|
showActions: true, |
|
|
|
showAllocationInPercentage: true, |
|
|
|
showBalance: true, |
|
|
|
showFooter: true, |
|
|
|
showTransactions: true, |
|
|
|
showValue: true, |
|
|
|
showValueInBaseCurrency: true, |
|
|
|
totalBalanceInBaseCurrency: 56600, |
|
|
|
totalValueInBaseCurrency: 161600, |
|
|
|
transactionCount: 163 |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
export const MobileView: Story = { |
|
|
|
args: { |
|
|
|
accounts: mockAccounts, |
|
|
|
baseCurrency: 'USD', |
|
|
|
deviceType: 'mobile', |
|
|
|
locale: 'en-US', |
|
|
|
showActions: false, |
|
|
|
showAllocationInPercentage: false, |
|
|
|
showBalance: false, |
|
|
|
showFooter: false, |
|
|
|
showTransactions: true, |
|
|
|
showValue: false, |
|
|
|
showValueInBaseCurrency: true, |
|
|
|
totalBalanceInBaseCurrency: 56600, |
|
|
|
totalValueInBaseCurrency: 161600, |
|
|
|
transactionCount: 163 |
|
|
|
totalBalanceInBaseCurrency: 12428.2, |
|
|
|
totalValueInBaseCurrency: 107971.70321466809, |
|
|
|
transactionCount: 12 |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
export const WithoutFooter: Story = { |
|
|
|
args: { |
|
|
|
accounts: mockAccounts, |
|
|
|
accounts, |
|
|
|
baseCurrency: 'USD', |
|
|
|
deviceType: 'desktop', |
|
|
|
locale: 'en-US', |
|
|
|
showActions: false, |
|
|
|
showAllocationInPercentage: true, |
|
|
|
showAllocationInPercentage: false, |
|
|
|
showBalance: true, |
|
|
|
showFooter: false, |
|
|
|
showTransactions: true, |
|
|
|
showValue: true, |
|
|
|
showValueInBaseCurrency: true, |
|
|
|
totalBalanceInBaseCurrency: 56600, |
|
|
|
totalValueInBaseCurrency: 161600, |
|
|
|
transactionCount: 163 |
|
|
|
totalBalanceInBaseCurrency: 12428.2, |
|
|
|
totalValueInBaseCurrency: 107971.70321466809, |
|
|
|
transactionCount: 12 |
|
|
|
} |
|
|
|
}; |
|
|
|