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

Proposal discussion fixes #3969

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@joystream/pioneer",
"version": "0.1.0",
"version": "0.1.1",
"license": "GPL-3.0-only",
"scripts": {
"build": "node --max_old_space_size=4096 ./build.js",
Expand Down
2 changes: 0 additions & 2 deletions packages/ui/src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Redirect, Route, Switch } from 'react-router-dom'

import '@/services/i18n'

import { FMBanner } from '@/app/components/FMBanner'
import { ImageReportNotification } from '@/app/components/ImageReportNotification'
import { OnBoardingOverlay } from '@/app/components/OnboardingOverlay/OnBoardingOverlay'
import { CouncilModule } from '@/app/pages/Council/CouncilModule'
Expand Down Expand Up @@ -78,7 +77,6 @@ export const App = () => {
<ExtensionNotification />
<ImageReportNotification />
</NotificationsHolder>
<FMBanner />
</Providers>
)
}
Expand Down
138 changes: 0 additions & 138 deletions packages/ui/src/app/components/FMBanner.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion packages/ui/src/app/constants/currency.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const CurrencyName = {
integerValue: 'tJOY',
integerValue: 'JOY',
} as const
14 changes: 8 additions & 6 deletions packages/ui/src/app/pages/Proposals/ProposalPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { PageTitle } from '@/common/components/page/PageTitle'
import { PreviousPage } from '@/common/components/page/PreviousPage'
import { SidePanel } from '@/common/components/page/SidePanel'
import { Label, TextInlineMedium, TextMedium } from '@/common/components/typography'
import { TokenValue } from '@/common/components/typography/TokenValue'
import { camelCaseToText } from '@/common/helpers'
import { useModal } from '@/common/hooks/useModal'
import { useRefetchQueries } from '@/common/hooks/useRefetchQueries'
Expand All @@ -40,20 +41,19 @@ import { VoteRationaleModalCall } from '@/proposals/modals/VoteRationale/types'
import { proposalPastStatuses } from '@/proposals/model/proposalStatus'

export const ProposalPreview = () => {
const { id } = useParams<{ id: string }>()
const history = useHistory()
const { id } = useParams<{ id: string }>()
const { isLoading, proposal } = useProposal(id)
const { council } = useElectedCouncil()
const constants = useProposalConstants(proposal?.details.type)
const loc = useLocation()
const voteId = new URLSearchParams(loc.search).get('showVote')
const blocksToProposalExecution = useBlocksToProposalExecution(proposal, constants)
useRefetchQueries({ interval: MILLISECONDS_PER_BLOCK, include: ['getProposal', 'GetProposalVotes'] }, [proposal])

const { council } = useElectedCouncil()
const loc = useLocation()
const voteId = new URLSearchParams(loc.search).get('showVote')
const votingRounds = useVotingRounds(proposal?.votes, proposal?.proposalStatusUpdates)
const [currentVotingRound, setVotingRound] = useState(0)

const votes = votingRounds[currentVotingRound] ?? votingRounds[0]
useRefetchQueries({ interval: MILLISECONDS_PER_BLOCK, include: ['getProposal', 'GetProposalVotes'] }, [proposal])
traumschule marked this conversation as resolved.
Show resolved Hide resolved
const notVoted = useMemo(() => {
if (
!proposal ||
Expand Down Expand Up @@ -195,6 +195,8 @@ export const ProposalPreview = () => {
<RowGapBlock gap={16}>
<Label>Proposer</Label>
<MemberInfo member={proposal.proposer} />
<Label>Stake</Label>
{constants ? <TokenValue value={constants.requiredStake} /> : 'Loading...'}
</RowGapBlock>
traumschule marked this conversation as resolved.
Show resolved Hide resolved
</RowGapBlock>
</SidePanel>
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/src/common/utils/validation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { AnyObjectSchema, ValidationError } from 'yup'
import Reference from 'yup/lib/Reference'
import { AnyObject } from 'yup/lib/types'

import { CurrencyName } from '@/app/constants/currency'
import { Loading } from '@/common/components/Loading'
import { formatJoyValue } from '@/common/model/formatters'

Expand Down Expand Up @@ -152,7 +153,7 @@ export const validStakingAmount = (): Yup.TestConfig<any, AnyObject> => ({
const minStake: BN | undefined = this.options.context?.minStake
if (minStake && minStake.gt(stake)) {
return this.createError({
message: 'Minimal stake amount is ${min} tJOY',
message: 'Minimal stake amount is ${min} ' + CurrencyName.integerValue,
params: { min: formatJoyValue(minStake) },
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const PostInsufficientFundsModal = ({
requiredAmount,
postDeposit,
}: PostInsufficientFundsModalProps) => {
const { t } = useTranslation()
const { t } = useTranslation('accounts')
const { hideModal } = useModal()
const { active } = useMyMemberships()
return (
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/proposals/components/ProposalDiscussions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface Props {
}

const hints = {
open: 'This is an unmoderated discussioon, everyone can comment.',
open: 'This is an open discussion, everyone can comment.',
traumschule marked this conversation as resolved.
Show resolved Hide resolved
closed: 'This discussion is closed. Only selected members and the council can comment.',
}

Expand Down Expand Up @@ -93,7 +93,7 @@ export const ProposalDiscussions = ({ thread, proposalId }: Props) => {
</Tooltip>
</Badge>
</DiscussionsHeader>
{discussionPosts.sort(Comparator<ForumPost>(true, 'createdAtBlock').string).map((post, index) => {
{discussionPosts.sort(Comparator<ForumPost>(false, 'createdAt').string).map((post, index) => {
return (
<PostListItem
isFirstItem={index === 0}
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/proposals/components/ProposalHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ export const ProposalHistory = ({ proposal }: ProposalHistoryProps) => {
const steps = [createdStatus, ...updates, ...(endStatus || [])]

return steps.map(({ status, inBlock }, index) => ({
title: status,
title: `${status} in block ${inBlock.number}`,
type: index === steps.length - 1 ? 'active' : 'past',
traumschule marked this conversation as resolved.
Show resolved Hide resolved
details: <BlockHistoryLine block={inBlock} />,
}))
}, [proposal.id])

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/services/i18n/dict/en/accounts.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"feeInfo1": "Unfortunately, you don't have enough Tokens on your Controller account. You need at least ",
"feeInfo2": " for the transaction fee",
"transferable": "Transferable balance",
"addJoy": "Add tJOY to Controller Account"
"addJoy": "Add JOY to Controller Account"
}
}
}
14 changes: 7 additions & 7 deletions packages/ui/src/services/i18n/dict/en/bounty.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"label": "Fee sending from account",
"tooltip": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
},
"feeInfo": "Fees of {{value}} tJOY will be applied to the transaction"
"feeInfo": "Fees of {{value}} JOY will be applied to the transaction"
},
"contribute": {
"title": "Contribute",
Expand All @@ -35,8 +35,8 @@
"tooltip": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
},
"selectAmount": "Select amount for contributing",
"selectAmountSubtitle": "You must contribute at least {{value}} tJOY.",
"authorizeDescription": "You contribute {{value}} tJOY",
"selectAmountSubtitle": "You must contribute at least {{value}} JOY.",
"authorizeDescription": "You contribute {{value}} JOY",
"error": "Something went wrong",
"success": "You have just successfully contribute {{bounty}}”.",
"successButton": "Back to bounty"
Expand All @@ -60,7 +60,7 @@
"selectAmount": "Entrant stake",
"selectAmountSubtitle": "Entrant stake is returned to your account automatically, when bounty is finished.",
"selectAmountTooltip": "Minimum entrant stake is defined by the bounty creator.",
"authorizeDescription": "You intend to Apply for a bounty. You intend to stake {{value}} tJOY.",
"authorizeDescription": "You intend to Apply for a bounty. You intend to stake {{value}} JOY.",
"error": "Something went wrong",
"success": "You have just successfully announce work entry for ”{{bounty}}”.",
"successButton": "Back to bounty"
Expand All @@ -83,7 +83,7 @@
"title": "Authorize transaction",
"informationBox": {
"info1": "You are canceling your bounty",
"info2": "Fees of {{fee}} tJOY will be applied to the transaction."
"info2": "Fees of {{fee}} JOY will be applied to the transaction."
},
"accountInput": {
"label": "Fee sending from account",
Expand Down Expand Up @@ -123,11 +123,11 @@
"error": "There was a problem submitting your work."
},
"withdraw": {
"extraDescription": "Cherry of {{amount}} tJOY is added to your original contribution.",
"extraDescription": "Cherry of {{amount}} JOY is added to your original contribution.",
"extraTooltipInformation": "This bounty was created with a cherry, which gets split among all contributors equally in the case when bounty fails",
"contribution": {
"title": "Withdraw Contribution",
"description": "You intend to withdraw {{value}} tJOY from stake lock and cherry from account.",
"description": "You intend to withdraw {{value}} JOY from stake lock and cherry from account.",
"button": "Withdraw Contribution",
"stakingFrom": "Staking from bounty",
"amountTitle": "Contribution amount"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/services/i18n/dict/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"opening": {
"duration": "Duration: {{time}}",
"past": "Past Opening",
"reward": "<0>Reward per 3600 blocks</0><1>{{value}}</1><2>tJOY</2>",
"reward": "<0>Reward per 3600 blocks</0><1>{{value}}</1><2>JOY</2>",
"applications": "<0>Applications</0><1>{{current}}</1>",
"hired": "<0>Hired</0><1>{{current}}</1><2>/ {{limit}}</2>"
},
Expand Down
16 changes: 8 additions & 8 deletions packages/ui/src/services/i18n/dict/ru/bounty.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"label": "Комиссия за перевод со счета",
"tooltip": "Перевод со счета облагается комиссией."
},
"feeInfo": "Транзакция облагается комиссией в размере {{value}} tJOY"
"feeInfo": "Транзакция облагается комиссией в размере {{value}} JOY"
},
"contribute": {
"title": "Взнос",
Expand All @@ -28,15 +28,15 @@
"maxButton": "Максимальный баланс",
"bountyId": {
"label": "ID баунти",
"tooltip": "Баунти - (Bounty) - проекты с вознаграждением исполнителям, спонсируемые пользователями сети и советом. Возможность заработать tJOY токены предлагая и выполняя работу заявленную в баунти автором."
"tooltip": "Баунти - (Bounty) - проекты с вознаграждением исполнителям, спонсируемые пользователями сети и советом. Возможность заработать JOY токены предлагая и выполняя работу заявленную в баунти автором."
},
"stakingAccount": {
"label": "Счет для взносов",
"tooltip": "Счет для взносов используется для финансирования всех транзакций на блокчейн платформе, такие как выдвижение кандидатов, голосование и заявку на прооведение работ."
},
"selectAmount": "Введите сумму взноса",
"selectAmountSubtitle": "Минимальная сумма взноса {{value}} tJOY",
"authorizeDescription": "Сумма взноса {{value}} tJOY",
"selectAmountSubtitle": "Минимальная сумма взноса {{value}} JOY",
"authorizeDescription": "Сумма взноса {{value}} JOY",
"error": "Что-то пошло не так, похоже на ошибку системных процессов. Попробуйте повторить дейстиве и в случае возникновения ошибки свяжитесь с поддержкой.",
"success": "Взнос на {{bounty}} внесен",
"successButton": "Вернуться к баунти"
Expand All @@ -59,7 +59,7 @@
"fillDetails": "Заполните детали в форме",
"selectAmount": "Стейк для взноса",
"selectAmountSubtitle": "Стейк будет возврещен обратно на счет для взносов после завершения баунти",
"authorizeDescription": "Вы хотите оставить заявку на участие в баунти и внести стейк в размере {{valye}} tJOY",
"authorizeDescription": "Вы хотите оставить заявку на участие в баунти и внести стейк в размере {{valye}} JOY",
"error": "Что-то пошло не так, похоже на ошибку системных процессов. Попробуйте повторить дейстиве и в случае возникновения ошибки свяжитесь с поддержкой.",
"success": "Заявка на выполнение работ для банути {{bounty}} успешна",
"successButton": "Вернуться к баунти"
Expand All @@ -82,7 +82,7 @@
"title": "Авторизируйте транзакцию",
"informationBox": {
"info1": "Вы отменяете баунти",
"info2": "Транзакция облагается комиссией в размере {{value}} tJOY"
"info2": "Транзакция облагается комиссией в размере {{value}} JOY"
},
"accountInput": {
"label": "Комиссия за перевод со счета",
Expand Down Expand Up @@ -119,14 +119,14 @@
"withdraw": {
"contribution": {
"title": "Забрать взнос",
"description": "Вы хотите забрать{{value}} tJOY из зафиксированного взноса со счета",
"description": "Вы хотите забрать{{value}} JOY из зафиксированного взноса со счета",
"button": "Забрать взнос",
"stakingFrom": "Стейкинг от баунти",
"amountTitle": "Сумма взноса"
},
"stake": {
"title": "Забрать стейк",
"description": "Вы хотите забрать{{value}} tJOY из зафиксированного стейка со счета",
"description": "Вы хотите забрать{{value}} JOY из зафиксированного стейка со счета",
"button": "Забрать стейк",
"stakingFrom": "Стейкинг от баунти",
"amountTitle": "Сумма стейка"
Expand Down