diff --git a/.github/workflows/build-and-deploy-beta.yml b/.github/workflows/build-and-deploy-beta.yml index 6118aa0f1..f4cba16ee 100644 --- a/.github/workflows/build-and-deploy-beta.yml +++ b/.github/workflows/build-and-deploy-beta.yml @@ -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" @@ -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 diff --git a/.github/workflows/build-and-deploy-dev.yml b/.github/workflows/build-and-deploy-dev.yml index fc4508207..b620989ca 100644 --- a/.github/workflows/build-and-deploy-dev.yml +++ b/.github/workflows/build-and-deploy-dev.yml @@ -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 diff --git a/.github/workflows/build-and-deploy-staging.yml b/.github/workflows/build-and-deploy-staging.yml index 8c46e0d9d..54fb51634 100644 --- a/.github/workflows/build-and-deploy-staging.yml +++ b/.github/workflows/build-and-deploy-staging.yml @@ -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" @@ -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 diff --git a/.github/workflows/build-and-deploy-test.yml b/.github/workflows/build-and-deploy-test.yml index 9b94bc6dc..a254023df 100644 --- a/.github/workflows/build-and-deploy-test.yml +++ b/.github/workflows/build-and-deploy-test.yml @@ -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" @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 94d503c25..c555e2791 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` @@ -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 @@ -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) @@ -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 diff --git a/govtool/backend/src/VVA/API.hs b/govtool/backend/src/VVA/API.hs index 6072be08f..293e0c2bd 100644 --- a/govtool/backend/src/VVA/API.hs +++ b/govtool/backend/src/VVA/API.hs @@ -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 diff --git a/govtool/frontend/src/components/molecules/EmptyStateGovernanceActionsCategory.tsx b/govtool/frontend/src/components/molecules/EmptyStateGovernanceActionsCategory.tsx new file mode 100644 index 000000000..5ed979ac8 --- /dev/null +++ b/govtool/frontend/src/components/molecules/EmptyStateGovernanceActionsCategory.tsx @@ -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 ( + + {isSearch ? ( + t("govActions.noResultsForTheSearch") + ) : ( + <> + {t("govActions.withCategoryNotExist.partOne")} +   + + {getProposalTypeLabel(category ?? "")} + +   + {t("govActions.withCategoryNotExist.partTwo")} + + )} + + ); +}; diff --git a/govtool/frontend/src/components/molecules/index.ts b/govtool/frontend/src/components/molecules/index.ts index 419010f63..dad2697b0 100644 --- a/govtool/frontend/src/components/molecules/index.ts +++ b/govtool/frontend/src/components/molecules/index.ts @@ -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"; diff --git a/govtool/frontend/src/components/molecules/types.ts b/govtool/frontend/src/components/molecules/types.ts index 88f349091..f67f05ba1 100644 --- a/govtool/frontend/src/components/molecules/types.ts +++ b/govtool/frontend/src/components/molecules/types.ts @@ -21,3 +21,8 @@ export type SoleVoterActionProps = { onClickArrow: () => void; sx?: SxProps; }; + +export type EmptyStateGovernanceActionsCategoryProps = { + category?: string; + isSearch?: boolean; +}; diff --git a/govtool/frontend/src/pages/DashboardGovernanceActionsCategory.tsx b/govtool/frontend/src/pages/DashboardGovernanceActionsCategory.tsx index 77cdebdb2..5c8ab4318 100644 --- a/govtool/frontend/src/pages/DashboardGovernanceActionsCategory.tsx +++ b/govtool/frontend/src/pages/DashboardGovernanceActionsCategory.tsx @@ -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, @@ -109,30 +113,10 @@ export const DashboardGovernanceActionsCategory = () => { ) : !mappedData?.length ? ( - - - - {t("govActions.withCategoryNotExist.partOne")} -   - - - {` ${category} `} - - -   - {t("govActions.withCategoryNotExist.partTwo")} - - - + ) : ( { {!isProposalsLoading ? ( !mappedData?.length ? ( - - - - {t("govActions.withCategoryNotExist.partOne")} -   - - - {category} -   - - {debouncedSearchText && ( - <> - - {t("govActions.withCategoryNotExist.optional")} -   - - - {debouncedSearchText} - - - )} - -   - {t("govActions.withCategoryNotExist.partTwo")} - - - + ) : (