fix(trading): positions and markets settlement asset column filter and sort (#3873)

This commit is contained in:
Bartłomiej Głownia 2023-05-22 21:34:05 +02:00 committed by GitHub
parent 145539e0c0
commit 67643afd74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 10 deletions

View File

@ -84,15 +84,17 @@ export const MarketsTable = ({ data }: MarketsTableProps) => {
<AgGridColumn <AgGridColumn
colId="asset" colId="asset"
headerName={t('Settlement asset')} headerName={t('Settlement asset')}
field="tradableInstrument.instrument.product.settlementAsset" field="tradableInstrument.instrument.product.settlementAsset.symbol"
hide={window.innerWidth <= BREAKPOINT_MD} hide={window.innerWidth <= BREAKPOINT_MD}
cellRenderer={({ cellRenderer={({
value, data,
}: VegaICellRendererParams< }: VegaICellRendererParams<
MarketFieldsFragment, MarketFieldsFragment,
'tradableInstrument.instrument.product.settlementAsset' 'tradableInstrument.instrument.product.settlementAsset.symbol'
>) => >) => {
value ? ( const value =
data?.tradableInstrument.instrument.product.settlementAsset;
return value ? (
<ButtonLink <ButtonLink
onClick={(e) => { onClick={(e) => {
openAssetDetailsDialog(value.id, e.target as HTMLElement); openAssetDetailsDialog(value.id, e.target as HTMLElement);
@ -102,8 +104,8 @@ export const MarketsTable = ({ data }: MarketsTableProps) => {
</ButtonLink> </ButtonLink>
) : ( ) : (
'' ''
) );
} }}
/> />
<AgGridColumn <AgGridColumn
flex={2} flex={2}

View File

@ -203,13 +203,15 @@ export const MarketListTable = forwardRef<
/> />
<AgGridColumn <AgGridColumn
headerName={t('Settlement asset')} headerName={t('Settlement asset')}
field="tradableInstrument.instrument.product.settlementAsset" field="tradableInstrument.instrument.product.settlementAsset.symbol"
cellRenderer={({ cellRenderer={({
value, data,
}: VegaICellRendererParams< }: VegaICellRendererParams<
MarketMaybeWithData, MarketMaybeWithData,
'tradableInstrument.instrument.product.settlementAsset' 'tradableInstrument.instrument.product.settlementAsset.symbol'
>) => { >) => {
const value =
data?.tradableInstrument.instrument.product.settlementAsset;
return value ? ( return value ? (
<ButtonLink <ButtonLink
onClick={(e) => { onClick={(e) => {

View File

@ -216,6 +216,7 @@ export const PositionsTable = forwardRef<AgGridReact, Props>(
/> />
<AgGridColumn <AgGridColumn
headerName={t('Settlement asset')} headerName={t('Settlement asset')}
field="assetSymbol"
colId="asset" colId="asset"
minWidth={100} minWidth={100}
cellRenderer={({ data }: VegaICellRendererParams<Position>) => { cellRenderer={({ data }: VegaICellRendererParams<Position>) => {