Skip to content

Commit c1faa65

Browse files
authored
Merge pull request #4097 from IntersectMBO/develop
v2.0.36
2 parents 8dd8817 + 01c9b4b commit c1faa65

File tree

8 files changed

+128
-74
lines changed

8 files changed

+128
-74
lines changed

govtool/backend/sql/get-network-metrics.sql

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,18 @@ CurrentEpoch AS (
2222
SELECT MAX(no) AS no FROM epoch
2323
),
2424
CommitteeMembers AS (
25-
SELECT DISTINCT ON (cm.committee_hash_id)
26-
cr.id,
27-
block.time,
28-
encode(cold_key_hash.raw, 'hex') cold_key,
29-
encode(hot_key_hash.raw, 'hex') hot_key
30-
FROM committee_registration cr
31-
JOIN tx ON tx.id = cr.tx_id
32-
JOIN block ON block.id = tx.block_id
33-
JOIN committee_hash cold_key_hash ON cr.cold_key_id = cold_key_hash.id
34-
JOIN committee_hash hot_key_hash ON cr.hot_key_id = hot_key_hash.id
35-
JOIN committee_member cm ON cm.committee_hash_id = cold_key_hash.id OR cm.committee_hash_id = hot_key_hash.id
36-
LEFT JOIN committee_de_registration cdr ON cdr.cold_key_id = cold_key_hash.id
37-
CROSS JOIN CurrentEpoch
38-
WHERE
39-
cdr.id IS NULL AND cm.expiration_epoch > CurrentEpoch.no
25+
SELECT
26+
DISTINCT cm.committee_hash_id AS committee_members
27+
FROM committee_member cm
28+
JOIN committee c ON c.id = cm.committee_id
29+
LEFT JOIN gov_action_proposal gap ON gap.id = c.gov_action_proposal_id
30+
CROSS JOIN CurrentEpoch ce
31+
WHERE (
32+
(c.gov_action_proposal_id IS NULL)
33+
OR
34+
(gap.enacted_epoch IS NOT NULL AND gap.enacted_epoch <= ce.no)
35+
)
36+
AND cm.expiration_epoch >= ce.no
4037
),
4138
NoOfCommitteeMembers AS (
4239
SELECT COUNT(*) total FROM CommitteeMembers

govtool/frontend/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

govtool/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@hookform/resolvers": "^3.3.1",
3030
"@intersect.mbo/govtool-outcomes-pillar-ui": "v1.5.9",
3131
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
32-
"@intersect.mbo/pdf-ui": "1.0.14-beta",
32+
"@intersect.mbo/pdf-ui": "1.0.15-beta",
3333
"@mui/icons-material": "^5.14.3",
3434
"@mui/material": "^5.14.4",
3535
"@noble/ed25519": "^2.3.0",

govtool/frontend/src/components/molecules/DataActionsBar.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,16 @@ export const DataActionsBar: FC<DataActionsBarProps> = ({
7474
setChosenFilters?.((prev) => (prev ?? []).filter((k) => k !== key));
7575

7676
return (
77-
<Box display="flex" flexDirection="column" gap={1.5}>
77+
<Box display="flex" flexDirection="column" gap={1.5} sx={{ width: "100%" }}>
7878
<Box
79+
display="grid"
80+
gridTemplateColumns={{
81+
xs: "minmax(0,1fr) max-content",
82+
sm: "minmax(0,1fr) max-content",
83+
}}
84+
columnGap={{ xs: 1, sm: 1.5 }}
7985
alignItems="center"
80-
display="flex"
81-
justifyContent="space-between"
82-
gap={{ xs: 0.75, sm: 1.5 }}
83-
flexWrap={{ xs: "wrap", sm: "nowrap" }}
84-
width="100%"
86+
sx={{ width: "100%" }}
8587
>
8688
<InputBase
8789
inputProps={{ "data-testid": "search-input" }}
@@ -115,7 +117,7 @@ export const DataActionsBar: FC<DataActionsBarProps> = ({
115117
borderColor: "#6E87D9",
116118
borderRadius: 50,
117119
boxShadow: "2px 2px 20px 0 rgba(0,0,0,0.05)",
118-
fontSize: 11,
120+
fontSize: { xs: 16, sm: 11 },
119121
fontWeight: 500,
120122
height: 48,
121123
padding: "16px 24px",
@@ -133,6 +135,7 @@ export const DataActionsBar: FC<DataActionsBarProps> = ({
133135
flex: "0 0 auto",
134136
flexShrink: 0,
135137
mt: { xs: 1, sm: 0 },
138+
mr: { xs: 2, sm: 0 },
136139
}}
137140
>
138141
<OrderActionsChip

govtool/frontend/src/components/organisms/MaintenanceEndingBanner/MaintenanceEndingBanner.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,20 @@ export const MaintenanceEndingBanner = () => {
102102
color="common.white"
103103
mb={0.5}
104104
>
105-
{t("system.maintenanceEnding.description2")}
105+
<Trans
106+
i18nKey="system.maintenanceEnding.description2"
107+
components={[
108+
<Link
109+
variant="caption"
110+
fontWeight={600}
111+
color="common.white"
112+
href="https://gov.tools/governance_actions/d2db60c5307cb517c735e2d0138d2b6f10fc5b221d610fa187719bdc82af9a03#0"
113+
data-testid="govtool-info-link"
114+
target="_blank"
115+
rel="noopener noreferrer"
116+
/>,
117+
]}
118+
/>
106119
</Typography>
107120
</Box>
108121
</Box>

govtool/frontend/src/i18n/locales/en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,9 +796,9 @@
796796
"title": "This tool is connected to {{networkName}}",
797797
"bootstrappingWarning": "Govtool is in the Bootstrapping phase. Some features are not available. <docs>Learn more</docs>",
798798
"maintenanceEnding": {
799-
"title": "\uD83D\uDCA1 Next Step: Treasury Withdrawal based on your feedback is coming soon",
799+
"title": "\uD83D\uDCA1 Next Step: Treasury Withdrawal based on your feedback has been submitted",
800800
"description1": "<0>The Info Action</0> has passed — thank you for your support!",
801-
"description2": "We’re now preparing a Treasury Withdrawal proposal that reflects the feedback gathered during the voting phase to ensure continued development and maintenance of GovTool as a community-owned governance interface on Cardano."
801+
"description2": "We have now submitted a <0>Treasury Withdrawal</0> that reflects the feedback gathered during the voting phase to ensure continued development and maintenance of GovTool as a community-owned governance interface on Cardano."
802802
}
803803
},
804804
"tooltips": {

govtool/frontend/src/pages/DRepDirectoryContent.tsx

Lines changed: 83 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
6969
const [inProgressDelegationDRepData, setInProgressDelegationDRepData] =
7070
useState<DRepData | undefined>(undefined);
7171

72-
// Set initial filters and sort
7372
useEffect(() => {
7473
if (!lastPath.includes("drep_directory")) {
7574
setChosenFilters([DRepStatus.Active]);
@@ -104,7 +103,7 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
104103
baselineTotalForStatus,
105104
} = useGetDRepListPaginatedQuery(
106105
{
107-
page: page - 1, // convert 1-based UI -> 0-based API
106+
page: page - 1,
108107
pageSize,
109108
searchPhrase: debouncedSearchText,
110109
sorting: chosenSorting as DRepListSort,
@@ -151,9 +150,28 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
151150
currentDelegation?.dRepView ===
152151
AutomatedVotingOptionCurrentDelegation.drep_always_no_confidence);
153152

153+
const scaleWrapSx = isConnected
154+
? ({
155+
width: "100%",
156+
transform: { xs: "scale(0.9)", sm: "scale(0.9)", md: "none" },
157+
transformOrigin: { xs: "top center", sm: "top center", md: "initial" },
158+
ml: { xs: 0.25, sm: 0.25, md: 0 },
159+
} as const)
160+
: ({
161+
width: "100%",
162+
transform: { xs: "scale(0.9)", sm: "scale(0.9)", md: "none" },
163+
transformOrigin: { xs: "top left", sm: "top left", md: "initial" },
164+
ml: { xs: 0.25, sm: 0.25, md: 0 },
165+
} as const);
166+
154167
return (
155-
<Box display="flex" flex={1} flexDirection="column" gap={4}>
156-
{/* My delegation */}
168+
<Box
169+
display="flex"
170+
flex={1}
171+
flexDirection="column"
172+
gap={4}
173+
sx={{ width: "100%", maxWidth: "100vw" }}
174+
>
157175
{myDrep &&
158176
!inProgressDelegation &&
159177
currentDelegation &&
@@ -162,26 +180,34 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
162180
<Typography variant="title2" sx={{ mb: 2 }}>
163181
<Trans i18nKey="dRepDirectory.myDelegation" values={{ ada }} />
164182
</Typography>
165-
<DRepCard
166-
dRep={myDrep}
167-
isConnected={!!isConnected}
168-
isInProgress={isSameDRep(myDrep, inProgressDelegation)}
169-
isMe={isSameDRep(myDrep, myDRepId)}
170-
/>
183+
<Box>
184+
<Box sx={scaleWrapSx}>
185+
<DRepCard
186+
dRep={myDrep}
187+
isConnected={!!isConnected}
188+
isInProgress={isSameDRep(myDrep, inProgressDelegation)}
189+
isMe={isSameDRep(myDrep, myDRepId)}
190+
/>
191+
</Box>
192+
</Box>
171193
</div>
172194
)}
195+
173196
{inProgressDelegation &&
174197
inProgressDelegation !== myDRepId &&
175198
inProgressDelegationDRepData && (
176-
<DRepCard
177-
dRep={inProgressDelegationDRepData}
178-
isConnected={!!isConnected}
179-
isMe={isSameDRep(inProgressDelegationDRepData, myDRepId)}
180-
isInProgress
181-
/>
199+
<Box>
200+
<Box sx={scaleWrapSx}>
201+
<DRepCard
202+
dRep={inProgressDelegationDRepData}
203+
isConnected={!!isConnected}
204+
isMe={isSameDRep(inProgressDelegationDRepData, myDRepId)}
205+
isInProgress
206+
/>
207+
</Box>
208+
</Box>
182209
)}
183210

184-
{/* Automated voting options */}
185211
{isConnected && (
186212
<div>
187213
<Typography variant="title2" sx={{ mb: 2 }}>
@@ -216,7 +242,6 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
216242
</div>
217243
)}
218244

219-
{/* DRep list */}
220245
<>
221246
<Typography fontSize={18} fontWeight={500} sx={{ mb: 3 }}>
222247
{t("dRepDirectory.listTitle")}
@@ -263,41 +288,57 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
263288
mt={showSearchSummary ? 0 : 4}
264289
p={0}
265290
sx={{
266-
opacity: isPrev ? 0.5 : 1,
267-
transition: "opacity 0.2s",
268291
flex: 1,
292+
width: "100%",
293+
maxWidth: "100%",
269294
}}
270295
>
271296
{filteredDoNotListDReps?.length === 0 && <EmptyStateDrepDirectory />}
272297
{filteredDoNotListDReps?.map((dRep) => (
273298
<Box key={dRep.view} component="li" sx={{ listStyle: "none" }}>
274-
<DRepCard
275-
dRep={dRep}
276-
isConnected={!!isConnected}
277-
isDelegationLoading={
278-
isDelegating === dRep.view || isDelegating === dRep.drepId
279-
}
280-
isMe={isSameDRep(dRep, myDRepId)}
281-
isMyDrep={isSameDRep(dRep, currentDelegation?.dRepView)}
282-
onDelegate={() => {
283-
setInProgressDelegationDRepData(dRep);
284-
delegate(dRep.drepId);
285-
}}
286-
/>
299+
<Box>
300+
<Box sx={scaleWrapSx}>
301+
<DRepCard
302+
dRep={dRep}
303+
isConnected={!!isConnected}
304+
isDelegationLoading={
305+
isDelegating === dRep.view || isDelegating === dRep.drepId
306+
}
307+
isMe={isSameDRep(dRep, myDRepId)}
308+
isMyDrep={isSameDRep(dRep, currentDelegation?.dRepView)}
309+
onDelegate={() => {
310+
setInProgressDelegationDRepData(dRep);
311+
delegate(dRep.drepId);
312+
}}
313+
/>
314+
</Box>
315+
</Box>
287316
</Box>
288317
))}
289318
</Box>
290319

291-
<PaginationFooter
292-
page={page}
293-
total={total || 0}
294-
pageSize={pageSize}
295-
onPageChange={setPage}
296-
onPageSizeChange={(n) => {
297-
setPageSize(n);
298-
setPage(1);
320+
<Box
321+
sx={{
322+
width: "100%",
323+
transform: { xs: "scale(0.85)", sm: "scale(0.85)", md: "none" },
324+
transformOrigin: {
325+
xs: "top rigth",
326+
sm: "top rigth",
327+
md: "initial",
328+
},
299329
}}
300-
/>
330+
>
331+
<PaginationFooter
332+
page={page}
333+
total={total || 0}
334+
pageSize={pageSize}
335+
onPageChange={setPage}
336+
onPageSizeChange={(n) => {
337+
setPageSize(n);
338+
setPage(1);
339+
}}
340+
/>
341+
</Box>
301342
</>
302343
</Box>
303344
);

govtool/frontend/src/utils/validateSignature.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ export const validateSignature = async ({
2424
switch (algorithm) {
2525
case "ed25519":
2626
case "Ed25519": {
27-
return verifyEd25519Signature(signature, messageHash, publicKey);
27+
return await verifyEd25519Signature(signature, messageHash, publicKey);
2828
}
2929
case "CIP-8":
3030
case "CIP-0008": {
31-
return verifyCIP8Signature(signature, messageHash, publicKey);
31+
return await verifyCIP8Signature(signature, messageHash, publicKey);
3232
}
3333
default:
3434
console.error("Unsupported algorithm:", algorithm);

0 commit comments

Comments
 (0)