parent
52b25b8b15
commit
df4cea8e00
@ -80,7 +80,7 @@ describe('markets table', { tags: '@smoke' }, () => {
|
|||||||
cy.getByTestId('view-market-list-link')
|
cy.getByTestId('view-market-list-link')
|
||||||
.should('have.attr', 'href', '#/markets/all')
|
.should('have.attr', 'href', '#/markets/all')
|
||||||
.click();
|
.click();
|
||||||
cy.get('[data-testid="Active markets"]').should(
|
cy.get('[data-testid="All markets"]').should(
|
||||||
'have.attr',
|
'have.attr',
|
||||||
'data-state',
|
'data-state',
|
||||||
'active'
|
'active'
|
||||||
|
@ -14,7 +14,7 @@ export const MarketsPage = () => {
|
|||||||
}, [updateTitle]);
|
}, [updateTitle]);
|
||||||
return (
|
return (
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<Tab id="active-markets" name={t('Active markets')}>
|
<Tab id="all-markets" name={t('All markets')}>
|
||||||
<Markets />
|
<Markets />
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab id="proposed-markets" name={t('Proposed markets')}>
|
<Tab id="proposed-markets" name={t('Proposed markets')}>
|
||||||
|
@ -15,7 +15,7 @@ import { AgGridDynamic as AgGrid, ButtonLink } from '@vegaprotocol/ui-toolkit';
|
|||||||
import { AgGridColumn } from 'ag-grid-react';
|
import { AgGridColumn } from 'ag-grid-react';
|
||||||
import type { AgGridReact } from 'ag-grid-react';
|
import type { AgGridReact } from 'ag-grid-react';
|
||||||
import * as Schema from '@vegaprotocol/types';
|
import * as Schema from '@vegaprotocol/types';
|
||||||
import type { MarketWithData } from '../../';
|
import type { MarketFieldsFragment, MarketWithData } from '../../';
|
||||||
import { useAssetDetailsDialogStore } from '@vegaprotocol/assets';
|
import { useAssetDetailsDialogStore } from '@vegaprotocol/assets';
|
||||||
|
|
||||||
const { MarketTradingMode, AuctionTrigger } = Schema;
|
const { MarketTradingMode, AuctionTrigger } = Schema;
|
||||||
@ -62,28 +62,6 @@ export const MarketListTable = forwardRef<
|
|||||||
headerName={t('Description')}
|
headerName={t('Description')}
|
||||||
field="tradableInstrument.instrument.name"
|
field="tradableInstrument.instrument.name"
|
||||||
/>
|
/>
|
||||||
<AgGridColumn
|
|
||||||
headerName={t('Settlement asset')}
|
|
||||||
field="tradableInstrument.instrument.product.settlementAsset"
|
|
||||||
cellRenderer={({
|
|
||||||
value,
|
|
||||||
}: VegaICellRendererParams<
|
|
||||||
MarketWithData,
|
|
||||||
'tradableInstrument.instrument.product.settlementAsset'
|
|
||||||
>) =>
|
|
||||||
value ? (
|
|
||||||
<ButtonLink
|
|
||||||
onClick={(e) => {
|
|
||||||
openAssetDetailsDialog(value.id, e.target as HTMLElement);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{value.symbol}
|
|
||||||
</ButtonLink>
|
|
||||||
) : (
|
|
||||||
''
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<AgGridColumn
|
<AgGridColumn
|
||||||
headerName={t('Trading mode')}
|
headerName={t('Trading mode')}
|
||||||
field="data"
|
field="data"
|
||||||
@ -103,6 +81,15 @@ export const MarketListTable = forwardRef<
|
|||||||
: Schema.MarketTradingModeMapping[tradingMode];
|
: Schema.MarketTradingModeMapping[tradingMode];
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
<AgGridColumn
|
||||||
|
headerName={t('Status')}
|
||||||
|
field="state"
|
||||||
|
valueGetter={({
|
||||||
|
data,
|
||||||
|
}: VegaValueGetterParams<MarketFieldsFragment, 'state'>) => {
|
||||||
|
return data?.state ? Schema.MarketStateMapping[data?.state] : '-';
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<AgGridColumn
|
<AgGridColumn
|
||||||
headerName={t('Best bid')}
|
headerName={t('Best bid')}
|
||||||
field="data.bestBidPrice"
|
field="data.bestBidPrice"
|
||||||
@ -175,6 +162,28 @@ export const MarketListTable = forwardRef<
|
|||||||
: addDecimalsFormatNumber(data.data.markPrice, data.decimalPlaces)
|
: addDecimalsFormatNumber(data.data.markPrice, data.decimalPlaces)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
<AgGridColumn
|
||||||
|
headerName={t('Settlement asset')}
|
||||||
|
field="tradableInstrument.instrument.product.settlementAsset"
|
||||||
|
cellRenderer={({
|
||||||
|
value,
|
||||||
|
}: VegaICellRendererParams<
|
||||||
|
MarketWithData,
|
||||||
|
'tradableInstrument.instrument.product.settlementAsset'
|
||||||
|
>) =>
|
||||||
|
value ? (
|
||||||
|
<ButtonLink
|
||||||
|
onClick={(e) => {
|
||||||
|
openAssetDetailsDialog(value.id, e.target as HTMLElement);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{value.symbol}
|
||||||
|
</ButtonLink>
|
||||||
|
) : (
|
||||||
|
''
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
<AgGridColumn headerName={t('Market ID')} field="id" />
|
<AgGridColumn headerName={t('Market ID')} field="id" />
|
||||||
</AgGrid>
|
</AgGrid>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user