Merge branch 'feat/data-grid-dropdown' of github.com:vegaprotocol/frontend-monorepo into feat/oracle-basic-profile

This commit is contained in:
Madalina Raicu
2023-04-25 15:09:31 +03:00
12 changed files with 153 additions and 46 deletions
+8 -4
View File
@@ -91,7 +91,11 @@ jobs:
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: test-report-and-logs-${{ matrix.project }}
path: |
/home/runner/.vegacapsule/testnet/logs
frontend-monorepo/apps/trading-e2e/cypress/reports
name: logs-${{ matrix.project }}
path: /home/runner/.vegacapsule/testnet/logs
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: test-report-${{ matrix.project }}
path: frontend-monorepo/apps/trading-e2e/cypress/reports
@@ -54,6 +54,7 @@ export function stakingValidatorPageRemoveStake(stake: string) {
.and('contain', `Remove ${stake} $VEGA tokens at the end of epoch`)
.and('be.visible')
.click();
cy.contains('been removed from validator').should('be.visible');
closeDialog();
}
+16 -1
View File
@@ -3,7 +3,7 @@ import './i18n';
import React, { useEffect } from 'react';
import * as Sentry from '@sentry/react';
import { Integrations } from '@sentry/tracing';
import { BrowserRouter as Router } from 'react-router-dom';
import { BrowserRouter as Router, useLocation } from 'react-router-dom';
import { AppLoader } from './app-loader';
import { NetworkInfo } from '@vegaprotocol/network-info';
import { BalanceManager } from './components/balance-manager';
@@ -149,6 +149,20 @@ const Web3Container = ({
);
};
const ScrollToTop = () => {
const { pathname } = useLocation();
useEffect(() => {
// "document.documentElement.scrollTo" is the magic for React Router Dom v6
document.documentElement.scrollTo({
top: 0,
left: 0,
});
}, [pathname]);
return null;
};
const AppContainer = () => {
const { config, loading, error } = useEthereumConfig();
const { VEGA_ENV, GIT_COMMIT_HASH, GIT_BRANCH, ETHEREUM_PROVIDER_URL } =
@@ -183,6 +197,7 @@ const AppContainer = () => {
return (
<Router>
<ScrollToTop />
<AppStateProvider>
<div className="grid min-h-full text-white">
<AsyncRenderer<EthereumConfig | null>
+94 -28
View File
@@ -36,9 +36,9 @@
"tranche_id": 56,
"tranche_start": "2023-04-20T00:00:00.000Z",
"tranche_end": "2023-05-20T00:00:00.000Z",
"total_added": "15999.125",
"total_removed": "0",
"locked_amount": "13596.4045541087969481125",
"total_added": "17206.625",
"total_removed": "202.093666077975",
"locked_amount": "14192.3522349054765257",
"deposits": [
{
"amount": "188",
@@ -50,6 +50,11 @@
"user": "0xAc1c2783d64c29CDB79608f5B66a37Fd1ea35dD6",
"tx": "0xc1ede6de1653f205e0a743f609835648a67287a271a994cd141911ce13d5cac7"
},
{
"amount": "1207.5",
"user": "0x1447Efc62d5077d7AbB20492dF831Dd6c9Eb1756",
"tx": "0x9092eaf46d5cdba3b2219aa7187da4e1623004434c33a915956aa45d04d561f2"
},
{
"amount": "241.5",
"user": "0xBf1AaB792D729fA125e6D7122D4b916a1E1C44B1",
@@ -191,7 +196,13 @@
"tx": "0x679fcc1c3a29bdc259b6a4c044579a89c5357f42ed1963221669ebf43cc545b0"
}
],
"withdrawals": [],
"withdrawals": [
{
"amount": "202.093666077975",
"user": "0x1447Efc62d5077d7AbB20492dF831Dd6c9Eb1756",
"tx": "0x300c18b4220d3bc357f054792cb65f05d4005912bf8e5d9580b5b830cc3c0845"
}
],
"users": [
{
"address": "0x90Cf7B9958C3BbBCddAb52Ecc408535D4f3C4241",
@@ -223,6 +234,28 @@
"withdrawn_tokens": "0",
"remaining_tokens": "50"
},
{
"address": "0x1447Efc62d5077d7AbB20492dF831Dd6c9Eb1756",
"deposits": [
{
"amount": "1207.5",
"user": "0x1447Efc62d5077d7AbB20492dF831Dd6c9Eb1756",
"tranche_id": 56,
"tx": "0x9092eaf46d5cdba3b2219aa7187da4e1623004434c33a915956aa45d04d561f2"
}
],
"withdrawals": [
{
"amount": "202.093666077975",
"user": "0x1447Efc62d5077d7AbB20492dF831Dd6c9Eb1756",
"tranche_id": 56,
"tx": "0x300c18b4220d3bc357f054792cb65f05d4005912bf8e5d9580b5b830cc3c0845"
}
],
"total_tokens": "1207.5",
"withdrawn_tokens": "202.093666077975",
"remaining_tokens": "1005.406333922025"
},
{
"address": "0xBf1AaB792D729fA125e6D7122D4b916a1E1C44B1",
"deposits": [
@@ -705,8 +738,8 @@
"tranche_start": "2023-04-06T00:00:00.000Z",
"tranche_end": "2023-05-06T00:00:00.000Z",
"total_added": "8976",
"total_removed": "490.11243517665",
"locked_amount": "3439.2001111111111776",
"total_removed": "596.64743517951",
"locked_amount": "3214.7758703703708912",
"deposits": [
{
"amount": "111",
@@ -850,6 +883,11 @@
}
],
"withdrawals": [
{
"amount": "106.53500000286",
"user": "0x6F32AA5A6198329c16e438512F992a0548C856f9",
"tx": "0x4027743264e01043ddb16676c6f7914c110df9e7212bd3f21cb6842614ce238f"
},
{
"amount": "5.46866782407",
"user": "0x92A1e98C6f09970e45645Cbe57c6DcaF4547c8FE",
@@ -1103,6 +1141,12 @@
}
],
"withdrawals": [
{
"amount": "106.53500000286",
"user": "0x6F32AA5A6198329c16e438512F992a0548C856f9",
"tranche_id": 54,
"tx": "0x4027743264e01043ddb16676c6f7914c110df9e7212bd3f21cb6842614ce238f"
},
{
"amount": "155.03186111556",
"user": "0x6F32AA5A6198329c16e438512F992a0548C856f9",
@@ -1129,8 +1173,8 @@
}
],
"total_tokens": "858",
"withdrawn_tokens": "424.47530786232",
"remaining_tokens": "433.52469213768"
"withdrawn_tokens": "531.01030786518",
"remaining_tokens": "326.98969213482"
},
{
"address": "0x0bBf7580e036eA5D69ABe679CC90117EeC2e3dc1",
@@ -4478,7 +4522,7 @@
"tranche_end": "2023-12-05T00:00:00.000Z",
"total_added": "86666.297",
"total_removed": "0",
"locked_amount": "53304.4390480842904971845",
"locked_amount": "53126.3383787007632981199",
"deposits": [
{
"amount": "86666.297",
@@ -4544,7 +4588,7 @@
"tranche_end": "2023-06-01T00:00:00.000Z",
"total_added": "2500",
"total_removed": "0",
"locked_amount": "515.03643925518925",
"locked_amount": "504.733128561253575",
"deposits": [
{
"amount": "2500",
@@ -4665,7 +4709,7 @@
"tranche_end": "2023-09-01T00:00:00.000Z",
"total_added": "17500",
"total_removed": "0",
"locked_amount": "12316.06751962560225",
"locked_amount": "12244.72829232085475",
"deposits": [
{
"amount": "12500",
@@ -4932,7 +4976,7 @@
"tranche_end": "2023-08-01T00:00:00.000Z",
"total_added": "37500",
"total_removed": "12539.2989369",
"locked_amount": "20406.35071362799125",
"locked_amount": "20250.94718769183375",
"deposits": [
{
"amount": "7500",
@@ -5307,7 +5351,7 @@
"tranche_end": "2023-12-05T00:00:00.000Z",
"total_added": "129999.45",
"total_removed": "0",
"locked_amount": "53255.8054544746044383625",
"locked_amount": "53077.8672795424049222625",
"deposits": [
{
"amount": "129999.45",
@@ -5340,7 +5384,7 @@
"tranche_end": "2024-04-01T00:00:00.000Z",
"total_added": "54144.7663",
"total_removed": "0",
"locked_amount": "50667.46703183722144592557",
"locked_amount": "50556.50265628052469670738",
"deposits": [
{
"amount": "54144.7663",
@@ -5373,7 +5417,7 @@
"tranche_end": "2023-09-03T00:00:00.000Z",
"total_added": "62600",
"total_removed": "0",
"locked_amount": "22552.23359969558432",
"locked_amount": "22423.58956747843764",
"deposits": [
{
"amount": "10000",
@@ -5566,7 +5610,7 @@
"tranche_end": "2023-09-17T00:00:00.000Z",
"total_added": "5000",
"total_removed": "0",
"locked_amount": "1993.0774353120245",
"locked_amount": "1982.802352866565",
"deposits": [
{
"amount": "5000",
@@ -6107,7 +6151,7 @@
"tranche_end": "2023-05-01T00:00:00.000Z",
"total_added": "22500",
"total_removed": "7115.9985996",
"locked_amount": "807.34633977900456",
"locked_amount": "714.104224217310375",
"deposits": [
{
"amount": "7500",
@@ -6602,7 +6646,7 @@
"tranche_end": "2023-06-02T00:00:00.000Z",
"total_added": "1939928.38",
"total_removed": "928642.9598472029154",
"locked_amount": "204594.1627448135826823752",
"locked_amount": "200607.5779362562454442532",
"deposits": [
{
"amount": "1852091.69",
@@ -40418,7 +40462,7 @@
"tranche_end": "2023-06-05T00:00:00.000Z",
"total_added": "3732368.4671",
"total_removed": "715655.108029600523393",
"locked_amount": "338891.320746260923506948901",
"locked_amount": "332765.327876919897996287797",
"deposits": [
{
"amount": "1998.95815",
@@ -41811,7 +41855,7 @@
"tranche_end": "2023-12-05T00:00:00.000Z",
"total_added": "15870102.715470999700000001",
"total_removed": "860379.54790441442685852",
"locked_amount": "6501374.45010461734405894576483270014193025",
"locked_amount": "6479652.07271627106022165330027333915923225",
"deposits": [
{
"amount": "16249.93",
@@ -48312,7 +48356,7 @@
"tranche_end": "2023-05-05T00:00:00.000Z",
"total_added": "14597706.0446472999",
"total_removed": "5847991.884210280507681376",
"locked_amount": "280582.1543784642464604600874073187",
"locked_amount": "260528.1942722316783230342092766613",
"deposits": [
{
"amount": "129284.449",
@@ -56106,7 +56150,7 @@
"tranche_start": "2021-10-05T00:00:00.000Z",
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "5778205.3912159303",
"total_removed": "3421810.610823310514313769",
"total_removed": "3480709.486904665102263769",
"locked_amount": "0",
"deposits": [
{
@@ -56251,6 +56295,11 @@
}
],
"withdrawals": [
{
"amount": "58898.87608135458795",
"user": "0x83b1a48376E045D26420200345414e6b93066396",
"tx": "0xeb193da202cd833a574a524eff7f1dd13a0ee8669e51a7db36984ef4d6735fd6"
},
{
"amount": "219.945520329711288",
"user": "0xafa64cCa337eFEE0AD827F6C2684e69275226e90",
@@ -57768,6 +57817,12 @@
}
],
"withdrawals": [
{
"amount": "58898.87608135458795",
"user": "0x83b1a48376E045D26420200345414e6b93066396",
"tranche_id": 4,
"tx": "0xeb193da202cd833a574a524eff7f1dd13a0ee8669e51a7db36984ef4d6735fd6"
},
{
"amount": "66753.39849271259062",
"user": "0x83b1a48376E045D26420200345414e6b93066396",
@@ -57836,8 +57891,8 @@
}
],
"total_tokens": "1104995.291",
"withdrawn_tokens": "1046096.41491864541205",
"remaining_tokens": "58898.87608135458795"
"withdrawn_tokens": "1104995.291",
"remaining_tokens": "0"
},
{
"address": "0x5565d64f29Ea17355106DF3bA5903Eb793B3e139",
@@ -58289,8 +58344,8 @@
"tranche_start": "2022-06-05T00:00:00.000Z",
"tranche_end": "2023-06-05T00:00:00.000Z",
"total_added": "472355.6199999996",
"total_removed": "43302.7476142891849",
"locked_amount": "53699.266957621714397527714764084",
"total_removed": "43365.4083448891849",
"locked_amount": "52728.553391508069839034794317608",
"deposits": [
{
"amount": "3000",
@@ -64914,6 +64969,11 @@
"user": "0xb1169C6daAc76bAcaf0D8f87641Fc38fbabe569F",
"tx": "0xc182a183d124ab4faa413e71faa8c764fc265b4c568a5025ead367fbb86da331"
},
{
"amount": "62.6607306",
"user": "0x7345AaA0D0e4C4A46d921fA9323973956F2b7392",
"tx": "0xb13444d5ef684a442be6c285a6c38dcbc9959ff2eacc31474531826efe28c20a"
},
{
"amount": "168.502276762",
"user": "0x38A292CB98Dc602ECAFF94E8E5fADD9800e4bA13",
@@ -83464,6 +83524,12 @@
}
],
"withdrawals": [
{
"amount": "62.6607306",
"user": "0x7345AaA0D0e4C4A46d921fA9323973956F2b7392",
"tranche_id": 5,
"tx": "0xb13444d5ef684a442be6c285a6c38dcbc9959ff2eacc31474531826efe28c20a"
},
{
"amount": "152.077625568",
"user": "0x7345AaA0D0e4C4A46d921fA9323973956F2b7392",
@@ -83520,8 +83586,8 @@
}
],
"total_tokens": "1200",
"withdrawn_tokens": "1002.094025868",
"remaining_tokens": "197.905974132"
"withdrawn_tokens": "1064.754756468",
"remaining_tokens": "135.245243532"
},
{
"address": "0x47181cf36aDFb0b5dB7EfDB123f403D890607841",
@@ -1,7 +1,18 @@
import { aliasGQLQuery } from '@vegaprotocol/cypress';
import { fillsQuery } from '@vegaprotocol/mock';
const tabFills = 'tab-fills';
describe('fills', { tags: '@regression' }, () => {
// 7005-FILL-001
// 7005-FILL-002
// 7005-FILL-003
// 7005-FILL-004
// 7005-FILL-005
// 7005-FILL-006
// 7005-FILL-007
// 7005-FILL-008
beforeEach(() => {
// Ensure page loads with correct key
cy.window().then((window) => {
@@ -38,31 +49,37 @@ describe('fills', { tags: '@regression' }, () => {
});
function validateFillsDisplayed() {
cy.getByTestId('tab-fills').should('be.visible');
cy.getByTestId('tab-fills')
cy.getByTestId(tabFills).should('be.visible');
cy.getByTestId(tabFills).contains('Market');
cy.getByTestId(tabFills)
.get(
'[role="gridcell"][col-id="market.tradableInstrument.instrument.name"]'
)
.each(($marketSymbol) => {
cy.wrap($marketSymbol).invoke('text').should('not.be.empty');
});
cy.getByTestId('tab-fills')
cy.getByTestId(tabFills).contains('Size');
cy.get(`[col-id='size']`).eq(1).should('contain.text', '+');
cy.get(`[col-id='size']`).eq(2).should('contain.text', '-');
cy.getByTestId(tabFills)
.get('[role="gridcell"][col-id="size"]')
.each(($amount) => {
cy.wrap($amount).invoke('text').should('not.be.empty');
});
cy.getByTestId('tab-fills')
cy.getByTestId(tabFills).contains('Price');
cy.getByTestId(tabFills)
.get('[role="gridcell"][col-id="price"]')
.each(($prices) => {
cy.wrap($prices).invoke('text').should('not.be.empty');
});
cy.getByTestId('tab-fills')
cy.getByTestId(tabFills).contains('Notional');
cy.getByTestId(tabFills)
.get('[role="gridcell"][col-id="price_1"]')
.each(($total) => {
cy.wrap($total).invoke('text').should('not.be.empty');
});
cy.getByTestId('tab-fills')
cy.getByTestId(tabFills).contains('Role');
cy.getByTestId(tabFills)
.get('[role="gridcell"][col-id="aggressor"]')
.each(($role) => {
cy.wrap($role)
@@ -72,13 +89,15 @@ describe('fills', { tags: '@regression' }, () => {
expect(roles.indexOf(text.trim())).to.be.greaterThan(-1);
});
});
cy.getByTestId('tab-fills')
cy.getByTestId(tabFills).contains('Fee');
cy.getByTestId(tabFills)
.get(
'[role="gridcell"][col-id="market.tradableInstrument.instrument.product"]'
)
.each(($fees) => {
cy.wrap($fees).invoke('text').should('not.be.empty');
});
cy.getByTestId(tabFills).contains('Date');
const dateTimeRegex =
/(\d{1,2})\/(\d{1,2})\/(\d{4}), (\d{1,2}):(\d{1,2}):(\d{1,2})/gm;
cy.get('[col-id="createdAt"]').each(($tradeDateTime, index) => {
@@ -112,7 +112,7 @@ export const NetworkSwitcher = ({
<DropdownMenuTrigger
ref={menuRef}
className={classNames(
'flex justify-between items-center text-sm text-black dark:text-white py-1 px-2 rounded border border-vega-dark-200 whitespace-nowrap dark:hover:bg-vega-dark-500 hover:bg-vega-light-500',
'flex justify-between items-center text-sm text-vega-dark-600 dark:text-vega-light-600 py-1 px-2 rounded border border-vega-dark-200 whitespace-nowrap dark:hover:bg-vega-dark-500 hover:bg-vega-light-500',
className
)}
>
+1 -1
View File
@@ -1,5 +1,5 @@
{
"name": "@vegaprotocol/i18n",
"version": "0.0.1",
"version": "0.0.2",
"type": "commonjs"
}
+1
View File
@@ -6,6 +6,7 @@
"build": {
"executor": "@nrwl/js:tsc",
"outputs": ["{options.outputPath}"],
"format": ["esm", "cjs"],
"options": {
"outputPath": "dist/libs/i18n",
"main": "libs/i18n/src/index.ts",
+1 -1
View File
@@ -1,4 +1,4 @@
{
"name": "@vegaprotocol/react-helpers",
"version": "0.2.1"
"version": "0.2.2"
}
+1 -1
View File
@@ -1,4 +1,4 @@
{
"name": "@vegaprotocol/types",
"version": "0.0.1"
"version": "0.0.2"
}
+1
View File
@@ -15,6 +15,7 @@
"external": ["react/jsx-runtime"],
"rollupConfig": "@nrwl/react/plugins/bundle-rollup",
"compiler": "babel",
"format": ["esm", "cjs"],
"assets": [
{
"glob": "libs/types/README.md",
+1 -1
View File
@@ -1,4 +1,4 @@
{
"name": "@vegaprotocol/ui-toolkit",
"version": "0.11.1"
"version": "0.12.1"
}