Skip to content

Commit 8f96827

Browse files
authored
Merge pull request #2646 from IntersectMBO/test
GovTool - v2.0.6
2 parents 418aaae + 1996c0f commit 8f96827

File tree

22 files changed

+6054
-714
lines changed

22 files changed

+6054
-714
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,27 @@ changes.
2626

2727
-
2828

29+
## [v2.0.6](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.6) 2025-01-16
30+
31+
### Added
32+
33+
- Add support for base64 encoded images [Issue 2633](https://github.com/IntersectMBO/govtool/issues/2633)
34+
- Add searching for metadata [Issue 2634](https://github.com/IntersectMBO/govtool/issues/2634)
35+
- Allow delegation to inactive DRep [Issue 2589](https://github.com/IntersectMBO/govtool/issues/2589)
36+
37+
### Fixed
38+
39+
- Fix searching by full DRep IDs on wrong prefix cut [Issue 2639](https://github.com/IntersectMBO/govtool/issues/2639)
40+
- Trim whitespace from search bar input [Issue 2472](https://github.com/IntersectMBO/govtool/issues/2472)
41+
42+
### Changed
43+
44+
-
45+
46+
### Removed
47+
48+
-
49+
2950
## [v2.0.5](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.5) 2025-01-10
3051

3152
### Added

govtool/backend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ FROM $BASE_IMAGE_REPO:$BASE_IMAGE_TAG
44
WORKDIR /src
55
COPY . .
66
RUN cabal build
7-
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.5/x/vva-be/build/vva-be/vva-be /usr/local/bin
7+
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.6/x/vva-be/build/vva-be/vva-be /usr/local/bin

govtool/backend/Dockerfile.qovery

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM $BASE_IMAGE_REPO:$BASE_IMAGE_TAG
44
WORKDIR /src
55
COPY . .
66
RUN cabal build
7-
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.5/x/vva-be/build/vva-be/vva-be /usr/local/bin
7+
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.6/x/vva-be/build/vva-be/vva-be /usr/local/bin
88

99
# Expose the necessary port
1010
EXPOSE 9876

govtool/backend/sql/list-dreps.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,11 @@ WHERE
167167
COALESCE(?, '') = '' OR
168168
(CASE WHEN LENGTH(?) % 2 = 0 AND ? ~ '^[0-9a-fA-F]+$' THEN dh.raw = decode(?, 'hex') ELSE false END) OR
169169
dh.view ILIKE ? OR
170-
off_chain_vote_drep_data.given_name ILIKE ?
170+
off_chain_vote_drep_data.given_name ILIKE ? OR
171+
off_chain_vote_drep_data.payment_address ILIKE ? OR
172+
off_chain_vote_drep_data.objectives ILIKE ? OR
173+
off_chain_vote_drep_data.motivations ILIKE ? OR
174+
off_chain_vote_drep_data.qualifications ILIKE ?
171175
)
172176
GROUP BY
173177
block_first_register.epoch_no,

govtool/backend/src/VVA/API.hs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,17 @@ drepList mSearchQuery statuses mSortMode mPage mPageSize = do
144144

145145
let filterDRepsByQuery = case mSearchQuery of
146146
Nothing -> filter $ \Types.DRepRegistration {..} ->
147-
dRepRegistrationType == Types.DRep
147+
dRepRegistrationType /= Types.SoleVoter
148148
Just query -> filter $ \Types.DRepRegistration {..} ->
149149
let searchLower = Text.toLower query
150150
viewLower = Text.toLower dRepRegistrationView
151151
hashLower = Text.toLower dRepRegistrationDRepHash
152-
nameLower = maybe "" Text.toLower dRepRegistrationGivenName
153-
in case dRepRegistrationType of
154-
Types.SoleVoter -> searchLower == viewLower || searchLower == hashLower
155-
Types.DRep -> searchLower `isInfixOf` viewLower
156-
|| searchLower `isInfixOf` hashLower
157-
|| searchLower `isInfixOf` nameLower
152+
in case dRepRegistrationType of
153+
Types.SoleVoter ->
154+
searchLower == viewLower || searchLower == hashLower
155+
Types.DRep ->
156+
True
157+
158158

159159
let filterDRepsByStatus = case statuses of
160160
[] -> id
@@ -187,7 +187,6 @@ drepList mSearchQuery statuses mSortMode mPage mPageSize = do
187187
total = length allValidDReps :: Int
188188

189189
let elements = take pageSize $ drop (page * pageSize) allValidDReps
190-
191190
return $ ListDRepsResponse
192191
{ listDRepsResponsePage = fromIntegral page
193192
, listDRepsResponsePageSize = fromIntegral pageSize

govtool/backend/src/VVA/DRep.hs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,18 @@ listDReps ::
4444
listDReps mSearchQuery = withPool $ \conn -> do
4545
let searchParam = fromMaybe "" mSearchQuery
4646
results <- liftIO $ SQL.query conn listDRepsSql
47-
( searchParam
48-
, searchParam
49-
, searchParam
50-
, searchParam
51-
, "%" <> searchParam <> "%"
52-
, "%" <> searchParam <> "%"
47+
( searchParam -- COALESCE(?, '')
48+
, searchParam -- LENGTH(?)
49+
, searchParam -- AND ?
50+
, searchParam -- decode(?, 'hex')
51+
, "%" <> searchParam <> "%" -- dh.view
52+
, "%" <> searchParam <> "%" -- given_name
53+
, "%" <> searchParam <> "%" -- payment_address
54+
, "%" <> searchParam <> "%" -- objectives
55+
, "%" <> searchParam <> "%" -- motivations
56+
, "%" <> searchParam <> "%" -- qualifications
5357
)
58+
5459
timeZone <- liftIO getCurrentTimeZone
5560
return
5661
[ DRepRegistration drepHash drepView isScriptBased url dataHash (floor @Scientific deposit) votingPower status drepType txHash (localTimeToUTC timeZone date) metadataError paymentAddress givenName objectives motivations qualifications imageUrl imageHash

govtool/backend/src/VVA/Types.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ data DRepInfo
9595
, dRepInfoImageHash :: Maybe Text
9696
}
9797

98-
data DRepStatus = Active | Inactive | Retired deriving (Eq, Ord)
98+
data DRepStatus = Active | Inactive | Retired deriving (Show, Eq, Ord)
9999

100-
data DRepType = DRep | SoleVoter deriving (Eq)
100+
data DRepType = DRep | SoleVoter deriving (Show, Eq)
101101

102102
data DRepRegistration
103103
= DRepRegistration
@@ -121,6 +121,7 @@ data DRepRegistration
121121
, dRepRegistrationImageUrl :: Maybe Text
122122
, dRepRegistrationImageHash :: Maybe Text
123123
}
124+
deriving (Show)
124125

125126
data Proposal
126127
= Proposal

govtool/backend/vva-be.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 3.6
22
name: vva-be
3-
version: 2.0.5
3+
version: 2.0.6
44

55
-- A short (one-line) description of the package.
66
-- synopsis:

govtool/frontend/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

govtool/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@govtool/frontend",
33
"private": true,
4-
"version": "2.0.5",
4+
"version": "2.0.6",
55
"type": "module",
66
"scripts": {
77
"build": "vite build",

0 commit comments

Comments
 (0)