Skip to content

Commit

Permalink
fix(#2191): protocol parameter change ga is not displayed correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
MSzalowski committed Oct 22, 2024
1 parent d6398d2 commit 02e686a
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ changes.
- Fix duplicate testIds for reference errors and hints in DRep metadata form [Issue 1965](https://github.com/IntersectMBO/govtool/issues/1965)
- Eliminate duplicate DReps in the DRep Directory [Issue 2171](https://github.com/IntersectMBO/govtool/issues/2171)
- Handle script based DReps [Issue 1951](https://github.com/IntersectMBO/govtool/issues/1951)
- Fix displaying protocol parameter cost models [Issue 2191](https://github.com/IntersectMBO/govtool/issues/2191)

### Changed

Expand Down
19 changes: 18 additions & 1 deletion govtool/backend/sql/get-current-epoch-params.sql
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
select ROW_TO_JSON(epoch_param) from epoch_param order by epoch_no desc limit 1;
SELECT
jsonb_set(
ROW_TO_JSON(epoch_param)::jsonb,
'{cost_model}',
CASE
WHEN cost_model.id IS NOT NULL THEN
ROW_TO_JSON(cost_model)::jsonb
ELSE
'null'::jsonb
END
) AS epoch_param
FROM
epoch_param
LEFT JOIN
cost_model ON epoch_param.cost_model_id = cost_model.id
ORDER BY
epoch_no DESC
LIMIT 1;
12 changes: 11 additions & 1 deletion govtool/backend/sql/list-proposals.sql
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,16 @@ SELECT
creator_block.epoch_no,
voting_anchor.url,
encode(voting_anchor.data_hash, 'hex'),
ROW_TO_JSON(proposal_params),
jsonb_set(
ROW_TO_JSON(proposal_params)::jsonb,
'{cost_model}',
CASE
WHEN cost_model.id IS NOT NULL THEN
ROW_TO_JSON(cost_model)::jsonb
ELSE
'null'::jsonb
END
) AS proposal_params,
off_chain_vote_gov_action_data.title,
off_chain_vote_gov_action_data.abstract,
off_chain_vote_gov_action_data.motivation,
Expand Down Expand Up @@ -104,6 +113,7 @@ FROM
JOIN block AS creator_block ON creator_block.id = creator_tx.block_id
LEFT JOIN voting_anchor ON voting_anchor.id = gov_action_proposal.voting_anchor_id
LEFT JOIN param_proposal as proposal_params ON gov_action_proposal.param_proposal = proposal_params.id
LEFT JOIN cost_model AS cost_model ON proposal_params.cost_model_id = cost_model.id
LEFT JOIN off_chain_vote_data ON off_chain_vote_data.voting_anchor_id = voting_anchor.id
LEFT JOIN off_chain_vote_gov_action_data ON off_chain_vote_gov_action_data.off_chain_vote_data_id = off_chain_vote_data.id
LEFT JOIN voting_procedure ON voting_procedure.gov_action_proposal_id = gov_action_proposal.id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ export const DataMissingHeader = ({
>
<Typography
sx={{
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
fontWeight: 600,
...(isDataMissing && { color: "errorRed" }),
...titleStyle,
Expand Down
2 changes: 2 additions & 0 deletions govtool/frontend/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { QueryClient, QueryClientProvider } from "react-query";
import { ReactQueryDevtools } from "react-query/devtools";
import TagManager from "react-gtm-module";
import { ThemeProvider } from "@emotion/react";
import { CssBaseline } from "@mui/material";
import * as Sentry from "@sentry/react";

import { ContextProviders, UsersnapProvider } from "@context";
Expand Down Expand Up @@ -51,6 +52,7 @@ ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
<QueryClientProvider client={queryClient}>
<ThemeProvider theme={theme}>
<CssBaseline />
<UsersnapProvider>
<BrowserRouter>
<ContextProviders>
Expand Down
22 changes: 17 additions & 5 deletions govtool/frontend/src/theme.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { createTheme } from "@mui/material/styles";
import {
cyan, errorRed, orange, primaryBlue, progressYellow, successGreen,
cyan,
errorRed,
orange,
primaryBlue,
progressYellow,
successGreen,
} from "./consts";

export type Theme = typeof theme;
Expand All @@ -17,12 +22,19 @@ export const theme = createTheme({
},
},
components: {
MuiCssBaseline: {
styleOverrides: {
":root": {
fonfFamily: "Poppins, Arial",
},
},
},
MuiAccordion: {
styleOverrides: {
root: {
borderRadius: `12px !important`,
}
}
},
},
},
MuiInputBase: {
styleOverrides: {
Expand Down Expand Up @@ -52,7 +64,7 @@ export const theme = createTheme({
{
props: { color: "default", variant: "filled" },
style: {
backgroundColor: primaryBlue.c50
backgroundColor: primaryBlue.c50,
},
},
{
Expand Down Expand Up @@ -110,7 +122,7 @@ export const theme = createTheme({
MuiPopover: {
defaultProps: {
elevation: 2,
}
},
},
},
typography: {
Expand Down

0 comments on commit 02e686a

Please sign in to comment.