From 31524ac7a734e310eaa4be3081288139b3cb473f Mon Sep 17 00:00:00 2001 From: Edd Date: Fri, 17 Nov 2023 17:29:42 +0000 Subject: [PATCH] feat(governance): enable volume discount update view (#5304) --- apps/governance/.env | 3 +-- apps/governance/.env.capsule | 3 +-- apps/governance/.env.devnet | 1 - apps/governance/.env.mainnet | 9 ++++----- apps/governance/.env.mainnet-mirror | 9 ++++----- apps/governance/.env.stagnet1 | 1 - apps/governance/.env.testnet | 1 - apps/governance/.env.validators-testnet | 9 ++++----- apps/governance/src/routes/home/index.tsx | 1 - .../proposal-volume-discount-program-details.tsx | 2 +- .../src/routes/proposals/proposal/Proposal.graphql | 2 -- .../routes/proposals/proposal/__generated__/Proposal.ts | 6 ++---- .../src/routes/proposals/proposal/proposal-container.tsx | 1 - .../src/routes/proposals/proposals/Proposals.graphql | 2 -- .../proposals/proposals/__generated__/Proposals.ts | 6 ++---- .../routes/proposals/proposals/proposals-container.tsx | 1 - .../proposals/rejected/rejected-proposals-container.tsx | 1 - 17 files changed, 19 insertions(+), 39 deletions(-) diff --git a/apps/governance/.env b/apps/governance/.env index 97fcb79ea..07f6f1b48 100644 --- a/apps/governance/.env +++ b/apps/governance/.env @@ -35,6 +35,5 @@ NX_SUCCESSOR_MARKETS=true NX_METAMASK_SNAPS=true NX_PRODUCT_PERPETUALS=false NX_UPDATE_MARKET_STATE=false -NX_REFERRALS=false +NX_REFERRALS=true NX_GOVERNANCE_TRANSFERS=false -NX_VOLUME_DISCOUNTS=false diff --git a/apps/governance/.env.capsule b/apps/governance/.env.capsule index e70efca5e..4de4d9da5 100644 --- a/apps/governance/.env.capsule +++ b/apps/governance/.env.capsule @@ -31,9 +31,8 @@ NX_TENDERMINT_WEBSOCKET_URL=wss://localhost:26617/websocket CYPRESS_FAIRGROUND=false # Cosmic elevator flags -NX_SUCCESSOR_MARKETS=false +NX_SUCCESSOR_MARKETS=true NX_METAMASK_SNAPS=false NX_PRODUCT_PERPETUALS=true NX_UPDATE_MARKET_STATE=true NX_REFERRALS=true -NX_VOLUME_DISCOUNTS=true diff --git a/apps/governance/.env.devnet b/apps/governance/.env.devnet index 019dbda7d..5616a4821 100644 --- a/apps/governance/.env.devnet +++ b/apps/governance/.env.devnet @@ -28,4 +28,3 @@ NX_METAMASK_SNAPS=true NX_PRODUCT_PERPETUALS=true NX_UPDATE_MARKET_STATE=true NX_REFERRALS=true -NX_VOLUME_DISCOUNTS=true diff --git a/apps/governance/.env.mainnet b/apps/governance/.env.mainnet index 4afaabacd..ac676e9ad 100644 --- a/apps/governance/.env.mainnet +++ b/apps/governance/.env.mainnet @@ -22,9 +22,8 @@ NX_TENDERMINT_URL=https://be.vega.community NX_TENDERMINT_WEBSOCKET_URL=wss://be.vega.community/websocket # Cosmic elevator flags -NX_SUCCESSOR_MARKETS=false +NX_SUCCESSOR_MARKETS=true NX_METAMASK_SNAPS=false -NX_PRODUCT_PERPETUALS=false -NX_UPDATE_MARKET_STATE=false -NX_REFERRALS=false -NX_VOLUME_DISCOUNTS=false +NX_PRODUCT_PERPETUALS=true +NX_UPDATE_MARKET_STATE=true +NX_REFERRALS=true diff --git a/apps/governance/.env.mainnet-mirror b/apps/governance/.env.mainnet-mirror index 24af456f4..5521d5d44 100644 --- a/apps/governance/.env.mainnet-mirror +++ b/apps/governance/.env.mainnet-mirror @@ -21,9 +21,8 @@ NX_TENDERMINT_URL=https://be.mainnet-mirror.vega.rocks NX_TENDERMINT_WEBSOCKET_URL=wss://be.mainnet-mirror.vega.rocks/websocket # Cosmic elevator flags -NX_SUCCESSOR_MARKETS=false +NX_SUCCESSOR_MARKETS=true NX_METAMASK_SNAPS=false -NX_PRODUCT_PERPETUALS=false -NX_UPDATE_MARKET_STATE=false -NX_REFERRALS=false -NX_VOLUME_DISCOUNTS=false +NX_PRODUCT_PERPETUALS=true +NX_UPDATE_MARKET_STATE=true +NX_REFERRALS=true diff --git a/apps/governance/.env.stagnet1 b/apps/governance/.env.stagnet1 index a67956b47..b91995447 100644 --- a/apps/governance/.env.stagnet1 +++ b/apps/governance/.env.stagnet1 @@ -25,4 +25,3 @@ NX_PRODUCT_PERPETUALS=true NX_UPDATE_MARKET_STATE=true NX_REFERRALS=true NX_GOVERNANCE_TRANSFERS=true -NX_VOLUME_DISCOUNTS=true diff --git a/apps/governance/.env.testnet b/apps/governance/.env.testnet index ac0d64db9..305473b45 100644 --- a/apps/governance/.env.testnet +++ b/apps/governance/.env.testnet @@ -29,4 +29,3 @@ NX_METAMASK_SNAPS=true NX_PRODUCT_PERPETUALS=true NX_UPDATE_MARKET_STATE=true NX_REFERRALS=true -NX_VOLUME_DISCOUNTS=true diff --git a/apps/governance/.env.validators-testnet b/apps/governance/.env.validators-testnet index f8f57ed8c..dfbf5ba08 100644 --- a/apps/governance/.env.validators-testnet +++ b/apps/governance/.env.validators-testnet @@ -20,9 +20,8 @@ NX_TENDERMINT_URL=https://tm.be.validators-testnet.vega.rocks NX_TENDERMINT_WEBSOCKET_URL=wss://be.validators-testnet.vega. # Cosmic elevator flags -NX_SUCCESSOR_MARKETS=false +NX_SUCCESSOR_MARKETS=true NX_METAMASK_SNAPS=false -NX_PRODUCT_PERPETUALS=false -NX_UPDATE_MARKET_STATE=false -NX_REFERRALS=false -NX_VOLUME_DISCOUNTS=false +NX_PRODUCT_PERPETUALS=true +NX_UPDATE_MARKET_STATE=true +NX_REFERRALS=true diff --git a/apps/governance/src/routes/home/index.tsx b/apps/governance/src/routes/home/index.tsx index 3977a5743..6ae4df185 100644 --- a/apps/governance/src/routes/home/index.tsx +++ b/apps/governance/src/routes/home/index.tsx @@ -189,7 +189,6 @@ const GovernanceHome = ({ name }: RouteChildProps) => { includeNewMarketProductFields: !!FLAGS.PRODUCT_PERPETUALS, includeUpdateMarketStates: !!FLAGS.UPDATE_MARKET_STATE, includeUpdateReferralPrograms: !!FLAGS.REFERRALS, - includeUpdateVolumeDiscountPrograms: !!FLAGS.VOLUME_DISCOUNTS, }, }); diff --git a/apps/governance/src/routes/proposals/components/proposal-volume-discount-program-details/proposal-volume-discount-program-details.tsx b/apps/governance/src/routes/proposals/components/proposal-volume-discount-program-details/proposal-volume-discount-program-details.tsx index 48a72b130..486310f42 100644 --- a/apps/governance/src/routes/proposals/components/proposal-volume-discount-program-details/proposal-volume-discount-program-details.tsx +++ b/apps/governance/src/routes/proposals/components/proposal-volume-discount-program-details/proposal-volume-discount-program-details.tsx @@ -78,7 +78,7 @@ export const ProposalVolumeDiscountProgramDetails = ({ {t('BenefitTiers')} - {benefitTiers + {[...benefitTiers] .sort( (a, b) => Number(a.minimumRunningNotionalTakerVolume) - diff --git a/apps/governance/src/routes/proposals/proposal/Proposal.graphql b/apps/governance/src/routes/proposals/proposal/Proposal.graphql index 10d48c8b3..5dbd73874 100644 --- a/apps/governance/src/routes/proposals/proposal/Proposal.graphql +++ b/apps/governance/src/routes/proposals/proposal/Proposal.graphql @@ -84,7 +84,6 @@ query Proposal( $includeNewMarketProductField: Boolean! $includeUpdateMarketState: Boolean! $includeUpdateReferralProgram: Boolean! - $includeUpdateVolumeDiscountProgram: Boolean! ) { proposal(id: $proposalId) { id @@ -104,7 +103,6 @@ query Proposal( ...UpdateMarketState @include(if: $includeUpdateMarketState) ...UpdateReferralProgram @include(if: $includeUpdateReferralProgram) ...UpdateVolumeDiscountProgram - @include(if: $includeUpdateVolumeDiscountProgram) terms { closingDatetime enactmentDatetime diff --git a/apps/governance/src/routes/proposals/proposal/__generated__/Proposal.ts b/apps/governance/src/routes/proposals/proposal/__generated__/Proposal.ts index 974d2a19c..1108798ff 100644 --- a/apps/governance/src/routes/proposals/proposal/__generated__/Proposal.ts +++ b/apps/governance/src/routes/proposals/proposal/__generated__/Proposal.ts @@ -16,7 +16,6 @@ export type ProposalQueryVariables = Types.Exact<{ includeNewMarketProductField: Types.Scalars['Boolean']; includeUpdateMarketState: Types.Scalars['Boolean']; includeUpdateReferralProgram: Types.Scalars['Boolean']; - includeUpdateVolumeDiscountProgram: Types.Scalars['Boolean']; }>; @@ -108,7 +107,7 @@ export const UpdateVolumeDiscountProgramFragmentDoc = gql` } `; export const ProposalDocument = gql` - query Proposal($proposalId: ID!, $includeNewMarketProductField: Boolean!, $includeUpdateMarketState: Boolean!, $includeUpdateReferralProgram: Boolean!, $includeUpdateVolumeDiscountProgram: Boolean!) { + query Proposal($proposalId: ID!, $includeNewMarketProductField: Boolean!, $includeUpdateMarketState: Boolean!, $includeUpdateReferralProgram: Boolean!) { proposal(id: $proposalId) { id rationale { @@ -126,7 +125,7 @@ export const ProposalDocument = gql` ...NewMarketProductField @include(if: $includeNewMarketProductField) ...UpdateMarketState @include(if: $includeUpdateMarketState) ...UpdateReferralProgram @include(if: $includeUpdateReferralProgram) - ...UpdateVolumeDiscountProgram @include(if: $includeUpdateVolumeDiscountProgram) + ...UpdateVolumeDiscountProgram terms { closingDatetime enactmentDatetime @@ -434,7 +433,6 @@ ${UpdateVolumeDiscountProgramFragmentDoc}`; * includeNewMarketProductField: // value for 'includeNewMarketProductField' * includeUpdateMarketState: // value for 'includeUpdateMarketState' * includeUpdateReferralProgram: // value for 'includeUpdateReferralProgram' - * includeUpdateVolumeDiscountProgram: // value for 'includeUpdateVolumeDiscountProgram' * }, * }); */ diff --git a/apps/governance/src/routes/proposals/proposal/proposal-container.tsx b/apps/governance/src/routes/proposals/proposal/proposal-container.tsx index 5f3ff62d0..5f90da2ad 100644 --- a/apps/governance/src/routes/proposals/proposal/proposal-container.tsx +++ b/apps/governance/src/routes/proposals/proposal/proposal-container.tsx @@ -62,7 +62,6 @@ export const ProposalContainer = () => { includeNewMarketProductField: !!FLAGS.PRODUCT_PERPETUALS, includeUpdateMarketState: !!FLAGS.UPDATE_MARKET_STATE, includeUpdateReferralProgram: !!FLAGS.REFERRALS, - includeUpdateVolumeDiscountProgram: !!FLAGS.VOLUME_DISCOUNTS, }, skip: !params.proposalId, }); diff --git a/apps/governance/src/routes/proposals/proposals/Proposals.graphql b/apps/governance/src/routes/proposals/proposals/Proposals.graphql index eacd865a3..88ba10b98 100644 --- a/apps/governance/src/routes/proposals/proposals/Proposals.graphql +++ b/apps/governance/src/routes/proposals/proposals/Proposals.graphql @@ -164,7 +164,6 @@ query Proposals( $includeNewMarketProductFields: Boolean! $includeUpdateMarketStates: Boolean! $includeUpdateReferralPrograms: Boolean! - $includeUpdateVolumeDiscountPrograms: Boolean! ) { proposalsConnection { edges { @@ -174,7 +173,6 @@ query Proposals( ...UpdateMarketStates @include(if: $includeUpdateMarketStates) ...UpdateReferralPrograms @include(if: $includeUpdateReferralPrograms) ...UpdateVolumeDiscountPrograms - @include(if: $includeUpdateVolumeDiscountPrograms) } } } diff --git a/apps/governance/src/routes/proposals/proposals/__generated__/Proposals.ts b/apps/governance/src/routes/proposals/proposals/__generated__/Proposals.ts index 0a8c107bd..d73e0c9f6 100644 --- a/apps/governance/src/routes/proposals/proposals/__generated__/Proposals.ts +++ b/apps/governance/src/routes/proposals/proposals/__generated__/Proposals.ts @@ -17,7 +17,6 @@ export type ProposalsQueryVariables = Types.Exact<{ includeNewMarketProductFields: Types.Scalars['Boolean']; includeUpdateMarketStates: Types.Scalars['Boolean']; includeUpdateReferralPrograms: Types.Scalars['Boolean']; - includeUpdateVolumeDiscountPrograms: Types.Scalars['Boolean']; }>; @@ -191,7 +190,7 @@ export const ProposalFieldsFragmentDoc = gql` } `; export const ProposalsDocument = gql` - query Proposals($includeNewMarketProductFields: Boolean!, $includeUpdateMarketStates: Boolean!, $includeUpdateReferralPrograms: Boolean!, $includeUpdateVolumeDiscountPrograms: Boolean!) { + query Proposals($includeNewMarketProductFields: Boolean!, $includeUpdateMarketStates: Boolean!, $includeUpdateReferralPrograms: Boolean!) { proposalsConnection { edges { node { @@ -199,7 +198,7 @@ export const ProposalsDocument = gql` ...NewMarketProductFields @include(if: $includeNewMarketProductFields) ...UpdateMarketStates @include(if: $includeUpdateMarketStates) ...UpdateReferralPrograms @include(if: $includeUpdateReferralPrograms) - ...UpdateVolumeDiscountPrograms @include(if: $includeUpdateVolumeDiscountPrograms) + ...UpdateVolumeDiscountPrograms } } } @@ -225,7 +224,6 @@ ${UpdateVolumeDiscountProgramsFragmentDoc}`; * includeNewMarketProductFields: // value for 'includeNewMarketProductFields' * includeUpdateMarketStates: // value for 'includeUpdateMarketStates' * includeUpdateReferralPrograms: // value for 'includeUpdateReferralPrograms' - * includeUpdateVolumeDiscountPrograms: // value for 'includeUpdateVolumeDiscountPrograms' * }, * }); */ diff --git a/apps/governance/src/routes/proposals/proposals/proposals-container.tsx b/apps/governance/src/routes/proposals/proposals/proposals-container.tsx index 0dd21bd04..790598b2b 100644 --- a/apps/governance/src/routes/proposals/proposals/proposals-container.tsx +++ b/apps/governance/src/routes/proposals/proposals/proposals-container.tsx @@ -52,7 +52,6 @@ export const ProposalsContainer = () => { includeNewMarketProductFields: !!FLAGS.PRODUCT_PERPETUALS, includeUpdateMarketStates: !!FLAGS.UPDATE_MARKET_STATE, includeUpdateReferralPrograms: !!FLAGS.REFERRALS, - includeUpdateVolumeDiscountPrograms: !!FLAGS.VOLUME_DISCOUNTS, }, }); diff --git a/apps/governance/src/routes/proposals/rejected/rejected-proposals-container.tsx b/apps/governance/src/routes/proposals/rejected/rejected-proposals-container.tsx index f0d4a4fbb..2e78b61d1 100644 --- a/apps/governance/src/routes/proposals/rejected/rejected-proposals-container.tsx +++ b/apps/governance/src/routes/proposals/rejected/rejected-proposals-container.tsx @@ -42,7 +42,6 @@ export const RejectedProposalsContainer = () => { includeNewMarketProductFields: !!FLAGS.PRODUCT_PERPETUALS, includeUpdateMarketStates: !!FLAGS.UPDATE_MARKET_STATE, includeUpdateReferralPrograms: !!FLAGS.REFERRALS, - includeUpdateVolumeDiscountPrograms: !!FLAGS.VOLUME_DISCOUNTS, }, });