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

[#119] Add registration as a sole voter #308

Merged

Conversation

JanJaroszczak
Copy link
Contributor

@JanJaroszczak JanJaroszczak commented Feb 26, 2024

List of changes

  • Add registration as a sole voter
  • Add retirement as a sole voter

That will close

#119
#141
#143
#144
#121
#198
#210
#212
#214

Checklist

  • related issue
  • My changes generate no new warnings
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the changelog
  • I have added tests that prove my fix is effective or that my feature works

@JanJaroszczak JanJaroszczak linked an issue Feb 26, 2024 that may be closed by this pull request
Copy link
Contributor

@MSzalowski MSzalowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

CHANGELOG.md Outdated
@@ -9,11 +9,14 @@ As a minor extension, we also keep a semantic version for the `UNRELEASED`
changes.

## [Unreleased]
- Add retire as Sole Voter screen [Issue 198](https://github.com/IntersectMBO/govtool/issues/198)
- Add Sole Voter card [Issue 141](https://github.com/IntersectMBO/govtool/issues/141)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can move all the unreleased changes to the proper section.

@MSzalowski MSzalowski force-pushed the feat/119-i-want-to-vote-on-behalf-of-myself-become-a-drep branch from 9aacf83 to 2119010 Compare February 26, 2024 18:01
@MSzalowski MSzalowski marked this pull request as draft February 26, 2024 18:01
@MSzalowski
Copy link
Contributor

Changed to DRAFT as I've resolved conflicts to develop, but I need to dive deeper if they are resolved correctly and anything important is not omitted.

@MSzalowski MSzalowski changed the title Feat/119 i want to vote on behalf of myself become a drep [#119] Add registration as a sole voter Feb 27, 2024
@MSzalowski MSzalowski marked this pull request as ready for review February 27, 2024 08:02
@MSzalowski
Copy link
Contributor

@JanJaroszczak Please have a look if after rebase to develop nothing has been lost

color="primary"
sx={{
fontWeight: 400,
paddingTop: "1px",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why padding top 1px ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -116,7 +112,7 @@ export const DashboardActionCard: FC<DashboardActionCardProps> = ({
) : null}
{inProgress && !isLoading ? (
<Typography variant="title2" fontWeight={700}>
in progress
In Progress
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use t()

@@ -142,7 +142,7 @@ export const VoteActionForm = ({
/>
</Box>
</Box>
{dRep?.isRegistered && (
{voter?.isRegisteredAsDRep && (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

|| sole voter

@@ -134,7 +134,7 @@ export const DashboardGovernanceActionDetails = () => {
? formatDisplayDate(state.expiryDate)
: formatDisplayDate(data.proposal.expiryDate)
}
isDRep={dRep?.isRegistered}
isDRep={voter?.isRegisteredAsDRep}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

|| sole voter

@@ -121,7 +121,7 @@ export const DashboardGovernanceActions = () => {
sortingActive={Boolean(chosenSorting)}
sortOpen={sortOpen}
/>
{dRep?.isRegistered && (
{voter?.isRegisteredAsDRep && (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

|| sole voter

@@ -47,6 +49,7 @@ export const DashboardTopNav = ({
zIndex={100}
flex={1}
width={"fill-available"}
height={"48px"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 48 ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We needed to implement isVotingPowerHidden and when turning this on the navbar height was changing unnecessarily. With height added, the navbar height stays the same.

@@ -215,7 +215,7 @@ export const DelegateTodRepStepOne = ({ setStep }: DelegateProps) => {
flexDirection={"column"}
rowGap={3}
>
{dRep?.isRegistered && currentDelegation !== dRepID && (
{voter?.isRegisteredAsDRep && currentDelegation !== dRepID && (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

|| sole voter

const { t } = useTranslation();

useEffect(() => {
if (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it can be helper checkIsWalletConnected

Extend the drep/info endpoint by adding isRegisteredAsSoleVoter and wasRegisteredAsSoleVoter fields
@MSzalowski MSzalowski merged commit a9de520 into develop Feb 27, 2024
@MSzalowski MSzalowski deleted the feat/119-i-want-to-vote-on-behalf-of-myself-become-a-drep branch February 27, 2024 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Become a Sole Voter
4 participants