Browse Source

refactoring

pull/5610/head
David Requeno 3 months ago
parent
commit
70de0e957c
  1. 52
      libs/ui/src/lib/activities-table/activities-table.component.stories.ts

52
libs/ui/src/lib/activities-table/activities-table.component.stories.ts

@ -1,5 +1,5 @@
import { Activity } from '@ghostfolio/api/app/order/interfaces/activities.interface';
import { GfSymbolModule } from '@ghostfolio/client/pipes/symbol/symbol.module';
import { GfSymbolPipe } from '@ghostfolio/client/pipes/symbol/symbol.pipe';
import { CommonModule } from '@angular/common';
import { MatButtonModule } from '@angular/material/button';
@ -24,22 +24,24 @@ import { GfActivitiesTableComponent } from './activities-table.component';
const activities: Activity[] = [
{
id: 'a1f1a111-1111-4111-8111-111111111111' as any,
id: '383d25b0-cff4-4b66-8bb7-8244cb787ca5' as any,
type: 'BUY',
date: new Date('2025-06-01T10:00:00.000Z') as any,
quantity: 10 as any,
fee: 1 as any,
feeInAssetProfileCurrency: 1,
feeInBaseCurrency: 1,
unitPrice: 250 as any,
unitPriceInAssetProfileCurrency: 250,
value: 2500,
valueInBaseCurrency: 2500,
currency: 'USD' as any,
isDraft: false as any,
account: {
id: 'acc-1' as any,
id: 'b73d7d6f-88b6-45f1-a1b2-27c1182fed81' as any,
name: 'Brokerage Account' as any,
platform: {
id: 'plt-ib' as any,
id: '7fececf6-9bf1-4318-ad1f-1d61e357a8c1' as any,
name: 'Interactive Brokers' as any,
url: 'https://interactivebrokers.com' as any
}
@ -51,22 +53,24 @@ const activities: Activity[] = [
} as any
} as any,
{
id: 'b2f2b222-2222-4222-8222-222222222222' as any,
id: '7ccf3e14-9fc3-4237-b6e7-831e185b9f76' as any,
type: 'DIVIDEND',
date: new Date('2025-06-10T10:00:00.000Z') as any,
quantity: 0 as any,
fee: 0 as any,
feeInAssetProfileCurrency: 0,
feeInBaseCurrency: 0,
unitPrice: 0 as any,
unitPriceInAssetProfileCurrency: 0,
value: 15.5,
valueInBaseCurrency: 15.5,
currency: 'USD' as any,
isDraft: false as any,
account: {
id: 'acc-1' as any,
id: '54927ef3-ee2b-488f-b72e-a42b16c57a16' as any,
name: 'Brokerage Account' as any,
platform: {
id: 'plt-ib' as any,
id: 'fa43c986-6638-42db-85f9-015c6b83f730' as any,
name: 'Interactive Brokers' as any,
url: 'https://interactivebrokers.com' as any
}
@ -78,22 +82,24 @@ const activities: Activity[] = [
} as any
} as any,
{
id: 'c3f3c333-3333-4333-8333-333333333333' as any,
id: '84ebfe47-14bc-4b26-88e4-4d3224bb453c' as any,
type: 'SELL',
date: new Date('2025-06-15T10:00:00.000Z') as any,
quantity: 5 as any,
fee: 1 as any,
feeInAssetProfileCurrency: 1,
feeInBaseCurrency: 1,
unitPrice: 300 as any,
unitPriceInAssetProfileCurrency: 300,
value: 1500,
valueInBaseCurrency: 1500,
currency: 'USD' as any,
isDraft: false as any,
account: {
id: 'acc-2' as any,
id: '169abccc-fc0d-49a4-9be2-4b3d6ef4d21f' as any,
name: 'Trading Account' as any,
platform: {
id: 'plt-rob' as any,
id: 'a02bcac9-cd82-48fb-8b89-3670f1ad8841' as any,
name: 'Robinhood' as any,
url: 'https://robinhood.com' as any
}
@ -118,7 +124,7 @@ export default {
GfActivityTypeComponent,
GfEntityLogoComponent,
GfNoTransactionsInfoComponent,
GfSymbolModule,
GfSymbolPipe,
GfValueComponent,
IonIcon,
MatButtonModule,
@ -138,6 +144,30 @@ export default {
type Story = StoryObj<GfActivitiesTableComponent>;
export const Loading: Story = {
args: {
baseCurrency: 'USD',
dataSource: undefined,
deviceType: 'desktop',
hasActivities: true,
hasPermissionToCreateActivity: false,
hasPermissionToDeleteActivity: false,
hasPermissionToExportActivities: false,
hasPermissionToOpenDetails: true,
locale: 'en-US',
pageIndex: 0,
pageSize: 10,
showAccountColumn: true,
showActions: false,
showCheckbox: false,
showNameColumn: true,
sortColumn: 'date',
sortDirection: 'desc',
sortDisabled: false,
totalItems: 0
}
};
export const Default: Story = {
args: {
baseCurrency: 'USD',

Loading…
Cancel
Save