Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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: voter?.isRegisteredAsDRep || voter?.isRegisteredAsSoleVoter,
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
Loading