Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 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
8c7e750
Merge pull request #3968 from IntersectMBO/develop
bosko-m Jul 26, 2025
5bbec7b
Fix search for wallet without dRep
mirekzielinski Jul 26, 2025
3011a46
Merge pull request #3969 from IntersectMBO/none_dRepSearch
bosko-m Jul 26, 2025
8ba6345
removes dev and staging builds
aaboyle878 Jul 26, 2025
c1654f5
removes dev and staging builds
aaboyle878 Jul 26, 2025
534fbb1
updates trigger contitions to build image from develop
aaboyle878 Jul 26, 2025
cdd418b
Merge pull request #3971 from IntersectMBO/chore/actions-revamp
aaboyle878 Jul 26, 2025
b65e343
Merge pull request #3970 from IntersectMBO/develop
bosko-m Jul 26, 2025
4030ac1
Merge pull request #3973 from IntersectMBO/test
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
85 changes: 0 additions & 85 deletions .github/workflows/build-from-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- staging
workflow_dispatch:

permissions:
Expand Down Expand Up @@ -83,90 +82,6 @@ jobs:
dockerfile: ./govtool/metadata-validation/Dockerfile
image: ghcr.io/${{ github.repository }}-metadata-validation
qovery_container_name: govtool-metadata-validation
- branch: staging
network: preview-govtool
workdir: ./govtool/backend
name: govtool-backend
dockerfile: ./govtool/backend/Dockerfile.qovery
image: ghcr.io/${{ github.repository }}-backend
qovery_container_name: govtool-backend
- branch: staging
network: preview-govtool
workdir: ./govtool/frontend
name: govtool-frontend
dockerfile: ./govtool/frontend/Dockerfile.qovery
image: ghcr.io/${{ github.repository }}-frontend
qovery_container_name: govtool-frontend
- branch: staging
network: preview-govtool
workdir: ./govtool/metadata-validation
name: govtool-metadata-validation
dockerfile: ./govtool/metadata-validation/Dockerfile
image: ghcr.io/${{ github.repository }}-metadata-validation
qovery_container_name: govtool-metadata-validation
- branch: staging
network: pre-prod-govtool
workdir: ./govtool/backend
name: govtool-backend
dockerfile: ./govtool/backend/Dockerfile.qovery
image: ghcr.io/${{ github.repository }}-backend
qovery_container_name: govtool-backend
- branch: staging
network: pre-prod-govtool
workdir: ./govtool/frontend
name: govtool-frontend
dockerfile: ./govtool/frontend/Dockerfile.qovery
image: ghcr.io/${{ github.repository }}-frontend
qovery_container_name: govtool-frontend
- branch: staging
network: pre-prod-govtool
workdir: ./govtool/metadata-validation
name: govtool-metadata-validation
dockerfile: ./govtool/metadata-validation/Dockerfile
image: ghcr.io/${{ github.repository }}-metadata-validation
qovery_container_name: govtool-metadata-validation
- branch: staging
network: prod-govtool
workdir: ./govtool/backend
name: govtool-backend
dockerfile: ./govtool/backend/Dockerfile.qovery
image: ghcr.io/${{ github.repository }}-backend
qovery_container_name: govtool-backend
- branch: staging
network: prod-govtool
workdir: ./govtool/frontend
name: govtool-frontend
dockerfile: ./govtool/frontend/Dockerfile.qovery
image: ghcr.io/${{ github.repository }}-frontend
qovery_container_name: govtool-frontend
- branch: staging
network: prod-govtool
workdir: ./govtool/metadata-validation
name: govtool-metadata-validation
dockerfile: ./govtool/metadata-validation/Dockerfile
image: ghcr.io/${{ github.repository }}-metadata-validation
qovery_container_name: govtool-metadata-validation
- branch: develop
network: dev-govtool
workdir: ./govtool/backend
name: govtool-backend
dockerfile: ./govtool/backend/Dockerfile.qovery
image: ghcr.io/${{ github.repository }}-backend
qovery_container_name: govtool-backend
- branch: develop
network: dev-govtool
workdir: ./govtool/frontend
name: govtool-frontend
dockerfile: ./govtool/frontend/Dockerfile.qovery
image: ghcr.io/${{ github.repository }}-frontend
qovery_container_name: govtool-frontend
- branch: develop
network: dev-govtool
workdir: ./govtool/metadata-validation
name: govtool-metadata-validation
dockerfile: ./govtool/metadata-validation/Dockerfile
image: ghcr.io/${{ github.repository }}-metadata-validation
qovery_container_name: govtool-metadata-validation

runs-on: ubuntu-latest
steps:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/merge.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: Check,Build,Deploy

on:
workflow_dispatch
push:
branches:
- develop
workflow_dispatch:

permissions:
contents: write
Expand Down
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 @@ -22,7 +22,6 @@ import {
DashboardGovernanceActionsVotedOn,
} from "@organisms";
import { Button } from "@atoms";
import usePrevious from "@/hooks/usePrevious";

type TabPanelProps = {
children?: React.ReactNode;
Expand Down Expand Up @@ -85,21 +84,11 @@ export const DashboardGovernanceActions = () => {
const queryFilters =
chosenFilters.length > 0 ? chosenFilters : defaultCategories;

const prevFilters = usePrevious(queryFilters);
const prevSorting = usePrevious(chosenSorting);

const stableFilters = isAdjusting
? prevFilters ?? queryFilters
: queryFilters;
const stableSorting = isAdjusting
? prevSorting ?? chosenSorting
: chosenSorting;

const { proposals, isProposalsLoading } = useGetProposalsQuery({
filters: stableFilters,
sorting: stableSorting,
filters: queryFilters,
sorting: chosenSorting,
searchPhrase: debouncedSearchText,
enabled: true,
enabled: !isAdjusting,
});
const { data: votes, areDRepVotesLoading } = useGetDRepVotesQuery(
queryFilters,
Expand All @@ -109,31 +98,31 @@ export const DashboardGovernanceActions = () => {

// White Magic :)
const shouldFilter =
voter?.isRegisteredAsDRep || voter?.isRegisteredAsSoleVoter;

const filteredProposals = useMemo(() => {
if (!shouldFilter || !proposals || !votes) return proposals;

return proposals
.map((proposalCategory) => {
const filteredActions = proposalCategory.actions.filter((action) => {
const hasVote = votes.some((voteCategory) =>
voteCategory.actions.some(
(voteAction) =>
voteAction.proposal.txHash === action.txHash &&
voteAction.proposal.index === action.index,
),
);
return !hasVote;
});

return {
...proposalCategory,
actions: filteredActions,
};
})
.filter((category) => category.actions.length > 0);
}, [proposals, votes, shouldFilter]);
voter?.isRegisteredAsDRep || voter?.isRegisteredAsSoleVoter;

const filteredProposals = useMemo(() => {
if (!shouldFilter || !proposals || !votes) return proposals;

return proposals
.map((proposalCategory) => {
const filteredActions = proposalCategory.actions.filter((action) => {
const hasVote = votes.some((voteCategory) =>
voteCategory.actions.some(
(voteAction) =>
voteAction.proposal.txHash === action.txHash &&
voteAction.proposal.index === action.index,
),
);
return !hasVote;
});

return {
...proposalCategory,
actions: filteredActions,
};
})
.filter((category) => category.actions.length > 0);
}, [proposals, votes, shouldFilter]);

const { state } = useLocation();
const [content, setContent] = useState<number>(
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