From 6c1c5bf2a9c5c2291ffdfe777dce3863a0ee1af4 Mon Sep 17 00:00:00 2001 From: "m.ray" <16125548+MadalinaRaicu@users.noreply.github.com> Date: Wed, 22 Mar 2023 08:05:05 -0400 Subject: [PATCH] feat(trading): pin collateral row (#3218) --- .../src/integration/trading-accounts.cy.ts | 17 +++--------- libs/accounts/src/lib/accounts-manager.tsx | 6 ----- libs/accounts/src/lib/accounts-table.tsx | 27 ++++++++++++++++--- 3 files changed, 27 insertions(+), 23 deletions(-) diff --git a/apps/trading-e2e/src/integration/trading-accounts.cy.ts b/apps/trading-e2e/src/integration/trading-accounts.cy.ts index ae50a86cc..c0e142b2d 100644 --- a/apps/trading-e2e/src/integration/trading-accounts.cy.ts +++ b/apps/trading-e2e/src/integration/trading-accounts.cy.ts @@ -10,7 +10,7 @@ beforeEach(() => { describe('accounts', { tags: '@smoke' }, () => { it('renders accounts', () => { - const tradingAccountRowId = '[row-id="asset-0"]'; + const tradingAccountRowId = '[row-id="t-0"]'; cy.getByTestId('Collateral').click(); cy.getByTestId('tab-accounts').should('be.visible'); @@ -44,9 +44,9 @@ describe('accounts', { tags: '@smoke' }, () => { describe('sorting by ag-grid columns should work well', () => { it('sorting by asset', () => { cy.getByTestId('Collateral').click(); - const marketsSortedDefault = ['tBTC', 'AST0', 'tEURO', 'tDAI', 'tBTC']; - const marketsSortedAsc = ['AST0', 'tBTC', 'tBTC', 'tDAI', 'tEURO']; - const marketsSortedDesc = ['tEURO', 'tDAI', 'tBTC', 'tBTC', 'AST0']; + const marketsSortedDefault = ['tBTC', 'tEURO', 'tDAI', 'tBTC']; + const marketsSortedAsc = ['tBTC', 'tBTC', 'tDAI', 'tEURO']; + const marketsSortedDesc = ['tEURO', 'tDAI', 'tBTC', 'tBTC']; checkSorting( 'asset.symbol', marketsSortedDefault, @@ -59,7 +59,6 @@ describe('accounts', { tags: '@smoke' }, () => { cy.getByTestId('Collateral').click(); const marketsSortedDefault = [ '1,000.00002', - '100,001.01', '1,000.01', '1,000.00', '1,000.00001', @@ -69,10 +68,8 @@ describe('accounts', { tags: '@smoke' }, () => { '1,000.00001', '1,000.00002', '1,000.01', - '100,001.01', ]; const marketsSortedDesc = [ - '100,001.01', '1,000.01', '1,000.00002', '1,000.00001', @@ -90,7 +87,6 @@ describe('accounts', { tags: '@smoke' }, () => { cy.getByTestId('Collateral').click(); const marketsSortedDefault = [ '0.000.00%', - '1.010.00%', '0.010.00%', '0.000.00%', '0.000.00%', @@ -100,10 +96,8 @@ describe('accounts', { tags: '@smoke' }, () => { '0.000.00%', '0.000.00%', '0.010.00%', - '1.010.00%', ]; const marketsSortedDesc = [ - '1.010.00%', '0.010.00%', '0.000.00%', '0.000.00%', @@ -121,7 +115,6 @@ describe('accounts', { tags: '@smoke' }, () => { cy.getByTestId('Collateral').click(); const marketsSortedDefault = [ '1,000.00002', - '100,001.01', '1,000.01', '1,000.00', '1,000.00001', @@ -131,10 +124,8 @@ describe('accounts', { tags: '@smoke' }, () => { '1,000.00001', '1,000.00002', '1,000.01', - '100,001.01', ]; const marketsSortedDesc = [ - '100,001.01', '1,000.01', '1,000.00002', '1,000.00001', diff --git a/libs/accounts/src/lib/accounts-manager.tsx b/libs/accounts/src/lib/accounts-manager.tsx index f9d07a445..2d67b7423 100644 --- a/libs/accounts/src/lib/accounts-manager.tsx +++ b/libs/accounts/src/lib/accounts-manager.tsx @@ -10,7 +10,6 @@ import type { AccountFields } from './accounts-data-provider'; import { aggregatedAccountsDataProvider } from './accounts-data-provider'; import type { PinnedAsset } from './accounts-table'; import { AccountTable } from './accounts-table'; -import type { RowHeightParams } from 'ag-grid-community'; interface AccountManagerProps { partyId: string; @@ -50,10 +49,6 @@ export const AccountManager = ({ disabled: noBottomPlaceholder, }); - const getRowHeight = useCallback( - (params: RowHeightParams) => (params.node.rowPinned ? 32 : 22), - [] - ); return (