fix(#2569): market id copy update (#2627)

* fix(#2569): market id copy update

* fix: enable cell text selection on ag-grid by default

* chore: fix partially filled order test

Co-authored-by: Rado <szpiechrados@gmail.com>
This commit is contained in:
m.ray 2023-01-17 08:59:34 -05:00 committed by GitHub
parent 5e97391d53
commit c70ec7676e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 12 deletions

View File

@ -192,7 +192,7 @@ describe('subscribe orders', { tags: '@smoke' }, () => {
'PartiallyFilled'
);
cy.getByTestId(`order-status-${orderId}`)
.parent()
.parentsUntil(`.ag-row`)
.siblings(`[col-id=${orderRemaining}]`)
.should('have.text', '4/5');
});

View File

@ -96,23 +96,23 @@ const AccountHistoryManager = ({
[pubKey]
);
const { data: assetsWithBalanceHistory } = useDataProvider({
const { data: accounts } = useDataProvider({
dataProvider: accountsOnlyDataProvider,
variables: variablesForOneTimeQuery,
skip: !pubKey,
});
const assetsWithBalance = useMemo(
() => assetsWithBalanceHistory?.map((e) => e?.asset?.id) || [],
[assetsWithBalanceHistory]
const assetIds = useMemo(
() => accounts?.map((e) => e?.asset?.id) || [],
[accounts]
);
const assets = useMemo(
() =>
assetData
.filter((a) => assetsWithBalance.includes(a.id))
.filter((a) => assetIds.includes(a.id))
.sort((a, b) => a.name.localeCompare(b.name)),
[assetData, assetsWithBalance]
[assetData, assetIds]
);
const [asset, setAsset] = useState<AssetFieldsFragment>(assets[0]);
const [range, setRange] = useState<typeof DateRange[keyof typeof DateRange]>(

View File

@ -66,7 +66,6 @@ export const LiquidityTable = forwardRef<AgGridReact, LiquidityTableProps>(
tooltipComponent: TooltipCellComponent,
sortable: true,
}}
enableCellTextSelection={true}
rowData={data}
>
<AgGridColumn

View File

@ -48,6 +48,10 @@ export const MarketListTable = forwardRef<
headerName={t('Market')}
field="tradableInstrument.instrument.code"
/>
<AgGridColumn
headerName={t('Description')}
field="tradableInstrument.instrument.name"
/>
<AgGridColumn
headerName={t('Settlement asset')}
field="tradableInstrument.instrument.product.settlementAsset"
@ -161,7 +165,7 @@ export const MarketListTable = forwardRef<
: addDecimalsFormatNumber(data.data.markPrice, data.decimalPlaces)
}
/>
<AgGridColumn headerName={t('Description')} field="name" />
<AgGridColumn headerName={t('Market ID')} field="id" />
</AgGrid>
);
});

View File

@ -33,7 +33,11 @@ export const AgGridThemed = ({
customThemeParams?: string;
}) => {
const { theme } = useThemeSwitcher();
const defaultProps = { rowHeight: 22, headerHeight: 22 };
const defaultProps = {
rowHeight: 22,
headerHeight: 22,
enableCellTextSelection: true,
};
return (
<div
className={`${className ?? ''} ${

View File

@ -33,11 +33,11 @@ export const AgGridThemed = React.forwardRef<
>
{theme === 'dark' ? (
<AgGridDarkTheme>
<AgGridReact {...props} ref={ref} />
<AgGridReact {...props} ref={ref} enableCellTextSelection={true} />
</AgGridDarkTheme>
) : (
<AgGridLightTheme>
<AgGridReact {...props} ref={ref} />
<AgGridReact {...props} ref={ref} enableCellTextSelection={true} />
</AgGridLightTheme>
)}
</div>