From c78514714b092fc33952b8730ea9040bdf1216eb Mon Sep 17 00:00:00 2001 From: "m.ray" <16125548+MadalinaRaicu@users.noreply.github.com> Date: Wed, 22 Jun 2022 20:08:12 +0100 Subject: [PATCH] Fix/602 fix deal ticket component to be reused by both simple trading app and console v2 (#606) * fix: [#602] fix container - use grid tabs inside trading leaving deal ticket container reusable * fix: [#602] trade grid fixes tab bounds * fix: [#602] different queries for deal ticket and info market * fix: #602 generate deal ticket query fix for tests * chore: [#602] add generate-market-info-query.ts * fix: #602 add template side of 4 cols so that all components actually resize - fixes styling * fix: #602 add aliasQuery --- .../deal-ticket/deal-ticket-container.tsx | 1 - .../page-templates/template-sidebar.tsx | 2 +- .../mocks/generate-deal-ticket-query.ts | 55 --- .../mocks/generate-market-info-query.ts | 100 ++++++ apps/trading-e2e/src/support/trading.ts | 6 + apps/trading/pages/markets/trade-grid.tsx | 25 +- .../__generated__/DealTicketQuery.ts | 192 ----------- .../__generated__/MarketInfoQuery.ts | 324 ++++++++++++++++++ .../src/components/__generated__/index.ts | 1 + .../src/components/deal-ticket-container.tsx | 112 +----- .../src/components/info-market.tsx | 116 ++++++- 11 files changed, 578 insertions(+), 356 deletions(-) create mode 100644 apps/trading-e2e/src/support/mocks/generate-market-info-query.ts create mode 100644 libs/deal-ticket/src/components/__generated__/MarketInfoQuery.ts diff --git a/apps/simple-trading-app/src/app/components/deal-ticket/deal-ticket-container.tsx b/apps/simple-trading-app/src/app/components/deal-ticket/deal-ticket-container.tsx index 0889af306..14cda9ae5 100644 --- a/apps/simple-trading-app/src/app/components/deal-ticket/deal-ticket-container.tsx +++ b/apps/simple-trading-app/src/app/components/deal-ticket/deal-ticket-container.tsx @@ -7,7 +7,6 @@ import { DealTicketSteps } from './deal-ticket-steps'; import { useVegaWallet } from '@vegaprotocol/wallet'; import { gql, useQuery } from '@apollo/client'; import { DealTicketBalance } from './deal-ticket-balance'; -import * as React from 'react'; import type { PartyBalanceQuery } from './__generated__/PartyBalanceQuery'; const tempEmptyText =

Please select a market from the markets page

; diff --git a/apps/token/src/components/page-templates/template-sidebar.tsx b/apps/token/src/components/page-templates/template-sidebar.tsx index 971ce54cc..8df528c2f 100644 --- a/apps/token/src/components/page-templates/template-sidebar.tsx +++ b/apps/token/src/components/page-templates/template-sidebar.tsx @@ -12,7 +12,7 @@ export function TemplateSidebar({ children, sidebar }: TemplateSidebarProps) {