Skip to content
Merged

v2.0.32 #3968

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
6f45edd
Update DashboardGovernanceActions.tsx - removes double filtering of p…
bosko-m Jul 25, 2025
74f6b97
Update DashboardGovernanceActions.tsx - lint checks fix
bosko-m Jul 25, 2025
baf494d
Clening search input on start dRepDirectory
mirekzielinski Jul 25, 2025
9fa3f14
Merge pull request #3960 from IntersectMBO/dRepDirectory_search
bosko-m Jul 25, 2025
e39ac50
Merge pull request #3959 from IntersectMBO/3918-3956-removes-double-f…
bosko-m Jul 25, 2025
4837150
P0 - GA index in the URL is not considered as a parameter but an html…
Jul 25, 2025
75f6161
Revert "Update DashboardGovernanceActions.tsx - lint checks fix"
aaboyle878 Jul 25, 2025
bbbcc93
Revert "Update DashboardGovernanceActions.tsx - removes double filter…
aaboyle878 Jul 25, 2025
23a4cec
Update API.hs - test getvotes filtering with txhash+index
bosko-m Jul 25, 2025
3ff4579
Update API.hs
bosko-m Jul 25, 2025
1069058
Update API.hs - #3
bosko-m Jul 25, 2025
a5ce62b
Merge pull request #3963 from IntersectMBO/3918-get-votes-matching-by…
bosko-m Jul 25, 2025
3e12e74
Update DashboardGovernanceActions.tsx - fetch proposals with voter st…
bosko-m Jul 25, 2025
f9aaa39
Merge pull request #3965 from IntersectMBO/3918-fetch-proposals-with-…
bosko-m Jul 25, 2025
a799722
fix: refetching proposal list on voter update
MSzalowski Jul 25, 2025
be47b81
Merge pull request #3967 from IntersectMBO/fix/refetching-list-on-vot…
MSzalowski Jul 25, 2025
d3015fb
Merge pull request #3962 from IntersectMBO/issue-3923
bosko-m Jul 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions govtool/backend/src/VVA/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -296,22 +296,22 @@ getVotes (unHexText -> dRepId) selectedTypes sortMode mSearch = do
CacheEnv {dRepGetVotesCache} <- asks vvaCache
(votes, proposals) <- cacheRequest dRepGetVotesCache dRepId $ DRep.getVotes dRepId []

let voteMapByTxHash = Map.fromList $
map (\vote -> (pack $ Prelude.takeWhile (/= '#') (unpack $ Types.voteGovActionId vote), vote)) votes
let voteMapById = Map.fromList $
map (\vote -> (Types.voteGovActionId vote, vote)) votes

processedProposals <- filter (isProposalSearchedFor mSearch) <$>
mapSortAndFilterProposals selectedTypes sortMode proposals

return $
return
[ VoteResponse
{ voteResponseVote = voteToResponse vote
, voteResponseProposal = proposalResponse
}
| proposalResponse <- processedProposals
, let txHash = unHexText (proposalResponseTxHash proposalResponse)
, Just vote <- [Map.lookup txHash voteMapByTxHash]
, let govActionId = unHexText (proposalResponseTxHash proposalResponse) <> "#" <> pack (show $ proposalResponseIndex proposalResponse)
, Just vote <- [Map.lookup govActionId voteMapById]
]

drepInfo :: App m => HexText -> m DRepInfoResponse
drepInfo (unHexText -> dRepId) = do
CacheEnv {dRepInfoCache} <- asks vvaCache
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export const DashboardGovernanceActionDetails = () => {
);

useEffect(() => {
if (data?.proposal && typeof isMetadataValid !== "boolean") {
const extendedProposalIndex = extendedProposal ? extendedProposal.index : -1;
if (data?.proposal && data?.proposal.index !== extendedProposalIndex) {
setExtendedProposal(data.proposal);
}
}, [data?.proposal, isMetadataValid]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const DashboardGovernanceActions = () => {
filters: stableFilters,
sorting: stableSorting,
searchPhrase: debouncedSearchText,
enabled: true,
enabled: voter?.isRegisteredAsDRep || voter?.isRegisteredAsSoleVoter,
});
const { data: votes, areDRepVotesLoading } = useGetDRepVotesQuery(
queryFilters,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const GovernanceActionsToVote = ({
data={item.actions.slice(0, 6).map((action) => (
<div
className="keen-slider__slide"
key={action.id}
key={`${action.txHash}${action.index}`}
style={{
overflow: "visible",
width: "auto",
Expand Down
27 changes: 17 additions & 10 deletions govtool/frontend/src/hooks/queries/useGetProposalsQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,23 @@ export const useGetProposalsQuery = ({
return allProposals.flatMap((proposal) => proposal.elements);
};

const { data, isLoading } = useQuery(
[QUERY_KEYS.useGetProposalsKey, filters, searchPhrase, sorting, dRepID],
fetchProposals,
{
enabled,
refetchOnWindowFocus: true,
keepPreviousData: true,
staleTime: 2000,
},
);
const { data, isLoading } = useQuery(
[
QUERY_KEYS.useGetProposalsKey,
filters,
searchPhrase,
sorting,
dRepID,
voter?.isRegisteredAsDRep,
voter?.isRegisteredAsSoleVoter,
],
fetchProposals,
{
enabled,
refetchOnWindowFocus: true,
keepPreviousData: true,
},
);

const proposals = Object.values(groupByType(data) ?? []);

Expand Down
13 changes: 12 additions & 1 deletion govtool/frontend/src/pages/DRepDirectoryContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,24 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
}) => {
const { dRepID: myDRepId, pendingTransaction, stakeKey } = useCardano();
const { t } = useTranslation();
const { debouncedSearchText, ...dataActionsBarProps } = useDataActionsBar();

const {
searchText,
debouncedSearchText,
setSearchText,
...dataActionsBarProps
} = useDataActionsBar();

const { chosenFilters, chosenSorting, setChosenFilters, setChosenSorting } =
dataActionsBarProps;

const [inProgressDelegationDRepData, setInProgressDelegationDRepData] =
useState<DRepData | undefined>(undefined);

// Set initial filters and sort
useEffect(() => {
setChosenFilters([DRepStatus.Active]);
setSearchText(""); // <--- Clear the search field on mount
}, []);

useEffect(() => {
Expand Down Expand Up @@ -198,6 +207,8 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
</Typography>
<DataActionsBar
{...dataActionsBarProps}
searchText={searchText}
setSearchText={setSearchText}
filterOptions={DREP_DIRECTORY_FILTERS}
filtersTitle={t("dRepDirectory.filterTitle")}
sortOptions={DREP_DIRECTORY_SORTING}
Expand Down
Loading