Skip to content

Commit

Permalink
Merge pull request #2055 from IntersectMBO/develop
Browse files Browse the repository at this point in the history
GovTool 1.0.19-dev
  • Loading branch information
jdyczka authored Sep 19, 2024
2 parents d7c8e6b + 33bc7bf commit ede3438
Show file tree
Hide file tree
Showing 37 changed files with 5,649 additions and 919 deletions.
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,29 @@ changes.

-

## [sancho-v1.0.18](https://github.com/IntersectMBO/govtool/releases/tag/sancho-v1.0.18) 2024-09-12
## [v1.0.19](https://github.com/IntersectMBO/govtool/releases/tag/v1.0.19) 2024-09-19

### Added

-

### Fixed

- Fix private policy link and get support link
- Fixed poor UTxO management when building transactions [Issue 2059](https://github.com/IntersectMBO/govtool/issues/2059)

### Changed

- Bump cardano-db-sync 13.5.0.2 [Issue 1945](https://github.com/IntersectMBO/govtool/issues/1945)
- Add Mainnet link to network banner [Issue 2002](https://github.com/IntersectMBO/govtool/issues/2002)
- Bump CSL version to 12.1.0
- Add random sorting as default sorting for DRep list [Issue 2013](https://github.com/IntersectMBO/govtool/issues/2013)

### Removed

-

## [v1.0.18](https://github.com/IntersectMBO/govtool/releases/tag/v1.0.18) 2024-09-12

### Added

Expand All @@ -39,6 +61,7 @@ changes.
- Hide Delegate button in DRep list and details if user has already delegated to this DRep [Issue 1982](https://github.com/IntersectMBO/govtool/issues/1982)
- Fix condition for disabling voting on different GA types [Issue 2008](https://github.com/IntersectMBO/govtool/issues/2008)
- Fix incorrect copy (ex. github) to (e.g. github) [Issue 1748](https://github.com/IntersectMBO/govtool/issues/1748)
- Fix broken translation in DRep Details [Issue 2036](https://github.com/IntersectMBO/govtool/issues/2036)

### Changed

Expand Down
8 changes: 4 additions & 4 deletions docs/architecture/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Frontend is a React application using Vite as a built tool to enhance developmen
Direct voter uses following CSL services:
- TransactionBuilder - to build the transaction
- CertificatesBuilder - to build the delegation certificate
- DrepRegistration - to build the DRep registration certificate
- DRepRegistration - to build the DRep registration certificate

- **DRep** - DRep is a Decentralized Representative which has a metadata and can delegate ADA to other DReps. DRep registration and delegation are separate processes. DReps are visible in the DRep directory.

Expand All @@ -46,9 +46,9 @@ Frontend is a React application using Vite as a built tool to enhance developmen
DRep uses following CSL services:
- TransactionBuilder - to build the transaction
- CertificatesBuilder - to build the DRep registration certificate
- DrepRegistration - to build the DRep registration certificate
- DrepDeregistration - to build the DRep deregistration certificate
- DrepUpdate - to build the DRep update certificate
- DRepRegistration - to build the DRep registration certificate
- DRepDeregistration - to build the DRep deregistration certificate
- DRepUpdate - to build the DRep update certificate

**Note**

Expand Down
2 changes: 1 addition & 1 deletion govtool/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ FROM $BASE_IMAGE_REPO:$BASE_IMAGE_TAG
WORKDIR /src
COPY . .
RUN cabal build
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-1.0.18/x/vva-be/build/vva-be/vva-be /usr/local/bin
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-1.0.19/x/vva-be/build/vva-be/vva-be /usr/local/bin
2 changes: 1 addition & 1 deletion govtool/backend/Dockerfile.qovery
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM $BASE_IMAGE_REPO:$BASE_IMAGE_TAG
WORKDIR /src
COPY . .
RUN cabal build
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-1.0.18/x/vva-be/build/vva-be/vva-be /usr/local/bin
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-1.0.19/x/vva-be/build/vva-be/vva-be /usr/local/bin

# Expose the necessary port
EXPOSE 9876
Expand Down
4 changes: 4 additions & 0 deletions govtool/backend/src/VVA/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import Numeric.Natural (Natural)

import Servant.API
import Servant.Server
import System.Random (randomRIO)

import Text.Read (readMaybe)

Expand Down Expand Up @@ -151,8 +152,11 @@ drepList mSearchQuery statuses mSortMode mPage mPageSize = do
_ -> filter $ \Types.DRepRegistration {..} ->
mapDRepStatus dRepRegistrationStatus `elem` statuses

randomizedOrderList <- mapM (\_ -> randomRIO (0, 1 :: Double)) dreps

let sortDReps = case mSortMode of
Nothing -> id
Just Random -> fmap snd . sortOn fst . Prelude.zip randomizedOrderList
Just VotingPower -> sortOn $ \Types.DRepRegistration {..} ->
Down dRepRegistrationVotingPower
Just RegistrationDate -> sortOn $ \Types.DRepRegistration {..} ->
Expand Down
2 changes: 1 addition & 1 deletion govtool/backend/src/VVA/API/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ instance ToParamSchema GovernanceActionType where
& enum_ ?~ map toJSON (enumFromTo minBound maxBound :: [GovernanceActionType])


data DRepSortMode = VotingPower | RegistrationDate | Status deriving (Bounded, Enum, Eq, Generic, Read, Show)
data DRepSortMode = Random | VotingPower | RegistrationDate | Status deriving (Bounded, Enum, Eq, Generic, Read, Show)

instance FromJSON DRepSortMode where
parseJSON (Aeson.String dRepSortMode) = pure $ fromJust $ readMaybe (Text.unpack dRepSortMode)
Expand Down
3 changes: 2 additions & 1 deletion govtool/backend/vva-be.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.6
name: vva-be
version: 1.0.18
version: 1.0.19

-- A short (one-line) description of the package.
-- synopsis:
Expand Down Expand Up @@ -103,6 +103,7 @@ library
, http-client-tls
, vector
, async
, random

exposed-modules: VVA.Config
, VVA.CommandLine
Expand Down
31 changes: 31 additions & 0 deletions govtool/frontend/Dockerfile.qovey
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM node:18-alpine as builder

ARG VITE_APP_ENV='beta'
ARG VITE_BASE_URL
ARG VITE_METADATA_API_URL
ARG VITE_GTM_ID
ARG VITE_NETWORK_FLAG=0
ARG VITE_SENTRY_DSN
ARG NPMRC_TOKEN
ARG VITE_USERSNAP_SPACE_API_KEY
ARG VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED='true'
ARG VITE_PDF_API_URL

ENV NODE_OPTIONS=--max_old_space_size=8192

WORKDIR /src

# Set npm configuration settings using environment variables
RUN npm config set @intersect.mbo:registry "https://registry.npmjs.org/" --location=global
RUN npm config set //registry.npmjs.org/:_authToken ${NPMRC_TOKEN} --location=global

COPY package.json package-lock.json ./
RUN npm install
COPY . .
RUN npm run build

FROM nginx:stable-alpine
EXPOSE 80
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /src/maintenance-page/index.html /usr/share/nginx/html/maintenance.html
COPY --from=builder /src/dist /usr/share/nginx/html
13 changes: 6 additions & 7 deletions govtool/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions govtool/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@govtool/frontend",
"private": true,
"version": "1.0.18",
"version": "1.0.19",
"type": "module",
"scripts": {
"build": "vite build",
Expand All @@ -25,7 +25,7 @@
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@emurgo/cardano-serialization-lib-asmjs": "12.0.0-beta.2",
"@emurgo/cardano-serialization-lib-asmjs": "^12.1.0",
"@hookform/resolvers": "^3.3.1",
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
"@intersect.mbo/pdf-ui": "^0.3.9",
Expand Down Expand Up @@ -109,5 +109,5 @@
"typescript": "^5.0.2"
},
"readme": "ERROR: No README data found!",
"_id": "[email protected].18"
"_id": "[email protected].19"
}
4 changes: 1 addition & 3 deletions govtool/frontend/src/components/molecules/DataActionsBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ type DataActionsBarProps = {
setFiltersOpen?: Dispatch<SetStateAction<boolean>>;
setSearchText: Dispatch<SetStateAction<string>>;
setSortOpen: Dispatch<SetStateAction<boolean>>;
sortingActive: boolean;
sortOpen: boolean;
sortOptions?: {
key: string;
Expand All @@ -50,7 +49,6 @@ export const DataActionsBar: FC<DataActionsBarProps> = ({ ...props }) => {
setFiltersOpen,
setSearchText,
setSortOpen,
sortingActive,
sortOpen,
sortOptions = [],
} = props;
Expand Down Expand Up @@ -94,8 +92,8 @@ export const DataActionsBar: FC<DataActionsBarProps> = ({ ...props }) => {
filtersOpen={filtersOpen}
isFiltering={isFiltering}
setFiltersOpen={setFiltersOpen}
chosenSorting={chosenSorting}
setSortOpen={setSortOpen}
sortingActive={sortingActive}
sortOpen={sortOpen}
>
{filtersOpen && (
Expand Down
27 changes: 4 additions & 23 deletions govtool/frontend/src/components/molecules/OrderActionsChip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ type Props = {
filtersOpen?: boolean;
setFiltersOpen?: Dispatch<SetStateAction<boolean>>;
chosenFiltersLength?: number;
chosenSorting: string;
sortOpen: boolean;
setSortOpen: Dispatch<SetStateAction<boolean>>;
sortingActive: boolean;
children?: React.ReactNode;
isFiltering?: boolean;
};
Expand All @@ -29,9 +29,9 @@ export const OrderActionsChip = (props: Props) => {
filtersOpen,
setFiltersOpen = () => {},
chosenFiltersLength = 0,
chosenSorting,
sortOpen,
setSortOpen,
sortingActive,
isFiltering = true,
children,
} = props;
Expand Down Expand Up @@ -163,31 +163,12 @@ export const OrderActionsChip = (props: Props) => {
sx={{
color: sortOpen ? "white" : "primaryBlue",
fontWeight: 500,
whiteSpace: "nowrap",
}}
>
{t("sort")}
{chosenSorting ? `${t("sortBy")}: ${chosenSorting}` : t("sort")}
</Typography>
)}
{!sortOpen && sortingActive && (
<Box
sx={{
alignItems: "center",
background: secondary.main,
borderRadius: "100%",
color: "white",
display: "flex",
fontSize: "12px",
height: "16px",
justifyContent: "center",
position: "absolute",
right: "-3px",
top: "0",
width: "16px",
}}
>
<img alt="sorting active" src={ICONS.sortActiveIcon} />
</Box>
)}
</Box>
{children}
</Box>
Expand Down
1 change: 1 addition & 0 deletions govtool/frontend/src/components/organisms/DRepCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export const DRepCard = ({
sx={{
gap: 1,
width: "250px",
maxWidth: "100%",
"&:hover": {
opacity: 0.6,
transition: "opacity 0.3s",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useNavigate } from "react-router-dom";
import { Trans } from "react-i18next";
import { Box, Chip } from "@mui/material";

import { Button } from "@atoms";
Expand Down Expand Up @@ -58,13 +59,18 @@ export const DRepDetailsCardHeader = ({
<Chip
color="primary"
label={
isMe
? isMyDrep
? t("dRepDirectory.myDelegationToYourself")
: t("dRepDirectory.meAsDRep")
: t("dRepDirectory.myDRep", {
ada: correctDRepDirectoryFormat(myVotingPower),
})
<Trans
i18nKey={
isMe
? isMyDrep
? "dRepDirectory.myDelegationToYourself"
: "dRepDirectory.meAsDRep"
: "dRepDirectory.myDRep"
}
values={{
ada: correctDRepDirectoryFormat(myVotingPower),
}}
/>
}
sx={{
boxShadow: (theme) => theme.shadows[2],
Expand Down
2 changes: 1 addition & 1 deletion govtool/frontend/src/components/organisms/DrawerMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const DrawerMobile = ({
const { t } = useTranslation();

const onClickHelp = () =>
openInNewTab("https://docs.gov.tools/support/get-help-in-discord");
openInNewTab("https://docs.gov.tools/support/");

return (
<SwipeableDrawer
Expand Down
4 changes: 2 additions & 2 deletions govtool/frontend/src/components/organisms/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ export const Footer = () => {
const { openFeedbackWindow } = useUsersnapApi();

const onClickHelp = () =>
openInNewTab("https://docs.gov.tools/support/get-help-in-discord");
openInNewTab("https://docs.gov.tools/support");

const onClickPrivacyPolicy = () =>
openInNewTab("https://docs.gov.tools/legal/privacy-policy");
openInNewTab("https://docs.intersectmbo.org/legal/policies-and-conditions/privacy-policy");

const onClickTermOfService = () =>
openInNewTab("https://docs.intersectmbo.org/legal/policies-and-conditions/terms-of-use");
Expand Down
Loading

0 comments on commit ede3438

Please sign in to comment.