Commit Graph

495 Commits

Author SHA1 Message Date
Sam Keen
34502a7c7f
frontend-monorepo-436 Env var files 'devent' typo (#437) 2022-05-23 09:51:19 +01:00
Dexter Edwards
29c3ed5180
fix: correct decimal places in network params table (#416) 2022-05-20 11:13:35 +01:00
macqbat
ef18ac8483
Feature/356 view a list of markets page and show additional useful information (#419)
* Initial commit after nx create

* Add .env files

* Add working commit for poc

* Make deal-ticket-manager.tsx accept children as props and export more components to be consumed by external apps

* Add stepper component to simple trading app

* Add basic prototype for simple trading app with stepper component

* simple market app - simple market list - initial commit

* simple market app - simple market list - add some new changes

* Resolve conflicts after rebase
Initial commit after nx create

* Add stepper component to simple trading app

* simple market app - simple market list - remove wrongly added file after rebase

* simple market app - simple market list - proposals of layout frame and percent change calculation

* simple market app - simple market list - proposals of working solution

* feat: [simple-app] - simple market list - clean up gQL queries

* feat: [simple-app] - simple market list - indicate no auctionEnd

* feat: [simple-app] - simple market list - a bunch of changes after review feedback

* feat: [simple-app] - simple market list - get expire date from instrument tag

* feat: [simple-app] - simple market list - a bunch of small improvements

Co-authored-by: Elmar Gasimov <elmar@vegaprotocol.io>
Co-authored-by: maciek <maciek@vegaprotocol.io>
2022-05-20 11:21:46 +02:00
botond
a352702bc5
Feat/Input prepend and append elements (#402)
* add custom element support to inputs

* use classnames instead of template literals
2022-05-20 09:42:11 +01:00
Ditmir-Vega
348badca2a
Test/add test for successful deposit (#399)
* add test for successful deposit

* update tests for deposits page to use magic strings

* remove unused variable

* used vegapublickey variable
2022-05-19 16:37:04 +01:00
Joe Tsang
5339788e87
test: increase timeout for token test (#428)
* test: increase timeout for token test

* fix: lint
2022-05-19 15:12:43 +01:00
botond
a89b2815ee
Fix/Use the rationale field on Proposals (#406)
* remove freeform from proposal query and replace it with the rationale field

* fix: regenerate types and fix proposal names getter

Co-authored-by: Botond <fekbot@gmail.com>
2022-05-19 12:12:13 +01:00
Sam Keen
4034e14120
frontend-monorepo-415 Explorer syntax highlighter CSS does not appear to be working (#418) 2022-05-17 15:40:29 +01:00
Matthew Russell
5a00ad8361
fix: flakey cypress test runs (#409)
* fix: wait for aggrid to render before asserting

* fix: mock markets manually and move wait for aggrid to init
2022-05-17 10:07:53 -04:00
botond
6800f22064
Feat/callout icon (#394)
* add icon prop to callout component

* add story example for custom icon node

* destructure props in fn args

* add accessibility props to callout icon

* remove redundant props

* add loading state to callout

* render loader first

* fix lint

Co-authored-by: Botond Fekete <fekbot@gmail.com>
2022-05-17 15:46:03 +02:00
John Walley
ad2d81eba3
chore(deps): update dependency pennant to v0.4.9 (#393) 2022-05-17 09:20:22 -04:00
Matthew Russell
d8bf887245
chore(#315): Convert token to use wallet lib
* delete token version of vega wallet serivce

* update use-user-vote to use new wallet service

* remove typo

* add further types for transaction submissions, add assets to withdraw page query

* update api client package to get generated types, adjust render logic of withdrawals page

* fix withdrawals list rendering

* update determine id function to not use nodejs buffer

* update service api client so it accepts new tx types

* remove stray logs and formatting

* make filtering erc20 assets the responsibility of the withdraw/deposit lib and not the app

* remove sha3 dep and use js-sha3 and ethers to determine ids

* use hook for fetching withdrawals form lib, add type policy to ensure withdrawal state is updated correctly

* fix: markets page feature
2022-05-17 09:04:41 -04:00
Dexter Edwards
b10432fdf3
Ci/generate tranches (#401)
* ci: generate tranches

* some tidying

* first run done locally

* ignore auto generated files for linting

* fix ignore
2022-05-17 13:26:04 +01:00
Dexter Edwards
04a9ef4ada
chore: add commit lint (#398) 2022-05-16 13:36:03 -04:00
John Walley
dca1af7391
Feat/246 Add candle chart controls (#281)
* Add candle chart controls

* Improve dropdown menu styling

* Use latest pennant version

* Use translation helper

* Square off highlighted corners
2022-05-13 14:08:32 +01:00
Sam Keen
492eef0fd0
Feat/304 token tailwind 2 (#396)
* remove staking page scss and invalid class for buttons

* remove pending stake and staking form scss

* make eith wallet buttons fill space

* convert app banner and app footer to tailwind

* remove low hanging fruit css

* add spacing back to home page

* fix spacings on various pages

* remove custom text helpers and replace with tailwind

* Loader component scss to tailwind

* Locked progress scss to tailwind

* Nav scss to tailwind. Cleaned up structure and removed 'bp3-dark' class from index.html

* Page template scss to tailwind

* Splash error scss to tailwind

* Splash loader scss to tailwind

* Token-input scss to tailwind

* Stateful button scss to tailwind

* Transaction button scss to tailwind

* Transactions modal scss to tailwind

* Modal scss to tailwind and improved structure

* vega-wallet scss to tailwind

* wallet-card (and child components in other files tweaked) scss to tailwind

* Token details scss to tailwind

* Home scss to tailwind

* current-proposal-state scss to tailwind

* current-proposal-status scss to tailwind

* Tweak of modal scss to tailwind

* vote-buttons scss to tailwind

* vote-details scss to tailwind

* vote-progress scss to tailwind

* tranche-table scss to tailwind

* vesting-table scss to tailwind

* withdrawals scss to tailwind

* removed reliance on colors.scss from styles.scss

* convert tranche item scss

* delete unused colors and fonts scss files

* convert styles.scss to regular css

* Tweak to token e2e tests to account for classname removal

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
2022-05-13 12:12:30 +01:00
Sam Keen
e0bcfe7bbe
Feat/231-explorer-infinite-loading-blocks (#306)
* Making a start with react-window-infinite-loader for the blocks infinite scrolling

* WIP block explorer infinte scroll

* WIP pairing

* pairing tidying

* Applied refetch url params more cleanly, moved useFetch to react-helpers lib

* Add notice of new blocks created since page load, some cleanup of blocks-infinite-list.tsx component

* Attempting a refresh of the 'new blocks' value in blocks-refetch.tsx

* Correctly updating state based on previous value

* Update libs/react-helpers/src/hooks/use-fetch.ts

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>

* Update libs/react-helpers/src/hooks/use-fetch.ts

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>

* Update apps/explorer/src/app/components/blocks/blocks-refetch.tsx

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>

* Cleanup from convos and PR

* Prettier formatting

* struggling with websocket tests

* struggling with websocket tests

* Progress on websocket tests for blocks-refetch.tsx

* Tests for blocks-refetch

* Tests for blocks-infinite-list

* Scroll test for blocks-infinite-list

* Defined NOOP in blocks-infinite-list.tsx

* Separate web sockets for each test

* Separate web sockets for each test

* Tweaked e2e tests to account for blocks taking longer to load

* fix tests

* Removed nx knowledge of empty simple-trading-app-e2e for now

* mock at use fetch level instead of at fetch level

* fix edge cases and add further tests

* fix failing e2e tests

* rename test

* Update apps/explorer-e2e/src/support/pages/blocks-page.ts

* Update apps/explorer-e2e/src/support/pages/blocks-page.ts

* rename

* test: use explicit wait for rather than times

* style: remove console

* test: correct env file

* Revert "test: correct env file"

This reverts commit d01d3cfa5e.

* think env var is incorrect

* correct env file

* fix flakiness

* add minor wait for test flakiness

* longer timeout

Co-authored-by: Dexter <dexter.edwards93@gmail.com>
Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
2022-05-13 12:03:08 +01:00
Dexter Edwards
107171d46a
renaming test files (#351)
* renaming test files

* add eslint plugin jest

* enable linting rule and additional rules

* fix a metric ton of linting errors

* fix lint errors

* remove export
2022-05-12 13:32:14 +01:00
Elmar
7266ac9b37
Feature/vega core (#376)
* Initial commit after nx create

* Add .env files

* Add working commit for poc

* Make deal-ticket-manager.tsx accept children as props and export more components to be consumed by external apps

* Add stepper component to simple trading app

* Add basic prototype for simple trading app with stepper component

* Remove unnecessary flags and env variables

* Change simple trading app port

* Refactor deal ticket container to be more dry

* Refactor deal ticket to be more dry

* Refactor app loader, remove tendermint socket and change providers for App.tsx in simple trading app

* Remove example cypress files and change config

* Fix linting issues
2022-05-12 10:56:21 +01:00
Ditmir-Vega
6bccfaf8ab
Task/252 Eth wallet connection and deposit form validation tests (#309)
* add feature/scenarios for deposits

* add file for auction orders tests

* update feature file for deposits

* update feature tests for deposit

* add feature/scenarios for deposits

* add file for auction orders tests

* update feature file for deposits

* update feature tests for deposit

* add test for wallet not connected

* fix lint warning

* add mock ethereum provider to allow connecting ethereum wallet

* add basic test for required validation errors

* add  aria for input errors for a11y and test targeting, expand submit form helper

* use mnemonic for private key generation, update tests to not submit and just assert validation message updates

* add chain id to cypress config

* update scenario

* remove feature file

* lint fix

* Update apps/trading-e2e/cypress.json

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>

* use mnemonic from github secret, update cypress.json env vars to match

* fix typo in test name and mnemonic env var

* update env variables

* update eth wallet mnemonic env

* Update libs/cypress/src/lib/eip1193-bridge.ts

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>

* remove unused reference to chainId

* update casing

* chainId reference from cypress.json

* Update apps/trading-e2e/cypress.json

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>

* Update apps/trading-e2e/src/support/step_definitions/deposits.step.ts

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>

* ignore a known failing step in the test due to wallet connected having approved status

* update testid

* update tests for deposits

* tidy up comments in custom cypress commands

* add comment about eager connect when running in cypress

* update deposits tests

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
2022-05-10 20:37:09 +01:00
Joe Tsang
81ea3fe946
Updated fix for failing market test (#392)
* Add additional checks before and after click

* Change back to use cy.contains

* Add assertion before click

* Change assert

* Remove force

* Add click

* Increase timeout
2022-05-10 09:20:32 +01:00
m.ray
319e14164d
Feat/324 sparkline component (#381)
* move colors in ui-toolkit/config

* fixing tests and add stories

* fixing some tests and edit story

* update sparkline story

* rename story templates for sparkline

* use tailwind colors and rename to *.spec.tsx

* use tailwind only

* remove test.tsx

* Update libs/tailwindcss-config/src/theme.js

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>

* remove gray from tailwind and use black/40 and white/40 for strokeCurrent

Co-authored-by: madalinaraicu <“madalina@raygroup.uk”>
Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
2022-05-09 18:19:19 +03:00
Bartłomiej Głownia
19a9e9adb0
Fix global types imports in generated files (#386) 2022-05-09 13:14:59 +02:00
Dexter Edwards
bdc9661646
Add PR template (#389) 2022-05-09 10:43:21 +01:00
Dexter Edwards
f9c8178412
Ci/generate queries (#336)
* generate GQL queries as an artefact

* rename artefact

* only run on master

* remove uneeded file
2022-05-09 10:15:45 +01:00
Sam Keen
6eb52c9a65
Feat/304 token scss to tailwind - part 1 (#327)
* Converted app.scss

* Made a start converting styles.scss

* commenting out unused colours - test for now

* restoring font-family

* Added correct text colour and height to top level elements

* Eth connect button styling

* Truncated wallet key on staking screen (had been causing overflow)

* Tranches Scss to tailwind

* Withdraw form Scss to tailwind

* Part way done with staking Scss to tailwind

* Removed redundant containerClass prop from epoch-countdown

* Cleanup of colors part 1

* Ran prettier

* Changes from the MR - removed epoch-countdown styles (apart from blueprint, which has moved to styles.scss)

* Changes from mr - removed extra button size classes (to be replaced with a prop later)

* Changes from mr - allow Tailwind's default list styles. Added role="list" for accessibility

* Border-box applied via wildcard again

* MR tweaks

* Removing the eslint warning for using role="list" on unstyled lists

* Correctly naming the jsx-ally plugin in the eslintrc file so that rules were correctly applied

* Removed redundant 'list-none' classes as Tailwind applies this by default for lists
2022-05-09 00:53:02 +01:00
candida-d
1bb7c23c6e
Update docs links to new URLs (#379) 2022-05-06 13:09:01 +01:00
Dexter Edwards
aaf19cd2f3
Ci/fix trading netlify build (#383)
* lock to nx 13.10.1

* remove duplicated dep
2022-05-06 12:54:17 +01:00
Joe Tsang
6746d3e003
Fix for failing test in CI (#374)
* Fix for failing test in CI

* Resolve PR comment

* Add check for visible

* Real fix for failing market test
2022-05-06 09:31:28 +01:00
m.ray
d03e4cf785
Feat/300 network parameters table (#333)
* network parameters table with key value rows and syntax blobs only for json values

* inline row not for syntax

* add unit test for network param table

* add cypress test to verify if values are non-empty

* remove some comments

* rename formatNumber method to addDecimalsFormatNumber and simplify formatNumber

* remove duplicate expect line

* use AsyncRenderer and sort params asc

* refactor and add extra tests to check ordering and loading cases

* format big number params with addDecimals formatNumber

* Update apps/explorer/src/app/routes/network-parameters/network-parameters.tsx

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>

* capitalize and refactor tests

* missing ; caused formatting to fail

Co-authored-by: madalinaraicu <“madalina@raygroup.uk”>
Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
2022-05-04 18:15:54 +03:00
Edd
431ea1bc80
Remove baseHref from stats page
This was breaking the result served via some IPFS urls (status was fine, subdirectory based gateways less so)
2022-05-04 12:45:11 +00:00
Edd
987cdb9d68
Disable SRI for stats (#334) 2022-05-04 09:02:54 +01:00
Dexter Edwards
9e82935658
Chore/more docs (#331)
* chore renable prettier md files

* remove duplicated information, add instructions on running formatting

* add more docs for other apps a libraries

* correct numbering

* Missing applications

* correction for serving

* more docs
2022-05-03 16:32:31 +01:00
Matthew Russell
1d8de701c9
Use types from web3-react library
export connectors to avoid needless data manipulation, use built in types from web3-react (#310)
2022-05-02 13:16:57 -04:00
m.ray
bd3268adf0
Feat/258 move key value table into monorepo (#320)
* move key-value-table to ui-toolkit and use tailwind

* add key-value-table to storybook

* override border width 1px from the styles of the app, remove td and th from children

* clone muted and numerical props to children elements

* proposal change table remove empty lines

* add Roboto mono to font-mono tailwind config

* remove labels and labelfor

* revert change on token-details-circulating

* export the whole components directory rather than explicitly individual components

* add classNames, add formatNumberPercentage, remove spans, add span in token details circulating

* data-testid=governance-proposal-enactmentDate and use span instead of div

* use custom spacing defined in tailwind & another README.md update for running cypress in watch mode

* update divs to span within the vesting table

* Update README.md

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>

* borders and text visible on both dark and light themes

* add headingLevel and use dl instead of tables

* update styling for dl inline

* remove added grey from tailwind

* ignore md files

Co-authored-by: madalinaraicu <“madalina@raygroup.uk”>
Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
2022-04-29 16:27:20 +03:00
Matthew Russell
3af4e354cd
Mock accounts for trading page (#311)
* move accounts and positions into own feature, add mock for accounts

* use length for expected number of columns

* combine trading feature tests into single trading-page.feature

* add orders scenario for trading page

* fix typo

* move related test cases for orders together
2022-04-29 14:24:15 +01:00
Joe Tsang
48f66a9ce8
Test/fix failing regex with comma (#329)
* Update regex to include commas

* Add force true to clicking on transaction
2022-04-29 11:55:55 +01:00
Sam Keen
2b910aa04c
Feat/272 syntax highlighter from explorer to ui-toolkit and feat/216 added light theme and feat/283 add to token (#286)
* Moved syntax highlighter from explorer to ui-toolkit

* Update libs/ui-toolkit/src/components/syntax-highlighter/syntax-highlighter.stories.tsx

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>

* Added a light theme for syntax highlighter, added the styling for syntax highlighter to our custom classes

* Suboptimal but successful way of ensuring styling is applied to syntax highlighter

* Styling syntax highlighter with scss

* Fix failing test

* Back to applying styling via custom plugin, but with a wrapper on the syntax highlighter ensuring Tailwind doesn't cull the classes

* Preferred class name

* prettier formatting

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
Co-authored-by: Joe <joe@vega.xyz>
2022-04-29 10:46:31 +01:00
Joe Tsang
de4c5499b9
Check for 2dp on total staked (#308)
* Check for 2dp on total staked

* Update apps/explorer-e2e/src/support/pages/home-page.ts

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
2022-04-28 15:36:42 +01:00
Matthew Russell
8ebb2ee81c
Allow any type of asset fields for the isERC20Asset type guard (#322) 2022-04-27 10:35:30 -07:00
Joe Tsang
448e0ec78f
Test/294 orders list (#301)
* Order mocks generated

* Tests passing with orders
2022-04-27 10:22:37 -07:00
Matthew Russell
29cd7dd2e4
Feat/104 withdraws (#263)
* add withdraw page

* add create page and withdraws lib with basic components

* add create withdrawal functionality, add withdrawal dialog

* re arrange pages so we have a pending page with a list of withdrawals and a withdraw page with the form

* handle withdrawal completion

* add withdraw dialog so withdraw is completed in one flow

* rename and arrange prop getter function to avoid use of any

* tidy up and make eth transaction and vega transaction hooks follow similar patterns

* make complete withdraw hook fetch approval, combine hooks for full flow

* delete unused file

* add accounts to query to get use max withdraw button

* use ag grid fro withdrawals list

* format amount in grid

* ensure party has id field for cache

* update to use t i18n function

* change complete status to better match values of WithdrawalStatus

* add asset lib file for type guard

* share queries for withdraws lib

* move web3 related hooks to the web3 lib and make web3 lib buildable

* add unit test for use-complete-withdraw

* add test for use-withdraw

* add e2e scenarios for withdrawals

* don render custom no withdrawals message and use ag grid prop

* make withdraw form take ethereum account as prop

* add test config, update withdraw form to handle min/max amounts, add unit test for withdraw form

* fix rendering 0 if not pending withdrawals

* use controlled component for select box

* tidy up async parts of tests, add test for withdraw-manager

* update withdraw dialog to use map for different tx states

* add fallback etherscan link, add test for withdraw-dialog.spec.tsx

* rename erc20 query in token app, change page structure to /withdraw and /withdrawals

* change linked vegawallet-service-api-client to newly published version

* ignore not implemented withdrawals e2e tests

* make vega tx pending and requested states the same, for now, until tx confirmation work is done

* Add some unit tests for determine-ids and remove0x

Neither are critical, but both are libs expected to be shared between
projects so some unit tests will hopefully ensure projects all have the
same expectations about how the functions act.

- Add 1 determine-ids test
- Add a few remove-0x tests
- Update determine-ids to use remove-0x
- Add a comment describing why i18n is what it is

* modify cache with client only field for tracking foreign chain progress

* move withdrawals-list to lib, add useWithdrawals hook

* add container component for withdrawals page

* add unit tests for withdrawals-table

* add some tests for use-withdrawals hook

* revert changes to generated files in other libs and apps

* update withdrawals scenarios

* resolve pr comments

* update page containers to use render prop rather than children

* delete unused files

* remove transaction dialog story

Co-authored-by: Ditmir-Vega <ditmir@vega.xyz>
Co-authored-by: Edd <edd@vega.xyz>
2022-04-26 19:51:39 -07:00
Matthew Russell
5134df02b5
Fix/268 Overflow error text (#299)
* add break word for transaction dialog error state, add stories for transaction-dialog

* update story text to be more explanatory
2022-04-26 18:48:29 -07:00
Bartłomiej Głownia
d0ec016adc
Feature/151 orderbook (#266)
* [#151] Add orderbook

* [#151] Add orderbook components

* [#151] Add market-depth data provider

* [#151] Add orderbook manager

* [#151] handle market depth updates in orderbook manager

* [#151] Fix PageQueryContainer usage of AsyncRenderer

* [#151] Move data handling logig out from orderbook manager

* [#151] Use mocked data, fix data issues

* [#151] Add compact order book data unit tests

* [#151] Add updateData unit tests

* [#151] Add updateCompactedData unit tests

* [#151] update cummulative vol on update, move data ref handling from effect to manager

* [#151] Update cummulative vol on update, fixes

* [#151] Optimieze orderbook ag-grid render

* [#151] Replace ag-grid with orderbook component

* [#151] Use react memo to optimize orderbook rendering

* [#151] Fix cummulative vol computation on compacted data update

* [#151] Add resolution controls

* [#151] Fix cumulative spelling mistake

* [#151] Use number instead of string for cumulative values

* [#151] Expose restart callback in useDataProvider hook

* [#151] Update empty cumulative values

* [#151] Add horizontal line under header in orderbook

* [#151] reuse orderbook data in market-depth chart

* [#151] restart market depth provider on sequenceNumber gap

* [#151] use throttle in orderbook and depth-chart

* [#151] Add comments, refactor data functions

* [#151] Add comments, refactor data functions

* [#151] move orderbook and depth-chart libs to market-depth
2022-04-26 17:26:28 +02:00
Matthew Russell
b5788379a3
add build netlify command and netlify.toml for token dapp (#302) 2022-04-26 07:32:23 -07:00
Joe Tsang
ceab1cbac4
Test for accounts (#285) 2022-04-26 14:58:52 +01:00
Joe Tsang
cd343cc1fe
UI test for positions table (#290)
* Positions test passing with mocks

* Update position mocks with changes

* Use Cypress env for public key in mock
2022-04-26 14:20:31 +01:00
John Walley
021b78dcbb
chore(deps): update dependency pennant to v0.4.7 (#288) 2022-04-25 14:44:12 -07:00
Michael Campbell
388bbd961c
Update README with set up instructions (#279)
* Update README.md

* Update README.md

added detail about env vars and networks.

* Fix typo

Co-authored-by: candida-d <62548908+candida-d@users.noreply.github.com>

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
Co-authored-by: candida-d <62548908+candida-d@users.noreply.github.com>
2022-04-25 10:35:01 -07:00
John Walley
ba19b5acca
Candle/depth chart switcher (#284) 2022-04-25 10:34:07 -07:00