Merge remote-tracking branch 'origin/develop' into feat/2297-pre-js-loading-state

This commit is contained in:
maciek
2022-12-27 16:20:12 +01:00
12 changed files with 24 additions and 17 deletions
@@ -183,12 +183,12 @@ describe('market info is displayed', { tags: '@smoke' }, () => {
.first()
.should('have.text', 'View governance proposal')
.and('have.attr', 'href')
.and('contain', '/governance/market-0');
.and('contain', '/proposals/market-0');
cy.getByTestId(externalLink)
.eq(1)
.should('have.text', 'Propose a change to market')
.and('have.attr', 'href')
.and('contain', '/governance/propose/update-market');
.and('contain', '/proposals/propose/update-market');
});
afterEach('close toggle', () => {
@@ -49,7 +49,7 @@ describe('Market proposal notification', { tags: '@smoke' }, () => {
cy.getByTestId('external-link').should(
'have.attr',
'href',
'https://stagnet3.token.vega.xyz/governance/123'
'https://stagnet3.token.vega.xyz/proposals/123'
);
});
});
@@ -106,7 +106,7 @@ describe('markets table', { tags: '@smoke' }, () => {
.and(
'have.attr',
'href',
'https://stagnet3.token.vega.xyz/governance/propose/new-market'
'https://stagnet3.token.vega.xyz/proposals/propose/new-market'
);
});
});
+1
View File
@@ -31,5 +31,6 @@ subscription AccountEvents($partyId: ID) {
balance
assetId
marketId
partyId
}
}
+2 -1
View File
@@ -17,7 +17,7 @@ export type AccountEventsSubscriptionVariables = Types.Exact<{
}>;
export type AccountEventsSubscription = { __typename?: 'Subscription', accounts: Array<{ __typename?: 'AccountUpdate', type: Types.AccountType, balance: string, assetId: string, marketId?: string | null }> };
export type AccountEventsSubscription = { __typename?: 'Subscription', accounts: Array<{ __typename?: 'AccountUpdate', type: Types.AccountType, balance: string, assetId: string, marketId?: string | null, partyId: string }> };
export const AccountFieldsFragmentDoc = gql`
fragment AccountFields on AccountBalance {
@@ -83,6 +83,7 @@ export const AccountEventsDocument = gql`
balance
assetId
marketId
partyId
}
}
`;
@@ -26,6 +26,7 @@ describe('getId', () => {
balance: '1',
assetId: 'assetId',
marketId: '',
partyId: '',
})
);
expect(
@@ -41,6 +42,7 @@ describe('getId', () => {
balance: '1',
assetId: 'assetId',
marketId: 'testId',
partyId: 'partyId',
})
);
});
@@ -66,6 +66,7 @@ const update = (
balance: delta.balance,
market: delta.marketId ? { id: delta.marketId } : null,
asset: { id: delta.assetId },
party: { id: delta.partyId },
});
}
});
@@ -182,6 +183,7 @@ export const accountsDataProvider = makeDerivedDataProvider<Account[], never>(
if (asset) {
return {
...account,
partyId: account.party?.id,
asset: {
...asset,
},
+1
View File
@@ -122,6 +122,7 @@ export const accountEventsSubscription = (
balance: '100000000',
assetId: 'asset-id',
marketId: null,
partyId: 'vega-0',
},
],
};
+5 -5
View File
@@ -88,12 +88,12 @@ export const useEtherscanLink = () => {
export const BLOG = 'https://blog.vega.xyz/';
// Token pages
export const TOKEN_NEW_MARKET_PROPOSAL = '/governance/propose/new-market';
export const TOKEN_NEW_MARKET_PROPOSAL = '/proposals/propose/new-market';
export const TOKEN_NEW_NETWORK_PARAM_PROPOSAL =
'/governance/propose/network-parameter';
export const TOKEN_GOVERNANCE = '/governance';
export const TOKEN_PROPOSALS = '/governance';
export const TOKEN_PROPOSAL = '/governance/:id';
'/proposals/propose/network-parameter';
export const TOKEN_GOVERNANCE = '/proposals';
export const TOKEN_PROPOSALS = '/proposals';
export const TOKEN_PROPOSAL = '/proposals/:id';
// Explorer pages
export const EXPLORER_TX = '/txs/:hash';
@@ -55,7 +55,7 @@ export const useColumnDefs = () => {
const { change } = data?.terms || {};
if (instrumentGuard(change) && VEGA_TOKEN_URL) {
if (data?.id) {
const link = `${VEGA_TOKEN_URL}/governance/${data.id}`;
const link = `${VEGA_TOKEN_URL}/proposals/${data.id}`;
return (
<ExternalLink href={link}>
{change.instrument.code}
+4 -4
View File
@@ -43,10 +43,10 @@ export const LiquidityTable = forwardRef<AgGridReact, LiquidityTableProps>(
if (!value) return '-';
return `${addDecimalsFormatNumber(value, assetDecimalPlaces ?? 0, 5)}`;
};
const stakeToCcySiskasFormatter = ({ value }: ValueFormatterParams) => {
const stakeToCcyVolumeFormatter = ({ value }: ValueFormatterParams) => {
if (!value) return '-';
const newValue = new BigNumber(value)
.times(stakeToCcySiskas ?? 1)
.times(Number(stakeToCcySiskas) || 1)
.toString();
return `${addDecimalsFormatNumber(newValue, assetDecimalPlaces ?? 0, 5)}`;
};
@@ -121,7 +121,7 @@ export const LiquidityTable = forwardRef<AgGridReact, LiquidityTableProps>(
headerTooltip={t(
`The liquidity provider's obligation to the market, calculated as the liquidity commitment amount multiplied by the value of the stake_to_ccy_siskas network parameter to convert into units of liquidity volume. The obligation can be met by a combination of LP orders and limit orders on the order book.`
)}
valueFormatter={stakeToCcySiskasFormatter}
valueFormatter={stakeToCcyVolumeFormatter}
/>
<AgGridColumn
headerName={t('Supplied')}
@@ -130,7 +130,7 @@ export const LiquidityTable = forwardRef<AgGridReact, LiquidityTableProps>(
)}
field="balance"
type="rightAligned"
valueFormatter={stakeToCcySiskasFormatter}
valueFormatter={stakeToCcyVolumeFormatter}
/>
<AgGridColumn
headerName={t('Status')}
+2 -2
View File
@@ -26,6 +26,6 @@ export const ExternalLinks = {
};
export const TokenLinks = {
PROPOSAL_PAGE: ':tokenUrl/governance/:proposalId',
UPDATE_PROPOSAL_PAGE: ':tokenUrl/governance/propose/update-market',
PROPOSAL_PAGE: ':tokenUrl/proposals/:proposalId',
UPDATE_PROPOSAL_PAGE: ':tokenUrl/proposals/propose/update-market',
};