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 336139a52..e12225587 100644 --- a/apps/governance-e2e/src/integration/view/pubkey-view.cy.ts +++ b/apps/governance-e2e/src/integration/view/pubkey-view.cy.ts @@ -46,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/src/i18n/translations/dev.json b/apps/governance/src/i18n/translations/dev.json index c68677662..8d9df1aca 100644 --- a/apps/governance/src/i18n/translations/dev.json +++ b/apps/governance/src/i18n/translations/dev.json @@ -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", 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')}

-
); 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 = () => { } /> -