Skip to content

Commit

Permalink
Merge pull request #6672 from vegaprotocol/chore/release-v0.26.17
Browse files Browse the repository at this point in the history
chore(trading,governance,explorer): release v0.26.17
  • Loading branch information
mattrussell36 authored Jul 10, 2024
2 parents fcf095c + 1c48934 commit dad6c98
Show file tree
Hide file tree
Showing 10 changed files with 250 additions and 87 deletions.
1 change: 0 additions & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
* @vegaprotocol/frontend
*.graphql @vegaprotocol/core
43 changes: 21 additions & 22 deletions apps/explorer/src/app/components/proposals/proposals-table.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { type ProposalListFieldsFragment } from '@vegaprotocol/proposals';
import type {
BatchproposalListFieldsFragment,
ProposalListFieldsFragment,
} from '@vegaprotocol/proposals';
import { type AgGridReact } from 'ag-grid-react';
import { ExternalLink } from '@vegaprotocol/ui-toolkit';
import { AgGrid } from '@vegaprotocol/datagrid';
Expand Down Expand Up @@ -65,6 +68,9 @@ export const ProposalsTable = ({ data }: ProposalsTableProps) => {
hide: window.innerWidth <= BREAKPOINT_MD,
headerName: t('Type'),
field: 'terms.change.__typename',
valueGetter: ({ data }) => {
return data?.terms?.change?.__typename || t('Batch');
},
},
{
maxWidth: 100,
Expand All @@ -81,27 +87,16 @@ export const ProposalsTable = ({ data }: ProposalsTableProps) => {
maxWidth: 150,
hide: window.innerWidth <= BREAKPOINT_MD,
headerName: t('Closing date'),
field: 'terms.closingDatetime',
valueFormatter: ({
value,
}: VegaValueFormatterParams<
ProposalListFieldsFragment,
'terms.closingDatetime'
>) => {
return value ? getDateTimeFormat().format(new Date(value)) : '-';
valueGetter: ({ data }) => {
return (
data?.terms?.closingDatetime || data.batchTerms.closingDatetime
);
},
},
{
colId: 'eDate',
maxWidth: 150,
hide: window.innerWidth <= BREAKPOINT_MD,
headerName: t('Enactment date'),
field: 'terms.enactmentDatetime',
valueFormatter: ({
value,
}: VegaValueFormatterParams<
ProposalListFieldsFragment,
'terms.enactmentDatetime'
'terms.closingDatetime'
>) => {
return value ? getDateTimeFormat().format(new Date(value)) : '-';
},
Expand All @@ -115,7 +110,9 @@ export const ProposalsTable = ({ data }: ProposalsTableProps) => {
resizable: false,
cellRenderer: ({
data,
}: VegaICellRendererParams<ProposalListFieldsFragment>) => {
}: VegaICellRendererParams<
ProposalListFieldsFragment | BatchproposalListFieldsFragment
>) => {
const proposalPage = tokenLink(
TOKEN_PROPOSAL.replace(':id', data?.id || '')
);
Expand All @@ -124,7 +121,7 @@ export const ProposalsTable = ({ data }: ProposalsTableProps) => {
setDialog({
open: true,
title: data.rationale.title,
content: data.terms,
content: 'terms' in data ? data.terms : data.subProposals,
});
};
return (
Expand All @@ -150,9 +147,11 @@ export const ProposalsTable = ({ data }: ProposalsTableProps) => {
<AgGrid
ref={gridRef}
rowData={data}
getRowId={({ data }: { data: ProposalListFieldsFragment }) =>
data.id || data.rationale.title
}
getRowId={({
data,
}: {
data: ProposalListFieldsFragment | BatchproposalListFieldsFragment;
}) => data.id || data?.rationale?.title}
overlayNoRowsTemplate={t('This chain has no markets')}
domLayout="autoHeight"
defaultColDef={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ describe('TransferRewards', () => {
const recurring = {
dispatchStrategy: {
entityScope: EntityScope.ENTITY_SCOPE_INDIVIDUALS,
individualScope: IndividualScope.INDIVIDUAL_SCOPE_ALL,
teamScope: ['team1', 'team2', 'team3'],
distributionStrategy:
DistributionStrategy.DISTRIBUTION_STRATEGY_PRO_RATA,
Expand Down
14 changes: 9 additions & 5 deletions apps/trading/client-pages/market/trade-grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ const MainGrid = memo(
const featureFlags = useFeatureFlags((state) => state.flags);
const t = useT();
const [rowSizes, handleRowSizes] = usePaneLayout({
id: 'row',
id: 'trade-row',
});
const [innerRowSizes, handleInnerRowChange] = usePaneLayout({
id: 'inner-row',
id: 'trade-inner-row',
});
const [verticalSizes, handleVerticalChange] = usePaneLayout({
id: 'col',
id: 'trade-col',
});

return (
Expand All @@ -44,7 +44,9 @@ const MainGrid = memo(
</TradeGridChild>
</ResizableGridPanel>
<ResizableGridPanel
preferredSize={verticalSizes[0]}
// use verticalSizes[1] because the previous pane is for
// the market header which is always fixed size
preferredSize={verticalSizes[1]}
priority={LayoutPriority.High}
minSize={200}
>
Expand Down Expand Up @@ -120,7 +122,9 @@ const MainGrid = memo(
</ResizableGrid>
</ResizableGridPanel>
<ResizableGridPanel
preferredSize={verticalSizes[1] || '25%'}
// use verticalSizes[2] because the first pane is for
// the market header which is always fixed size
preferredSize={verticalSizes[2] || '25%'}
minSize={50}
priority={LayoutPriority.Low}
>
Expand Down
4 changes: 2 additions & 2 deletions apps/trading/components/navbar/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const Navbar = ({ theme = 'system' }: { theme?: Theme }) => {
<D.Content
className={classNames(
'lg:hidden',
'border-default bg-vega-clight-700 dark:bg-vega-cdark-700 fixed right-0 top-0 z-20 h-screen w-3/4 border-l',
'border-default bg-vega-clight-700 dark:bg-vega-cdark-700 fixed right-0 top-0 z-20 h-full w-3/4 border-l flex flex-col',
navTextClasses
)}
data-testid="navbar-menu-content"
Expand All @@ -136,7 +136,7 @@ export const Navbar = ({ theme = 'system' }: { theme?: Theme }) => {
</div>
{menu === 'nav' && <NavbarMenu onClick={() => setMenu(null)} />}
{menu === 'wallet' && <VegaWalletMenu setMenu={setMenu} />}
<div className="absolute bottom-2 right-2">
<div className="p-2 mt-auto flex justify-end">
<NodeHealthContainer />
</div>
</D.Content>
Expand Down
3 changes: 2 additions & 1 deletion apps/trading/components/resizable-grid/use-pane-layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { create } from 'zustand';
import { persist } from 'zustand/middleware';
import { immer } from 'zustand/middleware/immer';

const STORAGE_VERSION = 1;
const STORAGE_KEY = 'vega_pane_store';
const PANELS_SET_DEBOUNCE_TIME = 300;

Expand All @@ -20,7 +21,7 @@ export const usePaneLayoutStore = create<{
return state;
}),
})),
{ name: STORAGE_KEY }
{ name: STORAGE_KEY, version: STORAGE_VERSION }
)
);

Expand Down
106 changes: 85 additions & 21 deletions libs/proposals/src/lib/proposals-data-provider/Proposals.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,57 @@ fragment CancelTransferFields on CancelTransfer {
transferId
}

fragment BatchproposalListFields on BatchProposal {
__typename
id
datetime
rationale {
title
description
}
batchTerms {
closingDatetime
}
subProposals {
terms {
closingDatetime
enactmentDatetime
change {
...ChangeFragment
}
}
}
reference
state
datetime
rejectionReason
party {
id
__typename
}
votes {
yes {
totalTokens
totalNumber
totalWeight
__typename
}
no {
totalTokens
totalNumber
totalWeight
__typename
}
__typename
}
errorDetails
rejectionReason
requiredMajority
requiredParticipation
requiredLpMajority
requiredLpParticipation
}

fragment ProposalListFields on Proposal {
id
rationale {
Expand Down Expand Up @@ -446,34 +497,43 @@ fragment ProposalListFields on Proposal {
closingDatetime
enactmentDatetime
change {
__typename
... on NewMarket {
...NewMarketFields
}
... on UpdateMarket {
...UpdateMarketFields
}
... on NewAsset {
...NewAssetFields
}
... on UpdateAsset {
...UpdateAssetFields
}
... on UpdateNetworkParameter {
...UpdateNetworkParameterFields
}
... on UpdateMarketState {
...UpdateMarketStateFields
}
...ChangeFragment
}
}
}

fragment ChangeFragment on ProposalChange {
__typename
... on NewMarket {
...NewMarketFields
}
... on UpdateMarket {
...UpdateMarketFields
}
... on NewAsset {
...NewAssetFields
}
... on UpdateAsset {
...UpdateAssetFields
}
... on UpdateNetworkParameter {
...UpdateNetworkParameterFields
}
... on UpdateMarketState {
...UpdateMarketStateFields
}
}

query ProposalsList($proposalType: ProposalType, $inState: ProposalState) {
proposalsConnection(proposalType: $proposalType, inState: $inState) {
edges {
node {
...ProposalListFields
proposalNode {
... on Proposal {
...ProposalListFields
}
... on BatchProposal {
...BatchproposalListFields
}
}
}
}
Expand Down Expand Up @@ -541,6 +601,10 @@ query MarketViewProposals(
proposalNode {
... on BatchProposal {
id
rationale {
title
description
}
subProposals {
...SubProposal
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export type ProposalFragments = Array<ProposalFragment>;

const getData = (responseData: ProposalsListQuery | null) =>
responseData?.proposalsConnection?.edges
?.filter((edge) => Boolean(edge?.node))
.map((edge) => edge?.node as ProposalListFieldsFragment) || null;
?.filter((edge) => Boolean(edge?.proposalNode))
.map((edge) => edge?.proposalNode as ProposalListFieldsFragment) || null;

export const proposalsDataProvider = makeDataProvider<
ProposalsListQuery,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nx-monorepo",
"version": "0.26.16",
"version": "0.26.17",
"license": "MIT",
"scripts": {
"start": "nx serve",
Expand Down

0 comments on commit dad6c98

Please sign in to comment.