-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚓ Integrate set era payout damping factor proposal (#4818)
* Fix InputNumber maxAllowedValue * Create set era payout damping factor proposals * Preview set era payout damping factor proposals * Fix typo * Query `SetEraPayoutDampingFactorProposalDetails` * Use the proper percentageMapper to preview the proposal * Compare with current multiplier value * Describe the proposal * Validate that the multiplier is at most 100% * Make the NumberOfBlocks renderer reusable * Preview CRT constraints proposal * Create CRT constraints proposal * Query `UpdateTokenPalletTokenConstraintsProposalDetails` * Schema and types * Show current values in the form * Show current values on the preview page * Fix the vote on proposal modal * Fix mismatched values * Show current values on field inputs sub label instead of message So the current values remain visible while input values are invalid * Enable decimal values in `InputNumber` * Use decimal percent to represent part per million * Preview decimal percents * Generate queries * Patch `@joystream/types` * Fix type issue
- Loading branch information
Showing
28 changed files
with
9,515 additions
and
3,762 deletions.
There are no files selected for viewing
13,075 changes: 9,329 additions & 3,746 deletions
13,075
.yarn/patches/@joystream-types-npm-4.3.0-542438a0b6.patch
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/ui/src/common/api/queries/__generated__/baseTypes.generated.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/ui/src/council/queries/__generated__/council.generated.tsx
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...oposals/modals/AddNewProposal/components/SpecificParameters/SetEraPayoutDampingFactor.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react' | ||
|
||
import { useApi } from '@/api/hooks/useApi' | ||
import { InputComponent, InputNumber } from '@/common/components/forms' | ||
import { Row } from '@/common/components/Modal' | ||
import { RowGapBlock } from '@/common/components/page/PageContent' | ||
import { TextMedium } from '@/common/components/typography' | ||
import { useFirstObservableValue } from '@/common/hooks/useFirstObservableValue' | ||
|
||
export const SetEraPayoutDampingFactor = () => { | ||
const { api } = useApi() | ||
const current = useFirstObservableValue(() => api?.query.council.eraPayoutDampingFactor(), [api?.isConnected]) | ||
|
||
return ( | ||
<RowGapBlock gap={24}> | ||
<Row> | ||
<RowGapBlock gap={8}> | ||
<h4>Specific parameters</h4> | ||
<TextMedium lighter> | ||
Set the validator reward multiplier. {current && `The current value is ${current.toNumber()}%`}. | ||
</TextMedium> | ||
</RowGapBlock> | ||
</Row> | ||
<Row> | ||
<RowGapBlock gap={20}> | ||
<InputComponent | ||
message={'Amount must be greater than zero'} | ||
id="damping-factor-input" | ||
name="setEraPayoutDampingFactor.dampingFactor" | ||
label="Validator reward multiplier" | ||
tight | ||
units="%" | ||
required | ||
> | ||
<InputNumber id="damping-factor-input" name="setEraPayoutDampingFactor.dampingFactor" placeholder="100" /> | ||
</InputComponent> | ||
</RowGapBlock> | ||
</Row> | ||
</RowGapBlock> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.