Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GovTool 1.0.19-dev #2055

Merged
merged 30 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4be996e
chore: add generate exact length text utils
kneerose Sep 9, 2024
c826179
fix: invalid proposal character issue by specifing the max character
kneerose Sep 9, 2024
47f34bb
fix: test 2F due to multiple dRep card of delegated dRep
kneerose Sep 10, 2024
f942287
fix: incorrect test id assertion in test 2A and add card assertion
kneerose Sep 10, 2024
2922c0f
add new dockerfile
mpavlovicbb Aug 21, 2024
253bc25
Merge pull request #2034 from IntersectMBO/chore/add-missing-commit-t…
Ryun1 Sep 13, 2024
9b143a3
update private policy link to use Intersect one
Ryun1 Sep 13, 2024
fcfd43f
update support link
Ryun1 Sep 13, 2024
d2cf491
update changelog
Ryun1 Sep 13, 2024
f2b3217
[#2036] fix broken translation in DRep Details
j-dyczka Sep 13, 2024
6bf3390
Merge pull request #2041 from IntersectMBO/fix-some-links
Ryun1 Sep 13, 2024
d0b2bd1
Bump Cardano DB Sync to 13.5.0.2
placek Sep 16, 2024
3bbe1ef
Merge pull request #2048 from IntersectMBO/chore/1945-bump-dbsync-ver…
placek Sep 16, 2024
3bd4ee7
Merge pull request #2043 from IntersectMBO/hotfix/2036-broken-transla…
jdyczka Sep 17, 2024
5797e70
[#2002] add Mainnet link to network banner
j-dyczka Sep 16, 2024
7553b7d
Merge pull request #2049 from IntersectMBO/feat/2002-improve-network-…
jdyczka Sep 17, 2024
adf6289
Merge pull request #1993 from IntersectMBO/bugfix/delegation-test
kneerose Sep 18, 2024
70b9719
Merge pull request #1992 from IntersectMBO/bugfix/proposal-character-…
kneerose Sep 18, 2024
26400b3
[#2013] prepare FE for randomized DRep list
j-dyczka Sep 18, 2024
ececac0
chore: bump to csl 12.1.0
Ryun1 Sep 19, 2024
3ed0842
remove explicit transaction outputs
Ryun1 Sep 19, 2024
50e5b7a
update changelog
Ryun1 Sep 19, 2024
0dab8a9
chore: bump frontend to use CSL 12.1.0
Ryun1 Sep 19, 2024
e575b07
[#2013] randomize DRep list
j-dyczka Sep 18, 2024
4ef0d08
Merge pull request #2064 from IntersectMBO/feat/2013-randomize-drep-list
jdyczka Sep 19, 2024
ecdfd24
Merge pull request #2063 from IntersectMBO/2059-fix-poor-utxo-management
Ryun1 Sep 19, 2024
15a0fa9
Merge pull request #2061 from IntersectMBO/bump-csl-version
Ryun1 Sep 19, 2024
28379ca
chore: bump GovTool version to v1.0.19
j-dyczka Sep 19, 2024
33227d1
fix csl errors
j-dyczka Sep 19, 2024
33bc7bf
Merge pull request #2065 from IntersectMBO/chore/bump-govtool-to-v1.0.19
jdyczka Sep 19, 2024
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
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"
}
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
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
Loading