Skip to content

Commit

Permalink
Merge pull request #638 from IntersectMBO/develop
Browse files Browse the repository at this point in the history
Enhancements: Deployment Workflow, Search Functionality Fixes and Action Improvements
  • Loading branch information
pmbinapps authored Apr 5, 2024
2 parents 7921469 + 6f5cf33 commit 1768276
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 84 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/build-and-deploy-beta.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Build and deploy GovTool to BETA server
run-name: Deploy by @${{ github.actor }}

# That should be executed on create: tag event
on:
push:
branches:
- main
workflow_dispatch:

env:
ENVIRONMENT: "beta"
Expand Down Expand Up @@ -35,7 +34,7 @@ jobs:
IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build-and-deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: Build and deploy GovTool to STAGING server
run-name: Deploy by @${{ github.actor }}

on:
push:
pull_request:
branches:
- staging
types:
- closed

env:
ENVIRONMENT: "staging"
Expand Down Expand Up @@ -35,7 +37,7 @@ jobs:
IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build-and-deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: Build and deploy GovTool to TEST server
run-name: Deploy by @${{ github.actor }}

on:
push:
pull_request:
branches:
- test
types:
- closed

env:
ENVIRONMENT: "test"
Expand Down Expand Up @@ -35,7 +37,7 @@ jobs:
IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
44 changes: 23 additions & 21 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,6 @@ changes.

## [Unreleased]

- Check a GA metadata is valid [Issue 535](https://github.com/IntersectMBO/govtool/issues/535)
- DRep metadata builder [Issue 497](https://github.com/IntersectMBO/govtool/issues/497)
- Update Cardano Serialization Lib to 12.0.0-alpha.19 [Issue 521](https://github.com/IntersectMBO/govtool/issues/521)
- Add generate jsonld function [Issue 451](https://github.com/IntersectMBO/govtool/issues/451)
- Create GA review subbmision page [Issue 362](https://github.com/IntersectMBO/govtool/issues/362)
- Create GA creation form [Issue 360](https://github.com/IntersectMBO/govtool/issues/360)
- Create TextArea [Issue 110](https://github.com/IntersectMBO/govtool/issues/110)
- Choose GA type - GA Submiter [Issue 358](https://github.com/IntersectMBO/govtool/issues/358)
- Add on-chain inputs validation [Issue 377](https://github.com/IntersectMBO/govtool/issues/377)
- Add hash and validation of the metadata [Issue 378](https://github.com/IntersectMBO/govtool/issues/378)
- Add githubusercontent.com and ipfs.io to content security policy header [Issue 451](https://github.com/IntersectMBO/govtool/issues/451)
- Add frontend test workflow on github actions [Issue 500](https://github.com/IntersectMBO/govtool/issues/500)
- Add type check & lint to github actions [Issue 512](https://github.com/IntersectMBO/govtool/issues/512)
- Add eslint & prettier to frontend package [Issue 166](https://github.com/IntersectMBO/govtool/issues/166)
- Extend the eslint config to apply to the style guide of the project [Issue 514](https://github.com/IntersectMBO/govtool/issues/514)
- Fix all the existing eslint errors [Issue 514](https://github.com/IntersectMBO/govtool/issues/514)
- Fix all the existing typescript errors [Issue 514](https://github.com/IntersectMBO/govtool/issues/514)
- Fix endless spinner on a dashboard [Issue 539](https://github.com/IntersectMBO/govtool/issues/539)
- Update frontend package readme to reflect recent changes [Issue 543](https://github.com/IntersectMBO/govtool/issues/543)
- Change input selection strategy to 3 (random) [Issue 575](https://github.com/IntersectMBO/govtool/issues/575)

### Added

- added `epochNo` and `date` to `drep/getVotes` and `proposal/get`
Expand All @@ -44,6 +23,18 @@ changes.
- Add possibility to vote on behalf of myself - Sole Voter [Issue 119](https://github.com/IntersectMBO/govtool/issues/119)
- Added Nix Flakes configurtion to handle unified developers setup [Issue 526](https://github.com/IntersectMBO/govtool/issues/526)
- Add missing test to utils [Issue 500](https://github.com/IntersectMBO/govtool/issues/500).
- DRep metadata builder [Issue 497](https://github.com/IntersectMBO/govtool/issues/497)
- Add generate jsonld function [Issue 451](https://github.com/IntersectMBO/govtool/issues/451)
- Create GA review subbmision page [Issue 362](https://github.com/IntersectMBO/govtool/issues/362)
- Create GA creation form [Issue 360](https://github.com/IntersectMBO/govtool/issues/360)
- Create TextArea [Issue 110](https://github.com/IntersectMBO/govtool/issues/110)
- Choose GA type - GA Submiter [Issue 358](https://github.com/IntersectMBO/govtool/issues/358)
- Add on-chain inputs validation [Issue 377](https://github.com/IntersectMBO/govtool/issues/377)
- Add hash and validation of the metadata [Issue 378](https://github.com/IntersectMBO/govtool/issues/378)
- Add githubusercontent.com and ipfs.io to content security policy header [Issue 451](https://github.com/IntersectMBO/govtool/issues/451)
- Add frontend test workflow on github actions [Issue 500](https://github.com/IntersectMBO/govtool/issues/500)
- Add type check & lint to github actions [Issue 512](https://github.com/IntersectMBO/govtool/issues/512)
- Add eslint & prettier to frontend package [Issue 166](https://github.com/IntersectMBO/govtool/issues/166)

### Fixed

Expand All @@ -63,9 +54,13 @@ changes.
- Fixed get drep voting power incorrectly executed endpoint [Issue 280](https://github.com/IntersectMBO/govtool/issues/280).
- Fixed CSP settings to allow error reports with Sentry [Issue 291](https://github.com/IntersectMBO/govtool/issues/291).
- Fix frontend package tests [Issue 500](https://github.com/IntersectMBO/govtool/issues/500).
- Fix all the existing eslint errors [Issue 514](https://github.com/IntersectMBO/govtool/issues/514)
- Fix all the existing typescript errors [Issue 514](https://github.com/IntersectMBO/govtool/issues/514)
- Fix endless spinner on a dashboard [Issue 539](https://github.com/IntersectMBO/govtool/issues/539)

### Changed

- `proposal/list` allows user to search by tx hash [Issue 603](https://github.com/IntersectMBO/govtool/issues/603)
- `proposal/list` returns additional data such ass `expiryEpochNo`, `createdEpochNo`, `title`, `about`, `motivation`,
`rationale`. `TreasuryWithdrawals` GAs also got nicely formated details. [Issue 372](https://github.com/IntersectMBO/govtool/issues/372)
- `drep/list` now return also `status` and `type` fields. Also it now returns the retired dreps, and you can search for given drep by name using optional query parameter. If the drep name is passed exactly, then you can even find a drep that's sole voter. [Issue 446](https://github.com/IntersectMBO/govtool/issues/446)
Expand All @@ -84,11 +79,18 @@ changes.
- Applied unified policy on Docker images tagging [Issue 320](https://github.com/IntersectMBO/govtool/issues/320).
- Reorganised deployment Makefiles in order to better document the process and easier management [Issue 385](https://github.com/IntersectMBO/govtool/issues/385).
- Added a grafana panel to track all the deploys on the target machines [Issue 361](https://github.com/IntersectMBO/govtool/issues/361).
- Check a GA metadata is valid [Issue 535](https://github.com/IntersectMBO/govtool/issues/535)
- Update Cardano Serialization Lib to 12.0.0-alpha.19 [Issue 521](https://github.com/IntersectMBO/govtool/issues/521)
- Extend the eslint config to apply to the style guide of the project [Issue 514](https://github.com/IntersectMBO/govtool/issues/514)
- Update frontend package readme to reflect recent changes [Issue 543](https://github.com/IntersectMBO/govtool/issues/543)
- Change input selection strategy to 3 (random) [Issue 575](https://github.com/IntersectMBO/govtool/issues/575)

### Removed

-

## [sancho-v1.0.2-alpha](https://github.com/IntersectMBO/govtool/releases/tag/sancho-v1.0.0-alpha) 2023-04-05

## [sancho-v1.0.0](https://github.com/IntersectMBO/govtool/releases/tag/sancho-v1.0.0) 2023-12-17

- Import code to new repository
3 changes: 2 additions & 1 deletion govtool/backend/src/VVA/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,12 @@ listProposals selectedTypes sortMode mPage mPageSize mDrepRaw mSearchQuery = do
about <- Text.toLower <$> proposalResponseAbout
motivation <- Text.toLower <$> proposalResponseMotivation
rationale <- Text.toLower <$> proposalResponseRationale

let govActionId = unHexText proposalResponseTxHash <> "#" <> Text.pack (show proposalResponseIndex)
let result = searchQuery `isInfixOf` title
|| searchQuery `isInfixOf` about
|| searchQuery `isInfixOf` motivation
|| searchQuery `isInfixOf` rationale
|| searchQuery `isInfixOf` govActionId

pure result

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Typography } from "@atoms";
import { useTranslation } from "@hooks";
import { getProposalTypeLabel } from "@utils";

import { EmptyStateGovernanceActionsCategoryProps } from "./types";

export const EmptyStateGovernanceActionsCategory = ({
category,
isSearch,
}: EmptyStateGovernanceActionsCategoryProps) => {
const { t } = useTranslation();

return (
<Typography
sx={{
fontWeight: 300,
py: 4,
}}
>
{isSearch ? (
t("govActions.noResultsForTheSearch")
) : (
<>
{t("govActions.withCategoryNotExist.partOne")}
&nbsp;
<Typography
sx={{
display: "inline",
fontWeight: 700,
}}
>
{getProposalTypeLabel(category ?? "")}
</Typography>
&nbsp;
{t("govActions.withCategoryNotExist.partTwo")}
</>
)}
</Typography>
);
};
1 change: 1 addition & 0 deletions govtool/frontend/src/components/molecules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export * from "./DataActionsFilters";
export * from "./DataActionsSorting";
export * from "./DataMissingInfoBox";
export * from "./DRepInfoCard";
export * from "./EmptyStateGovernanceActionsCategory";
export * from "./Field";
export * from "./GovActionDetails";
export * from "./GovernanceActionCard";
Expand Down
5 changes: 5 additions & 0 deletions govtool/frontend/src/components/molecules/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ export type SoleVoterActionProps = {
onClickArrow: () => void;
sx?: SxProps;
};

export type EmptyStateGovernanceActionsCategoryProps = {
category?: string;
isSearch?: boolean;
};
34 changes: 9 additions & 25 deletions govtool/frontend/src/pages/DashboardGovernanceActionsCategory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import { Box, CircularProgress, Link } from "@mui/material";
import { Background, Typography } from "@atoms";
import { GOVERNANCE_ACTIONS_SORTING, ICONS, PATHS } from "@consts";
import { useCardano } from "@context";
import { DataActionsBar, GovernanceActionCard } from "@molecules";
import {
DataActionsBar,
EmptyStateGovernanceActionsCategory,
GovernanceActionCard,
} from "@molecules";
import {
useDataActionsBar,
useFetchNextPageDetector,
Expand Down Expand Up @@ -109,30 +113,10 @@ export const DashboardGovernanceActionsCategory = () => {
<CircularProgress />
</Box>
) : !mappedData?.length ? (
<Typography
sx={{
fontWeight: 300,
py: 4,
}}
>
<Box display="flex" flexWrap="wrap" mt={4}>
<Typography fontWeight={300}>
{t("govActions.withCategoryNotExist.partOne")}
&nbsp;
</Typography>
<Typography
sx={{
fontWeight: 700,
}}
>
{` ${category} `}
</Typography>
<Typography fontWeight={300}>
&nbsp;
{t("govActions.withCategoryNotExist.partTwo")}
</Typography>
</Box>
</Typography>
<EmptyStateGovernanceActionsCategory
category={category}
isSearch={!!debouncedSearchText.length}
/>
) : (
<Box
columnGap="20px"
Expand Down
37 changes: 9 additions & 28 deletions govtool/frontend/src/pages/GovernanceActionsCategory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import { Box, CircularProgress, Link } from "@mui/material";
import { Background, Typography } from "@atoms";
import { GOVERNANCE_ACTIONS_SORTING, ICONS, PATHS } from "@consts";
import { useCardano } from "@context";
import { DataActionsBar, GovernanceActionCard } from "@molecules";
import {
DataActionsBar,
EmptyStateGovernanceActionsCategory,
GovernanceActionCard,
} from "@molecules";
import { Footer, TopNav } from "@organisms";
import {
useGetProposalsInfiniteQuery,
Expand Down Expand Up @@ -116,33 +120,10 @@ export const GovernanceActionsCategory = () => {
</Typography>
{!isProposalsLoading ? (
!mappedData?.length ? (
<Typography fontWeight={300} sx={{ py: 4 }}>
<Box mt={4} display="flex" flexWrap="wrap">
<Typography fontWeight={300}>
{t("govActions.withCategoryNotExist.partOne")}
&nbsp;
</Typography>
<Typography fontWeight={700}>
{category}
&nbsp;
</Typography>
{debouncedSearchText && (
<>
<Typography fontWeight={300}>
{t("govActions.withCategoryNotExist.optional")}
&nbsp;
</Typography>
<Typography fontWeight={700}>
{debouncedSearchText}
</Typography>
</>
)}
<Typography fontWeight={300}>
&nbsp;
{t("govActions.withCategoryNotExist.partTwo")}
</Typography>
</Box>
</Typography>
<EmptyStateGovernanceActionsCategory
category={category}
isSearch={!!debouncedSearchText.length}
/>
) : (
<Box
columnGap="20px"
Expand Down

0 comments on commit 1768276

Please sign in to comment.