diff --git a/apps/explorer-e2e/.env.mainnet b/apps/explorer-e2e/.env.mainnet index a3600087a..ce254faab 100644 --- a/apps/explorer-e2e/.env.mainnet +++ b/apps/explorer-e2e/.env.mainnet @@ -2,7 +2,7 @@ NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api NX_TENDERMINT_URL=https://mainnet-observer-proxy01.ops.vega.xyz/ NX_TENDERMINT_WEBSOCKET_URL=wss://mainnet-observer-proxy01.ops.vega.xyz/websocket -NX_VEGA_URL=https://api.vega.xyz/query +NX_VEGA_URL=https://api.vega.community/graphql NX_VEGA_ENV=MAINNET NX_BLOCK_EXPLORER=https://be.explorer.vega.xyz/rest diff --git a/apps/explorer/.env b/apps/explorer/.env index bcffbed73..2b9425530 100644 --- a/apps/explorer/.env +++ b/apps/explorer/.env @@ -4,14 +4,14 @@ NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/stagnet1/vegawallet-stagnet1.toml NX_VEGA_ENV=STAGNET1 NX_VEGA_EXPLORER_URL=https://stagnet1.explorer.vega.xyz -NX_VEGA_TOKEN_URL=https://stagnet1.token.vega.xyz +NX_VEGA_TOKEN_URL=https://stagnet1.governance.vega.xyz NX_VEGA_WALLET_URL=http://localhost:1789 NX_TENDERMINT_URL=https://tm.n01.stagnet1.vega.xyz NX_TENDERMINT_WEBSOCKET_URL=wss://tm.n01.stagnet1.vega.xyz/websocket NX_BLOCK_EXPLORER=https://be.stagnet1.vega.xyz/rest NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_ORACLE_PROOFS_URL=https://raw.githubusercontent.com/vegaprotocol/well-known/main/__generated__/oracle-proofs.json -NX_VEGA_GOVERNANCE_URL=https://stagnet1.token.vega.xyz +NX_VEGA_GOVERNANCE_URL=https://stagnet1.governance.vega.xyz NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.jsoo # App flags diff --git a/apps/explorer/.env.devnet b/apps/explorer/.env.devnet index 104abfe16..ec549d011 100644 --- a/apps/explorer/.env.devnet +++ b/apps/explorer/.env.devnet @@ -5,8 +5,8 @@ NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-inter NX_VEGA_ENV=DEVNET NX_BLOCK_EXPLORER=https://be.devnet1.vega.xyz/rest NX_ETHERSCAN_URL=https://sepolia.etherscan.io -NX_VEGA_GOVERNANCE_URL=https://dev.token.vega.xyz +NX_VEGA_GOVERNANCE_URL=https://dev.governance.vega.xyz NX_VEGA_URL=https://api.devnet1.vega.xyz/graphql NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/devnet1/vegawallet-devnet1.toml NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json -NX_VEGA_EXPLORER_URL=/ \ No newline at end of file +NX_VEGA_EXPLORER_URL=/ diff --git a/apps/explorer/.env.mainnet b/apps/explorer/.env.mainnet index fd3e59fba..1491fd823 100644 --- a/apps/explorer/.env.mainnet +++ b/apps/explorer/.env.mainnet @@ -1,10 +1,10 @@ # App configuration variables -NX_TENDERMINT_URL=https://be.explorer.vega.xyz -NX_TENDERMINT_WEBSOCKET_URL=wss://be.explorer.vega.xyz/websocket +NX_TENDERMINT_URL=https://be.vega.community +NX_TENDERMINT_WEBSOCKET_URL=wss://be.vega.community/websocket NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks/master/mainnet1/mainnet1.toml NX_VEGA_ENV=MAINNET -NX_BLOCK_EXPLORER=https://be.explorer.vega.xyz/rest/ +NX_BLOCK_EXPLORER=https://be.vega.community/rest/ NX_ETHERSCAN_URL=https://etherscan.io -NX_VEGA_GOVERNANCE_URL=https://token.vega.xyz +NX_VEGA_GOVERNANCE_URL=https://governance.vega.xyz NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/mainnet/announcements.json -NX_VEGA_EXPLORER_URL=https://explorer.vega.xyz/ \ No newline at end of file +NX_VEGA_EXPLORER_URL=https://explorer.vega.xyz/ diff --git a/apps/explorer/.env.testnet b/apps/explorer/.env.testnet index 72d865002..f802179e5 100644 --- a/apps/explorer/.env.testnet +++ b/apps/explorer/.env.testnet @@ -7,6 +7,6 @@ NX_VEGA_ENV=TESTNET NX_VEGA_URL=https://api.n07.testnet.vega.xyz/graphql NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz NX_ETHERSCAN_URL=https://sepolia.etherscan.io -NX_VEGA_GOVERNANCE_URL=https://token.fairground.wtf +NX_VEGA_GOVERNANCE_URL=https://governance.fairground.wtf NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json -NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf \ No newline at end of file +NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf diff --git a/apps/explorer/src/app/routes/parties/id/index.tsx b/apps/explorer/src/app/routes/parties/id/index.tsx index 95399d49b..9f2b1e638 100644 --- a/apps/explorer/src/app/routes/parties/id/index.tsx +++ b/apps/explorer/src/app/routes/parties/id/index.tsx @@ -1,8 +1,5 @@ import { t } from '@vegaprotocol/i18n'; -import { - useDataProvider, - useScreenDimensions, -} from '@vegaprotocol/react-helpers'; +import { useScreenDimensions } from '@vegaprotocol/react-helpers'; import { useMemo } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; import { SubHeading } from '../../../components/sub-heading'; @@ -16,6 +13,7 @@ import { aggregatedAccountsDataProvider } from '@vegaprotocol/accounts'; import { PartyBlockStake } from './components/party-block-stake'; import { PartyBlockAccounts } from './components/party-block-accounts'; import { isValidPartyId } from './components/party-id-error'; +import { useDataProvider } from '@vegaprotocol/data-provider'; const Party = () => { const { party } = useParams<{ party: string }>(); diff --git a/apps/governance-e2e/.env b/apps/governance-e2e/.env index 1f48d6450..d662e8fe7 100644 --- a/apps/governance-e2e/.env +++ b/apps/governance-e2e/.env @@ -30,6 +30,6 @@ CYPRESS_TRUNCATED_VEGA_PUBLIC_KEY2=7f9cf0…c25535 CYPRESS_VEGA_ENV=CUSTOM CYPRESS_VEGA_PUBLIC_KEY=02eceaba4df2bef76ea10caf728d8a099a2aa846cced25737cccaa9812342f65 CYPRESS_VEGA_PUBLIC_KEY2=7f9cf07d3a9905b1a61a1069f7a758855da428bc0f4a97de87f48644bfc25535 -CYPRESS_VEGA_TOKEN_URL=https://token.fairground.wtf +CYPRESS_VEGA_TOKEN_URL=https://governance.fairground.wtf CYPRESS_VEGA_WALLET_URL=http://localhost:1789 CYPRESS_VEGA_WALLET_API_TOKEN= diff --git a/apps/governance-e2e/.env.mainnet b/apps/governance-e2e/.env.mainnet index cc224d3dc..7596bcd07 100644 --- a/apps/governance-e2e/.env.mainnet +++ b/apps/governance-e2e/.env.mainnet @@ -1,5 +1,5 @@ # App configuration variables NX_VEGA_ENV=MAINNET -NX_VEGA_URL=https://api.vega.xyz/query +NX_VEGA_URL=https://api.vega.community/graphql NX_ETHEREUM_PROVIDER_URL=https://mainnet.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 NX_ETHERSCAN_URL=https://etherscan.io diff --git a/apps/governance-e2e/src/integration/flow/proposal-details.cy.ts b/apps/governance-e2e/src/integration/flow/proposal-details.cy.ts index 2621e099d..dc1e18fc2 100644 --- a/apps/governance-e2e/src/integration/flow/proposal-details.cy.ts +++ b/apps/governance-e2e/src/integration/flow/proposal-details.cy.ts @@ -2,6 +2,7 @@ import { navigateTo, waitForSpinner, navigation, + turnTelemetryOff, } from '../../support/common.functions'; import { createRawProposal, @@ -50,6 +51,7 @@ describe( beforeEach('visit proposals tab', function () { cy.clearLocalStorage(); + turnTelemetryOff(); cy.reload(); waitForSpinner(); cy.connectVegaWallet(); diff --git a/apps/governance-e2e/src/integration/flow/proposal-enacted.cy.ts b/apps/governance-e2e/src/integration/flow/proposal-enacted.cy.ts index 293437d45..25533185e 100644 --- a/apps/governance-e2e/src/integration/flow/proposal-enacted.cy.ts +++ b/apps/governance-e2e/src/integration/flow/proposal-enacted.cy.ts @@ -2,6 +2,7 @@ import { navigateTo, navigation, + turnTelemetryOff, waitForSpinner, } from '../../support/common.functions'; import { @@ -37,6 +38,7 @@ context( beforeEach('visit proposals', function () { cy.clearLocalStorage(); + turnTelemetryOff(); cy.reload(); waitForSpinner(); cy.connectVegaWallet(); diff --git a/apps/governance-e2e/src/integration/flow/proposal-flow.cy.ts b/apps/governance-e2e/src/integration/flow/proposal-flow.cy.ts index e810e63d4..41014e847 100644 --- a/apps/governance-e2e/src/integration/flow/proposal-flow.cy.ts +++ b/apps/governance-e2e/src/integration/flow/proposal-flow.cy.ts @@ -20,6 +20,7 @@ import { navigateTo, navigation, closeDialog, + turnTelemetryOff, } from '../../support/common.functions'; import { clickOnValidatorFromList, @@ -85,6 +86,7 @@ context( beforeEach('visit governance tab', function () { cy.clearLocalStorage(); + turnTelemetryOff(); cy.reload(); waitForSpinner(); cy.connectVegaWallet(); diff --git a/apps/governance-e2e/src/integration/flow/proposal-forms.cy.ts b/apps/governance-e2e/src/integration/flow/proposal-forms.cy.ts index 3855eaf24..a7885b92a 100644 --- a/apps/governance-e2e/src/integration/flow/proposal-forms.cy.ts +++ b/apps/governance-e2e/src/integration/flow/proposal-forms.cy.ts @@ -2,6 +2,7 @@ import { closeDialog, navigateTo, navigation, + turnTelemetryOff, waitForSpinner, } from '../../support/common.functions'; import { @@ -77,6 +78,7 @@ context( beforeEach('visit governance tab', function () { cy.clearLocalStorage(); + turnTelemetryOff(); cy.reload(); waitForSpinner(); cy.connectVegaWallet(); diff --git a/apps/governance-e2e/src/integration/flow/proposal-list.cy.ts b/apps/governance-e2e/src/integration/flow/proposal-list.cy.ts index bbae98c34..970795ebe 100644 --- a/apps/governance-e2e/src/integration/flow/proposal-list.cy.ts +++ b/apps/governance-e2e/src/integration/flow/proposal-list.cy.ts @@ -2,6 +2,7 @@ import type { testFreeformProposal } from '../../support/common-interfaces'; import { navigateTo, navigation, + turnTelemetryOff, waitForSpinner, } from '../../support/common.functions'; import { @@ -36,6 +37,7 @@ describe('Governance flow for proposal list', { tags: '@slow' }, function () { beforeEach('visit proposals tab', function () { cy.clearLocalStorage(); + turnTelemetryOff(); cy.reload(); waitForSpinner(); cy.connectVegaWallet(); diff --git a/apps/governance-e2e/src/integration/flow/rewards-flow.cy.ts b/apps/governance-e2e/src/integration/flow/rewards-flow.cy.ts index be874a12e..a6c3ff780 100644 --- a/apps/governance-e2e/src/integration/flow/rewards-flow.cy.ts +++ b/apps/governance-e2e/src/integration/flow/rewards-flow.cy.ts @@ -1,6 +1,7 @@ import { navigateTo, navigation, + turnTelemetryOff, waitForSpinner, } from '../../support/common.functions'; import { @@ -26,6 +27,7 @@ const rewardsTimeOut = { timeout: 60000 }; context('rewards - flow', { tags: '@slow' }, function () { before('set up environment to allow rewards', function () { cy.clearLocalStorage(); + turnTelemetryOff(); cy.visit('/'); waitForSpinner(); depositAsset(vegaAssetAddress, '1000', 18); diff --git a/apps/governance-e2e/src/integration/flow/token-association-flow.cy.ts b/apps/governance-e2e/src/integration/flow/token-association-flow.cy.ts index 3eb6ce5d6..f08816d12 100644 --- a/apps/governance-e2e/src/integration/flow/token-association-flow.cy.ts +++ b/apps/governance-e2e/src/integration/flow/token-association-flow.cy.ts @@ -4,6 +4,7 @@ import { waitForSpinner, navigateTo, navigation, + turnTelemetryOff, } from '../../support/common.functions'; import { stakingPageAssociateTokens, @@ -54,6 +55,7 @@ context( 'teardown wallet & drill into a specific validator', function () { cy.clearLocalStorage(); + turnTelemetryOff(); cy.reload(); waitForSpinner(); cy.connectVegaWallet(); diff --git a/apps/governance-e2e/src/integration/flow/withdrawal-flow.cy.ts b/apps/governance-e2e/src/integration/flow/withdrawal-flow.cy.ts index b2d81f053..74b90d2c8 100644 --- a/apps/governance-e2e/src/integration/flow/withdrawal-flow.cy.ts +++ b/apps/governance-e2e/src/integration/flow/withdrawal-flow.cy.ts @@ -1,6 +1,7 @@ import { navigateTo, navigation, + turnTelemetryOff, waitForSpinner, } from '../../support/common.functions'; import { ethereumWalletConnect } from '../../support/wallet-eth.functions'; @@ -55,6 +56,7 @@ context( beforeEach('Navigate to withdrawal page', function () { cy.clearLocalStorage(); + turnTelemetryOff(); cy.reload(); waitForSpinner(); navigateTo(navigation.withdraw); diff --git a/apps/governance-e2e/src/integration/view/home.cy.ts b/apps/governance-e2e/src/integration/view/home.cy.ts index 6e2df34fd..4ceff6fa7 100644 --- a/apps/governance-e2e/src/integration/view/home.cy.ts +++ b/apps/governance-e2e/src/integration/view/home.cy.ts @@ -161,7 +161,7 @@ context('Home Page - verify elements on page', { tags: '@smoke' }, function () { cy.getByTestId('menu-drawer').should('be.visible'); }); - it('should have link for proposal page', function () { + it.skip('should have link for proposal page', function () { cy.getByTestId('menu-drawer').within(() => { cy.get('[href="/proposals"]') .should('exist') diff --git a/apps/governance-e2e/src/integration/view/proposal.cy.ts b/apps/governance-e2e/src/integration/view/proposal.cy.ts index 63438a3c6..3f5e01321 100644 --- a/apps/governance-e2e/src/integration/view/proposal.cy.ts +++ b/apps/governance-e2e/src/integration/view/proposal.cy.ts @@ -54,7 +54,7 @@ context( }); }); - it('should be able to see button for - new proposal', function () { + it.skip('should be able to see button for - new proposal', function () { // 3001-VOTE-002 cy.get(newProposalLink) .should('be.visible') @@ -63,7 +63,7 @@ context( .and('equal', '/proposals/propose'); }); - it('should be able to see a connect wallet button - if vega wallet disconnected and user is submitting new proposal', function () { + it.skip('should be able to see a connect wallet button - if vega wallet disconnected and user is submitting new proposal', function () { goToMakeNewProposal(governanceProposalType.NETWORK_PARAMETER); cy.get(connectToVegaWalletButton) .should('be.visible') diff --git a/apps/governance-e2e/src/integration/view/pubkey-view.cy.ts b/apps/governance-e2e/src/integration/view/pubkey-view.cy.ts index b4cf0056d..e12225587 100644 --- a/apps/governance-e2e/src/integration/view/pubkey-view.cy.ts +++ b/apps/governance-e2e/src/integration/view/pubkey-view.cy.ts @@ -3,6 +3,7 @@ import { navigateTo, navigation, + turnTelemetryOff, waitForSpinner, } from '../../support/common.functions'; import { @@ -26,6 +27,7 @@ context('View functionality with public key', { tags: '@smoke' }, function () { beforeEach('visit home page', function () { cy.clearLocalStorage(); + turnTelemetryOff(); cy.visit('/'); waitForSpinner(); cy.connectPublicKey(vegaWalletPubKey); @@ -44,7 +46,7 @@ context('View functionality with public key', { tags: '@smoke' }, function () { .and('contain.text', 'USDC (fake)'); }); - it('Unable to submit proposal with public key', function () { + it.skip('Unable to submit proposal with public key', function () { const expectedErrorTxt = `You are connected in a view only state for public key: ${vegaWalletPubKey}. In order to send transactions you must connect to a real wallet.`; navigateTo(navigation.proposals); diff --git a/apps/governance-e2e/src/integration/view/rewards.cy.ts b/apps/governance-e2e/src/integration/view/rewards.cy.ts index f5e4fb194..856caeae3 100644 --- a/apps/governance-e2e/src/integration/view/rewards.cy.ts +++ b/apps/governance-e2e/src/integration/view/rewards.cy.ts @@ -13,7 +13,6 @@ context( { tags: '@regression' }, function () { before('navigate to rewards page', function () { - cy.clearLocalStorage(); cy.visit('/'); navigateTo(navigation.rewards); }); diff --git a/apps/governance-e2e/src/integration/view/validators.cy.ts b/apps/governance-e2e/src/integration/view/validators.cy.ts index d167c98c0..15186eb37 100644 --- a/apps/governance-e2e/src/integration/view/validators.cy.ts +++ b/apps/governance-e2e/src/integration/view/validators.cy.ts @@ -33,7 +33,6 @@ const stakeNumberRegex = /^\d*\.?\d*$/; context('Validators Page - verify elements on page', function () { before('navigate to validators page', function () { - cy.clearAllLocalStorage(); cy.visit('/validators'); }); diff --git a/apps/governance-e2e/src/integration/view/wallet-vega.cy.ts b/apps/governance-e2e/src/integration/view/wallet-vega.cy.ts index f43b77d33..5daa792c9 100644 --- a/apps/governance-e2e/src/integration/view/wallet-vega.cy.ts +++ b/apps/governance-e2e/src/integration/view/wallet-vega.cy.ts @@ -35,7 +35,6 @@ context( { tags: '@regression' }, () => { before('visit token home page', () => { - cy.clearAllLocalStorage(); cy.visit('/'); cy.get(walletContainer, { timeout: 60000 }).should('be.visible'); }); diff --git a/apps/governance-e2e/src/integration/view/withdraw.cy.ts b/apps/governance-e2e/src/integration/view/withdraw.cy.ts index a6283e81f..3a2d51ce9 100644 --- a/apps/governance-e2e/src/integration/view/withdraw.cy.ts +++ b/apps/governance-e2e/src/integration/view/withdraw.cy.ts @@ -12,7 +12,6 @@ context( { tags: '@smoke' }, function () { before('navigate to withdrawals page', function () { - cy.clearAllLocalStorage(); cy.visit('/'); navigateTo(navigation.withdraw); }); diff --git a/apps/governance-e2e/src/support/common.functions.ts b/apps/governance-e2e/src/support/common.functions.ts index d095e43d6..94a5e3afb 100644 --- a/apps/governance-e2e/src/support/common.functions.ts +++ b/apps/governance-e2e/src/support/common.functions.ts @@ -90,3 +90,10 @@ export function verifyEthWalletAssociatedBalance(amount: string) { export function closeDialog() { cy.getByTestId('dialog-close').click(); } + +export function turnTelemetryOff() { + // Ensuring the telemetry modal doesn't disrupt the tests + cy.window().then((win) => + win.localStorage.setItem('vega_telemetry_on', 'false') + ); +} diff --git a/apps/governance-e2e/src/support/index.js b/apps/governance-e2e/src/support/index.js index 23cada399..8c49a0b4e 100644 --- a/apps/governance-e2e/src/support/index.js +++ b/apps/governance-e2e/src/support/index.js @@ -11,6 +11,7 @@ import './proposal.functions.ts'; import registerCypressGrep from '@cypress/grep'; import { aliasGQLQuery } from '@vegaprotocol/cypress'; import { chainIdQuery, statisticsQuery } from '@vegaprotocol/mock'; +import { turnTelemetryOff } from './common.functions.ts'; registerCypressGrep(); // Hide fetch/XHR requests - They create a lot of noise in command log @@ -24,6 +25,9 @@ if (!app.document.head.querySelector('[data-hide-command-log-request]')) { } before(() => { + cy.clearLocalStorage(); + // // Ensuring the telemetry modal doesn't disrupt the tests + turnTelemetryOff(); // Mock chainId fetch which happens on every page for wallet connection cy.mockGQL((req) => { aliasGQLQuery(req, 'ChainId', chainIdQuery()); diff --git a/apps/governance/.env b/apps/governance/.env index 67d327f93..3a07ae028 100644 --- a/apps/governance/.env +++ b/apps/governance/.env @@ -5,7 +5,7 @@ NX_VEGA_URL=https://api.n00.stagnet1.vega.xyz/graphql NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_FAIRGROUND=false -NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET1":"https://stagnet1.token.vega.xyz","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}' +NX_VEGA_NETWORKS='{"DEVNET":"https://dev.governance.vega.xyz","STAGNET1":"https://stagnet1.governance.vega.xyz","TESTNET":"https://governance.fairground.wtf","MAINNET":"https://governance.vega.xyz"}' NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions NX_VEGA_WALLET_URL=http://localhost:1789 NX_VEGA_EXPLORER_URL=https://stagnet1.explorer.vega.xyz diff --git a/apps/governance/.env.capsule b/apps/governance/.env.capsule index 38195652b..0bd649760 100644 --- a/apps/governance/.env.capsule +++ b/apps/governance/.env.capsule @@ -3,7 +3,7 @@ NX_VEGA_ENV=CUSTOM NX_ETHEREUM_PROVIDER_URL=http://localhost:8545 NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_FAIRGROUND=false -NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}' +NX_VEGA_NETWORKS='{"DEVNET":"https://dev.governance.vega.xyz","TESTNET":"https://governance.fairground.wtf","MAINNET":"https://governance.vega.xyz"}' NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/test/announcements.json NX_VEGA_CONFIG_URL='' diff --git a/apps/governance/.env.devnet b/apps/governance/.env.devnet index 60ef29604..c9d57d440 100644 --- a/apps/governance/.env.devnet +++ b/apps/governance/.env.devnet @@ -2,7 +2,7 @@ NX_VEGA_ENV=DEVNET NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/devnet1/vegawallet-devnet1.toml NX_VEGA_URL=https://api.n00.devnet1.vega.xyz/graphql -NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}' +NX_VEGA_NETWORKS='{"DEVNET":"https://dev.governance.vega.xyz","TESTNET":"https://governance.fairground.wtf","MAINNET":"https://governance.vega.xyz"}' NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions @@ -10,4 +10,4 @@ NX_VEGA_EXPLORER_URL=https://dev.explorer.vega.xyz NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet NX_DELEGATIONS_PAGINATION=50 NX_TRANCHES_SERVICE_URL=https://tranches-devnet1-k8s.ops.vega.xyz -NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json \ No newline at end of file +NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json diff --git a/apps/governance/.env.mainnet b/apps/governance/.env.mainnet index 693dcf46b..561ad3fd9 100644 --- a/apps/governance/.env.mainnet +++ b/apps/governance/.env.mainnet @@ -1,8 +1,8 @@ # App configuration variables NX_VEGA_ENV=MAINNET NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks/master/mainnet1/mainnet1.toml -NX_VEGA_URL=https://api.vega.xyz/query -NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}' +NX_VEGA_URL=https://api.vega.community/graphql +NX_VEGA_NETWORKS='{"DEVNET":"https://dev.governance.vega.xyz","TESTNET":"https://governance.fairground.wtf","MAINNET":"https://governance.vega.xyz"}' NX_ETHEREUM_PROVIDER_URL=https://mainnet.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 NX_ETHERSCAN_URL=https://etherscan.io NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions diff --git a/apps/governance/.env.stagnet1 b/apps/governance/.env.stagnet1 index 3ffa1c917..2551d5b40 100644 --- a/apps/governance/.env.stagnet1 +++ b/apps/governance/.env.stagnet1 @@ -1,10 +1,10 @@ # App configuration variables NX_VEGA_URL=https://api.n00.stagnet1.vega.xyz/graphql NX_VEGA_ENV=STAGNET1 -NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET1":"https://stagnet1.token.vega.xyz","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}' +NX_VEGA_NETWORKS='{"DEVNET":"https://dev.governance.vega.xyz","STAGNET1":"https://stagnet1.governance.vega.xyz","TESTNET":"https://governance.fairground.wtf","MAINNET":"https://governance.vega.xyz"}' NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/stagnet1/vegawallet-stagnet1.toml NX_VEGA_EXPLORER_URL=https://stagnet1.explorer.vega.xyz NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet NX_DELEGATIONS_PAGINATION=50 NX_TRANCHES_SERVICE_URL=https://tranches-stagnet1-k8s.ops.vega.xyz -NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json \ No newline at end of file +NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json diff --git a/apps/governance/.env.testnet b/apps/governance/.env.testnet index d9507da64..66d3eaf2e 100644 --- a/apps/governance/.env.testnet +++ b/apps/governance/.env.testnet @@ -2,7 +2,7 @@ NX_VEGA_ENV=TESTNET NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/fairground/vegawallet-fairground.toml NX_VEGA_URL=https://api.n07.testnet.vega.xyz/graphql -NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}' +NX_VEGA_NETWORKS='{"DEVNET":"https://dev.governance.vega.xyz","TESTNET":"https://governance.fairground.wtf","MAINNET":"https://governance.vega.xyz"}' NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions diff --git a/apps/governance/.env.validator-testnet b/apps/governance/.env.validator-testnet index 2befa2780..aa16cd4e9 100644 --- a/apps/governance/.env.validator-testnet +++ b/apps/governance/.env.validator-testnet @@ -3,7 +3,7 @@ NX_VEGA_ENV=VALIDATOR_TESTNET NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks/master/testnet2/testnet2.toml NX_VEGA_URL=https://api-validators-testnet.vega.rocks/graphql NX_VEGA_REST=https://api-validators-testnet.vega.rocks/ -NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}' +NX_VEGA_NETWORKS='{"DEVNET":"https://dev.governance.vega.xyz","TESTNET":"https://governance.fairground.wtf","MAINNET":"https://governance.vega.xyz"}' NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions diff --git a/apps/governance/src/app.tsx b/apps/governance/src/app.tsx index 314416d83..13e55d089 100644 --- a/apps/governance/src/app.tsx +++ b/apps/governance/src/app.tsx @@ -43,6 +43,11 @@ import type { InMemoryCacheConfig } from '@apollo/client'; import { WithdrawalDialog } from '@vegaprotocol/withdraws'; import { SplashLoader } from './components/splash-loader'; import { ToastsManager } from './toasts-manager'; +import { + TelemetryDialog, + TELEMETRY_ON, +} from './components/telemetry-dialog/telemetry-dialog'; +import { useLocalStorage } from '@vegaprotocol/react-helpers'; const cache: InMemoryCacheConfig = { typePolicies: { @@ -149,6 +154,7 @@ const Web3Container = ({ + @@ -177,9 +183,10 @@ const AppContainer = () => { const { config, loading, error } = useEthereumConfig(); const { VEGA_ENV, GIT_COMMIT_HASH, GIT_BRANCH, ETHEREUM_PROVIDER_URL } = useEnvironment(); + const [telemetryOn] = useLocalStorage(TELEMETRY_ON); useEffect(() => { - if (ENV.dsn) { + if (ENV.dsn && telemetryOn) { Sentry.init({ dsn: ENV.dsn, integrations: [new Integrations.BrowserTracing()], @@ -202,8 +209,10 @@ const AppContainer = () => { }); Sentry.setTag('branch', GIT_BRANCH); Sentry.setTag('commit', GIT_COMMIT_HASH); + } else { + Sentry.close(); } - }, [GIT_COMMIT_HASH, GIT_BRANCH, VEGA_ENV]); + }, [GIT_COMMIT_HASH, GIT_BRANCH, VEGA_ENV, telemetryOn]); return ( diff --git a/apps/governance/src/components/nav/nav.tsx b/apps/governance/src/components/nav/nav.tsx index 37147590e..e9446e198 100644 --- a/apps/governance/src/components/nav/nav.tsx +++ b/apps/governance/src/components/nav/nav.tsx @@ -11,11 +11,26 @@ import { NavigationLink, NavigationList, NavigationTrigger, + Icon, } from '@vegaprotocol/ui-toolkit'; import { EthWallet } from '../eth-wallet'; import { VegaWallet } from '../vega-wallet'; import { useLocation, useMatch } from 'react-router-dom'; import { useEffect } from 'react'; +import { useTelemetryDialog } from '../telemetry-dialog/telemetry-dialog'; + +export const SettingsLink = () => { + const { open, isOpen, close } = useTelemetryDialog(); + return ( + + ); +}; export const Nav = ({ theme }: Pick) => { const { t } = useTranslation(); @@ -42,7 +57,12 @@ export const Nav = ({ theme }: Pick) => { )); return ( - + } + > { + beforeEach(() => { + localStorage.clear(); + }); + + it('should have the correct initial state based on localStorage', () => { + localStorage.setItem(TELEMETRY_ON, 'true'); + + const { result } = renderHook(() => useTelemetryDialog()); + + expect(result.current.isOpen).toBe(false); + expect(result.current.telemetryAccepted).toBe(true); + }); + + it('should update localStorage and the telemetryAccepted state when setTelemetryAccepted is called', () => { + const { result } = renderHook(() => useTelemetryDialog()); + + act(() => { + result.current.setTelemetryAccepted(true); + }); + + expect(result.current.telemetryAccepted).toBe(true); + expect(localStorage.getItem(TELEMETRY_ON)).toBe('true'); + }); + + it('should update localStorage and the isOpen state when close is called', () => { + const { result } = renderHook(() => useTelemetryDialog()); + + act(() => { + result.current.close(); + }); + + expect(result.current.isOpen).toBe(false); + }); + + it('should update the isOpen state when open is called', () => { + const { result } = renderHook(() => useTelemetryDialog()); + + act(() => { + result.current.open(); + }); + + expect(result.current.isOpen).toBe(true); + }); + + it('should open the dialog if TELEMETRY_ON is not set', () => { + const { result } = renderHook(() => useTelemetryDialog()); + expect(result.current.isOpen).toBe(true); + }); +}); diff --git a/apps/governance/src/components/telemetry-dialog/telemetry-dialog.tsx b/apps/governance/src/components/telemetry-dialog/telemetry-dialog.tsx new file mode 100644 index 000000000..be1226d21 --- /dev/null +++ b/apps/governance/src/components/telemetry-dialog/telemetry-dialog.tsx @@ -0,0 +1,102 @@ +import { create } from 'zustand'; +import { useEffect } from 'react'; +import { useTranslation } from 'react-i18next'; +import { useLocalStorage } from '@vegaprotocol/react-helpers'; +import { Dialog, Icon, Button } from '@vegaprotocol/ui-toolkit'; +import { Networks, useEnvironment } from '@vegaprotocol/environment'; + +type TelemetryDialogState = { + isOpen: boolean; + open: () => void; + close: () => void; +}; + +const useTelemetryDialogStore = create((set) => ({ + isOpen: false, + open: () => set({ isOpen: true }), + close: () => set({ isOpen: false }), +})); + +export const TELEMETRY_ON = 'vega_telemetry_on'; + +export const useTelemetryDialog = () => { + const [telemetryOn, setTelemetryOn] = useLocalStorage(TELEMETRY_ON); + const { VEGA_ENV } = useEnvironment(); + const isMainnet = VEGA_ENV === Networks.MAINNET; + + const defaultTelemetryAccepted = isMainnet ? 'false' : 'true'; + + const { isOpen, open, close } = useTelemetryDialogStore(); + + useEffect(() => { + if (telemetryOn === null || telemetryOn === undefined) { + open(); + setTelemetryOn(defaultTelemetryAccepted); + } + }, [defaultTelemetryAccepted, open, setTelemetryOn, telemetryOn]); + + return { + isOpen, + open: open, + close: close, + telemetryAccepted: telemetryOn === 'true', + setTelemetryAccepted: (value: boolean) => { + setTelemetryOn(value.toString()); + }, + }; +}; + +export const TelemetryDialog = () => { + const { t } = useTranslation(); + const { isOpen, open, close, telemetryAccepted, setTelemetryAccepted } = + useTelemetryDialog(); + return ( + (isOpen ? open() : close())} + size="small" + > +
{t('TelemetryModalIntro')}
+
+ +
+
{t('Anonymous')}
+
{t('YourIdentityAnonymous')}
+
+
+ +
+ +
+
{t('Optional')}
+
{t('OptOutOfTelemetry')}
+
+
+ +
+ + + +
+
+ ); +}; diff --git a/apps/governance/src/hooks/use-document-title.ts b/apps/governance/src/hooks/use-document-title.ts index 29120d9d5..6b9dd10e1 100644 --- a/apps/governance/src/hooks/use-document-title.ts +++ b/apps/governance/src/hooks/use-document-title.ts @@ -1,7 +1,7 @@ import React from 'react'; export function useDocumentTitle(name?: string) { - const base = 'VEGA token'; + const base = 'VEGA Governance'; React.useEffect(() => { if (name) { diff --git a/apps/governance/src/i18n/translations/dev.json b/apps/governance/src/i18n/translations/dev.json index 2aa39655a..8d9df1aca 100644 --- a/apps/governance/src/i18n/translations/dev.json +++ b/apps/governance/src/i18n/translations/dev.json @@ -66,7 +66,7 @@ "claim": "This code ({{code}}) entitles {{user}} to {{amount}} $VEGA tokens from {{linkText}} of the vesting contract. {{expiry}}.", "claimExpiry": "The code expires on {{date}}", "claimNoExpiry": "It has no expiry date", - "showRedeem": "You'll be able to redeem your unlocked tokens at token.vega.xyz/vesting", + "showRedeem": "You'll be able to redeem your unlocked tokens at governance.vega.xyz/vesting", "codeUsed": "Code already used", "codeUsedText": "Looks like that code has already been used. Check the Vesting page to see if you can redeem your tokens.", "codeExpired": "Code expired", @@ -86,7 +86,7 @@ "Awaiting action in Ethereum wallet (e.g. MetaMask)": "Awaiting action in Ethereum wallet (e.g. MetaMask)", "Claim {amount} Vega": "Claim {{amount}} $VEGA", "Sorry. It is not possible to claim tokens in your country or region.": "It is not possible to claim tokens in your country or region.", - "none redeemable": "Tokens in this tranche unlock on {{unlockDate}} and continue to unlock gradually until {{trancheEndDate}} when all tokens are unlocked. Come back to token.vega.xyz to redeem your tokens once they begin to unlock.", + "none redeemable": "Tokens in this tranche unlock on {{unlockDate}} and continue to unlock gradually until {{trancheEndDate}} when all tokens are unlocked. Come back to governance.vega.xyz to redeem your tokens once they begin to unlock.", "partially redeemable": "Tokens in this tranche began to unlock on {{unlockDate}} and will continue to unlock gradually until {{trancheEndDate}} when all tokens are unlocked.", "fully redeemable": "Tokens in this tranche have fully unlocked and can be redeemed once claimed.", "This page can not be found, please check the URL and try again.": "This page can not be found, please check the URL and try again.", @@ -678,6 +678,8 @@ "FilterProposalsDescription": "Filter by proposal ID or proposer ID", "Freeform proposal": "Freeform proposal", "NewProposal": "New proposal", + "CreateProposalAndDownloadJSONToShare": "Create proposal and download JSON to share", + "SubmitAnAgreedProposalFromTheForum": "Submit an agreed proposal from the forum", "ProposalTypeQuestion": "What type of proposal would you like to make?", "NetworkParameterProposal": "Update network parameter proposal", "parameter": "parameter", @@ -701,6 +703,7 @@ "AssetID": "Asset ID", "Freeform": "Freeform", "RawProposal": "Let me choose (raw proposal)", + "SubmitAgreedRawProposal": "Submit agreed raw proposal", "UseMin": "Use minimum", "UseMax": "Use maximum", "Proposal": "Proposal", @@ -799,5 +802,14 @@ "associateVegaNow": "Associate $VEGA now", "disconnectedNotice": "You have been disconnected. Connect your ETH wallet to the {{correctNetwork}} network to use this app.", "connectAVegaWalletToVote": "Connect a Vega wallet with $VEGA tokens to vote on a proposal.", - "findOutMoreAboutHowToVote": "Find out more about how to vote on Vega" + "findOutMoreAboutHowToVote": "Find out more about how to vote on Vega", + "ImproveVegaGovernance": "Improve Vega governance", + "TelemetryModalIntro": "Help us identify bugs and improve Vega Governance by sharing anonymous usage data.", + "Anonymous": "Anonymous", + "YourIdentityAnonymous": "Your identity is always anonymous on Vega", + "Optional": "Optional", + "OptOutOfTelemetry": "You can opt out any time via settings", + "NoThanks": "No thanks", + "ShareData": "Share data", + "ContinueSharingData": "Continue sharing data" } diff --git a/apps/governance/src/index.html b/apps/governance/src/index.html index cc2bcfd61..bcfc541a0 100644 --- a/apps/governance/src/index.html +++ b/apps/governance/src/index.html @@ -24,7 +24,7 @@ type="font/woff2" crossorigin="anonymous" /> - Vega Token dApp + Vega Governance dApp diff --git a/apps/governance/src/routes/proposals/components/proposals-list/proposals-list.tsx b/apps/governance/src/routes/proposals/components/proposals-list/proposals-list.tsx index 5af38356d..d96fccc7f 100644 --- a/apps/governance/src/routes/proposals/components/proposals-list/proposals-list.tsx +++ b/apps/governance/src/routes/proposals/components/proposals-list/proposals-list.tsx @@ -6,13 +6,14 @@ import { ProposalsListItem } from '../proposals-list-item'; import { ProtocolUpgradeProposalsListItem } from '../protocol-upgrade-proposals-list-item/protocol-upgrade-proposals-list-item'; import { ProposalsListFilter } from '../proposals-list-filter'; import Routes from '../../../routes'; -import { Button } from '@vegaprotocol/ui-toolkit'; +import { Button, VegaIcon, VegaIconNames } from '@vegaprotocol/ui-toolkit'; import { Link } from 'react-router-dom'; -import { ExternalLinks } from '@vegaprotocol/utils'; +import { createDocsLinks, ExternalLinks } from '@vegaprotocol/utils'; import { ExternalLink } from '@vegaprotocol/ui-toolkit'; import type { ProposalQuery } from '../../proposal/__generated__/Proposal'; import type { ProposalFieldsFragment } from '../../proposals/__generated__/Proposals'; import type { ProtocolUpgradeProposalFieldsFragment } from '@vegaprotocol/proposals'; +import { useEnvironment } from '@vegaprotocol/environment'; interface ProposalsListProps { proposals: Array; @@ -35,6 +36,7 @@ export const ProposalsList = ({ protocolUpgradeProposals, lastBlockHeight, }: ProposalsListProps) => { + const { VEGA_DOCS_URL } = useEnvironment(); const { t } = useTranslation(); const [filterString, setFilterString] = useState(''); const sortedProposals = proposals.reduce( @@ -81,15 +83,18 @@ export const ProposalsList = ({ marginBottom={false} title={t('pageTitleProposals')} /> - - - + {VEGA_DOCS_URL && ( +
+ + + +
+ )}

{t( diff --git a/apps/governance/src/routes/proposals/propose/freeform/propose-freeform.spec.tsx b/apps/governance/src/routes/proposals/propose/freeform/propose-freeform.spec.tsx index 4f206e056..9371840c3 100644 --- a/apps/governance/src/routes/proposals/propose/freeform/propose-freeform.spec.tsx +++ b/apps/governance/src/routes/proposals/propose/freeform/propose-freeform.spec.tsx @@ -108,7 +108,7 @@ describe('Propose Freeform', () => { expect(screen.getByTestId('proposal-title')).toBeTruthy(); expect(screen.getByTestId('proposal-description')).toBeTruthy(); expect(screen.getByTestId('proposal-vote-deadline')).toBeTruthy(); - expect(screen.getByTestId('proposal-submit')).toBeTruthy(); + expect(screen.getByTestId('proposal-download-json')).toBeTruthy(); expect(screen.getByTestId('proposal-transaction-dialog')).toBeTruthy(); }); diff --git a/apps/governance/src/routes/proposals/propose/freeform/propose-freeform.tsx b/apps/governance/src/routes/proposals/propose/freeform/propose-freeform.tsx index 7e4574746..58eb2a537 100644 --- a/apps/governance/src/routes/proposals/propose/freeform/propose-freeform.tsx +++ b/apps/governance/src/routes/proposals/propose/freeform/propose-freeform.tsx @@ -9,7 +9,6 @@ import { useEnvironment } from '@vegaprotocol/environment'; import { ProposalFormDescription, ProposalFormSubheader, - ProposalFormSubmit, ProposalFormTitle, ProposalFormTransactionDialog, ProposalFormDownloadJson, @@ -48,7 +47,7 @@ export const ProposeFreeform = () => { const { register, handleSubmit, - formState: { isSubmitting, errors }, + formState: { errors }, setValue, watch, } = useForm(); @@ -165,7 +164,6 @@ export const ProposeFreeform = () => { voteMaxClose={params.governance_proposal_freeform_maxClose} /> - { expect(screen.getByTestId('proposal-description')).toBeTruthy(); expect(screen.getByTestId('proposal-vote-deadline')).toBeTruthy(); expect(screen.getByTestId('proposal-enactment-deadline')).toBeTruthy(); - expect(screen.getByTestId('proposal-submit')).toBeTruthy(); + expect(screen.getByTestId('proposal-download-json')).toBeTruthy(); expect(screen.getByTestId('proposal-transaction-dialog')).toBeTruthy(); }); diff --git a/apps/governance/src/routes/proposals/propose/network-parameter/propose-network-parameter.tsx b/apps/governance/src/routes/proposals/propose/network-parameter/propose-network-parameter.tsx index b13a47085..4f45ee549 100644 --- a/apps/governance/src/routes/proposals/propose/network-parameter/propose-network-parameter.tsx +++ b/apps/governance/src/routes/proposals/propose/network-parameter/propose-network-parameter.tsx @@ -16,7 +16,6 @@ import { useEnvironment } from '@vegaprotocol/environment'; import { ProposalFormDescription, ProposalFormSubheader, - ProposalFormSubmit, ProposalFormTitle, ProposalFormTransactionDialog, ProposalFormVoteAndEnactmentDeadline, @@ -90,7 +89,7 @@ export const ProposeNetworkParameter = () => { const { register, handleSubmit, - formState: { isSubmitting, errors }, + formState: { errors }, setValue, watch, } = useForm(); @@ -310,7 +309,6 @@ export const ProposeNetworkParameter = () => { } /> - { expect(screen.getByTestId('proposal-vote-deadline')).toBeTruthy(); expect(screen.getByTestId('proposal-validation-deadline')).toBeTruthy(); expect(screen.getByTestId('proposal-enactment-deadline')).toBeTruthy(); - expect(screen.getByTestId('proposal-submit')).toBeTruthy(); + expect(screen.getByTestId('proposal-download-json')).toBeTruthy(); expect(screen.getByTestId('proposal-transaction-dialog')).toBeTruthy(); }); diff --git a/apps/governance/src/routes/proposals/propose/new-asset/propose-new-asset.tsx b/apps/governance/src/routes/proposals/propose/new-asset/propose-new-asset.tsx index cf621bf2d..c95551e68 100644 --- a/apps/governance/src/routes/proposals/propose/new-asset/propose-new-asset.tsx +++ b/apps/governance/src/routes/proposals/propose/new-asset/propose-new-asset.tsx @@ -16,7 +16,6 @@ import { import { ProposalFormDescription, ProposalFormSubheader, - ProposalFormSubmit, ProposalFormTerms, ProposalFormTitle, ProposalFormTransactionDialog, @@ -59,7 +58,7 @@ export const ProposeNewAsset = () => { const { register, handleSubmit, - formState: { isSubmitting, errors }, + formState: { errors }, setValue, watch, } = useForm(); @@ -226,7 +225,6 @@ export const ProposeNewAsset = () => { } /> - { expect(screen.getByTestId('proposal-terms')).toBeTruthy(); expect(screen.getByTestId('proposal-vote-deadline')).toBeTruthy(); expect(screen.getByTestId('proposal-enactment-deadline')).toBeTruthy(); - expect(screen.getByTestId('proposal-submit')).toBeTruthy(); + expect(screen.getByTestId('proposal-download-json')).toBeTruthy(); expect(screen.getByTestId('proposal-transaction-dialog')).toBeTruthy(); }); diff --git a/apps/governance/src/routes/proposals/propose/new-market/propose-new-market.tsx b/apps/governance/src/routes/proposals/propose/new-market/propose-new-market.tsx index 013c444ca..181b6e449 100644 --- a/apps/governance/src/routes/proposals/propose/new-market/propose-new-market.tsx +++ b/apps/governance/src/routes/proposals/propose/new-market/propose-new-market.tsx @@ -15,7 +15,6 @@ import { import { ProposalFormDescription, ProposalFormSubheader, - ProposalFormSubmit, ProposalFormTerms, ProposalFormTitle, ProposalFormTransactionDialog, @@ -57,7 +56,7 @@ export const ProposeNewMarket = () => { const { register, handleSubmit, - formState: { isSubmitting, errors }, + formState: { errors }, setValue, watch, } = useForm(); @@ -208,7 +207,6 @@ export const ProposeNewMarket = () => { enactmentMaxClose={params.governance_proposal_market_maxEnact} /> - { expect(baseElement).toBeTruthy(); }); - it('should render the heading, proposal type question and options', () => { + it('should render the heading, proposals title and options', () => { renderComponent(); expect( - screen.getByText('What type of proposal would you like to make?') + screen.getByText('Create proposal and download JSON to share') ).toBeTruthy(); expect(screen.getByText('Network parameter')).toBeTruthy(); expect(screen.getByText('New market')).toBeTruthy(); @@ -26,6 +26,9 @@ describe('Propose', () => { expect(screen.getByText('New asset')).toBeTruthy(); expect(screen.getByText('Update asset')).toBeTruthy(); expect(screen.getByText('Freeform')).toBeTruthy(); - expect(screen.getByText('Let me choose (raw proposal)')).toBeTruthy(); + expect( + screen.getByText('Submit an agreed proposal from the forum') + ).toBeTruthy(); + expect(screen.getByText('Submit agreed raw proposal')).toBeTruthy(); }); }); diff --git a/apps/governance/src/routes/proposals/propose/propose.tsx b/apps/governance/src/routes/proposals/propose/propose.tsx index 45a8d1cc5..832fd8473 100644 --- a/apps/governance/src/routes/proposals/propose/propose.tsx +++ b/apps/governance/src/routes/proposals/propose/propose.tsx @@ -39,8 +39,8 @@ export const Propose = () => {

-

{t('ProposalTypeQuestion')}

-
    +

    {t('CreateProposalAndDownloadJSONToShare')}

    +
    • {

    • -
    • -

      - - {t('RawProposal')} - -

      -
    + +

    {t('SubmitAnAgreedProposalFromTheForum')}

    +

    + + {t('SubmitAgreedRawProposal')} + +

); diff --git a/apps/governance/src/routes/proposals/propose/raw/propose-raw.tsx b/apps/governance/src/routes/proposals/propose/raw/propose-raw.tsx index 7b0fd7004..62d0bbfb0 100644 --- a/apps/governance/src/routes/proposals/propose/raw/propose-raw.tsx +++ b/apps/governance/src/routes/proposals/propose/raw/propose-raw.tsx @@ -18,10 +18,8 @@ import { useProposalSubmit } from '@vegaprotocol/proposals'; import { ProposalFormSubmit, ProposalFormTransactionDialog, - ProposalFormDownloadJson, } from '../../components/propose'; import { ProposalRawMinRequirements } from './proposal-raw-min-requirements'; -import { downloadJson } from '../../../../lib/download-json'; export interface RawProposalFormFields { rawProposalData: string; @@ -47,7 +45,6 @@ export const ProposeRaw = () => { register, handleSubmit, formState: { isSubmitting, errors }, - watch, } = useForm(); const { finalizedProposal, submit, Dialog } = useProposalSubmit(); @@ -57,11 +54,6 @@ export const ProposeRaw = () => { await submit(JSON.parse(fields.rawProposalData)); }; - const viewJson = () => { - const formData = watch(); - downloadJson(JSON.stringify(formData), 'vega-raw-proposal'); - }; - return ( { )} - { expect(screen.getByTestId('proposal-terms')).toBeTruthy(); expect(screen.getByTestId('proposal-vote-deadline')).toBeTruthy(); expect(screen.getByTestId('proposal-enactment-deadline')).toBeTruthy(); - expect(screen.getByTestId('proposal-submit')).toBeTruthy(); + expect(screen.getByTestId('proposal-download-json')).toBeTruthy(); expect(screen.getByTestId('proposal-transaction-dialog')).toBeTruthy(); }); diff --git a/apps/governance/src/routes/proposals/propose/update-asset/propose-update-asset.tsx b/apps/governance/src/routes/proposals/propose/update-asset/propose-update-asset.tsx index 0bbed4234..5ce192e02 100644 --- a/apps/governance/src/routes/proposals/propose/update-asset/propose-update-asset.tsx +++ b/apps/governance/src/routes/proposals/propose/update-asset/propose-update-asset.tsx @@ -15,7 +15,6 @@ import { import { ProposalFormDescription, ProposalFormSubheader, - ProposalFormSubmit, ProposalFormTerms, ProposalFormTitle, ProposalFormTransactionDialog, @@ -57,7 +56,7 @@ export const ProposeUpdateAsset = () => { const { register, handleSubmit, - formState: { isSubmitting, errors }, + formState: { errors }, setValue, watch, } = useForm(); @@ -212,7 +211,6 @@ export const ProposeUpdateAsset = () => { } /> - { expect(screen.getByTestId('proposal-terms')).toBeTruthy(); expect(screen.getByTestId('proposal-vote-deadline')).toBeTruthy(); expect(screen.getByTestId('proposal-enactment-deadline')).toBeTruthy(); - expect(screen.getByTestId('proposal-submit')).toBeTruthy(); + expect(screen.getByTestId('proposal-download-json')).toBeTruthy(); expect(screen.getByTestId('proposal-transaction-dialog')).toBeTruthy(); }); diff --git a/apps/governance/src/routes/proposals/propose/update-market/propose-update-market.tsx b/apps/governance/src/routes/proposals/propose/update-market/propose-update-market.tsx index 4d1bbd1b8..0242e2b88 100644 --- a/apps/governance/src/routes/proposals/propose/update-market/propose-update-market.tsx +++ b/apps/governance/src/routes/proposals/propose/update-market/propose-update-market.tsx @@ -17,7 +17,6 @@ import { ProposalFormDescription, ProposalFormDownloadJson, ProposalFormSubheader, - ProposalFormSubmit, ProposalFormTerms, ProposalFormTitle, ProposalFormTransactionDialog, @@ -104,7 +103,7 @@ export const ProposeUpdateMarket = () => { const { register, handleSubmit, - formState: { isSubmitting, errors }, + formState: { errors }, setValue, watch, } = useForm(); @@ -317,7 +316,6 @@ export const ProposeUpdateMarket = () => { } /> -