diff --git a/CHANGELOG.md b/CHANGELOG.md
index f4b444d391..d036bec4e3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+## [1.1.0] - 2023-01-06
+
+### Added
+- Description in the forum category headers.
+- Creation date/time on forum thread.
+- Whitelist on proposal "closed" discussions.
+- Invitation lock tooltip.
+
+### Changed
+- Renames "Own Stake" to "My Stake".
+
+### Removed
+- Language tab from settings.
+
+### Fixed
+- The edit membership about section.
+- Stake info on announce candidacy sign-in modal.
+- Back button on WG openings.
+- Set Membership Lead Invitation Quota Proposal preview.
+- Blockheight info labels (in the settings).
+- Replaced/Removed some more lorem ipsum.
+- Better prevent localstorage overwrites from the forum tread watchlist.
+- The hire limit on single postion openings.
+- The temporary "Insufficient balance to cover fee" message on the vesting claim modal.
+
+## [1.0.1] - 2023-01-05
+
+### Fixed
+- Proposal view crashing due to high amounts of JOY
+
## [1.0.0] - 2022-12-16
### Added
@@ -40,6 +70,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.1.1] - 2022-12-02
-[unreleased]: https://github.com/Joystream/pioneer/compare/v1.0.0...HEAD
+[unreleased]: https://github.com/Joystream/pioneer/compare/v1.1.0...HEAD
+[1.1.0]: https://github.com/Joystream/pioneer/compare/v1.0.1...v1.1.0
+[1.0.1]: https://github.com/Joystream/pioneer/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/Joystream/pioneer/compare/v0.1.1...v1.0.0
[0.1.1]: https://github.com/Joystream/pioneer/commits/v0.1.1
diff --git a/README.md b/README.md
index b497d6c099..254980c4ae 100644
--- a/README.md
+++ b/README.md
@@ -9,8 +9,7 @@ Governance application for the Joystream DAO platform.
## Deployed version
-- The live production is available on [https://dao.joystream.org/](https://dao.joystream.org/)
-- The preview build, deployed from the `dev` branch, is available on [https://pioneer-2.vercel.app/](https://pioneer-2.vercel.app/).
+- The live production is available on [https://pioneerapp.xyz/)
- Components preview and testing from `dev` branch, is available on [https://pioneer-2-storybook.vercel.app/](https://pioneer-2-storybook.vercel.app/).
The deployed version can interact with two backends:
diff --git a/package.json b/package.json
index 4d3c1dca2f..e8a911bf54 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,6 @@
{
"name": "pioneer",
"private": true,
- "version": "0.1.0",
"description": "Governance app for Joystream DAO",
"repository": "git@github.com:Joystream/pioneer.git",
"license": "GPL-3.0-only",
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 950c31e21d..9e6f4bff19 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -1,6 +1,6 @@
{
"name": "@joystream/pioneer",
- "version": "1.0.0",
+ "version": "1.1.0",
"license": "GPL-3.0-only",
"scripts": {
"build": "node --max_old_space_size=4096 ./build.js",
diff --git a/packages/ui/src/accounts/components/AccountItem/components/lockItems/InvitationLockItem.tsx b/packages/ui/src/accounts/components/AccountItem/components/lockItems/InvitationLockItem.tsx
index 91907852cc..3e59f918ba 100644
--- a/packages/ui/src/accounts/components/AccountItem/components/lockItems/InvitationLockItem.tsx
+++ b/packages/ui/src/accounts/components/AccountItem/components/lockItems/InvitationLockItem.tsx
@@ -6,10 +6,14 @@ import { useGetMemberInvitedEventsQuery } from '@/memberships/queries'
import { LockItem } from '../LockItem'
import { LockDetailsProps } from '../types'
+const tooltipLabel =
+ 'Invitation lock can be spent on transaction fees and staking for proposals, voting and working groups applications. JOY tokens subject to this lock cannot be transferred to any other accounts. This lock is unrecoverable. NB: Transaction fees will first be taken from your transferable balance if it is positive.'
+
export const InvitationLockItem = ({ lock, address, isRecoverable }: LockDetailsProps) => {
const { data } = useGetMemberInvitedEventsQuery({ variables: { lockAccount: address } })
const eventData = data?.memberInvitedEvents[0]
const createdInEvent = eventData && asBlock(eventData)
+ const recoveryInfo = { unrecoverableLabel: 'Unrecoverable', tooltipLabel }
return (
)
}
diff --git a/packages/ui/src/accounts/modals/ClaimVestingModal/ClaimVestingModal.tsx b/packages/ui/src/accounts/modals/ClaimVestingModal/ClaimVestingModal.tsx
index 1699580f2d..5f58028d47 100644
--- a/packages/ui/src/accounts/modals/ClaimVestingModal/ClaimVestingModal.tsx
+++ b/packages/ui/src/accounts/modals/ClaimVestingModal/ClaimVestingModal.tsx
@@ -82,7 +82,7 @@ export const ClaimVestingModal = () => {
diff --git a/packages/ui/src/app/pages/Forum/ForumCategory.tsx b/packages/ui/src/app/pages/Forum/ForumCategory.tsx
index 66a101943f..96cb1cc650 100644
--- a/packages/ui/src/app/pages/Forum/ForumCategory.tsx
+++ b/packages/ui/src/app/pages/Forum/ForumCategory.tsx
@@ -11,7 +11,7 @@ import { Loading } from '@/common/components/Loading'
import { RowGapBlock } from '@/common/components/page/PageContent'
import { PageTitle } from '@/common/components/page/PageTitle'
import { PreviousPage } from '@/common/components/page/PreviousPage'
-import { Label } from '@/common/components/typography'
+import { Label, TextMedium } from '@/common/components/typography'
import { useModal } from '@/common/hooks/useModal'
import { useRefetchQueries } from '@/common/hooks/useRefetchQueries'
import { useSort } from '@/common/hooks/useSort'
@@ -73,6 +73,11 @@ export const ForumCategory = () => {
{category.title}
}
+ description={
+
+ {category.description}
+
+ }
buttons={
{
{tag.title}
))}
-
+
diff --git a/packages/ui/src/app/pages/Settings/Settings.tsx b/packages/ui/src/app/pages/Settings/Settings.tsx
index a284c992d1..ff35971c6a 100644
--- a/packages/ui/src/app/pages/Settings/Settings.tsx
+++ b/packages/ui/src/app/pages/Settings/Settings.tsx
@@ -34,7 +34,7 @@ export const Settings = () => {
const [currentTab, setCurrentTab] = useState('SETTINGS')
const tabs = [
{ title: t('network'), active: currentTab === 'SETTINGS', onClick: () => setCurrentTab('SETTINGS') },
- { title: t('language'), active: currentTab === 'LANGUAGE', onClick: () => setCurrentTab('LANGUAGE') },
+ //{ title: t('language'), active: currentTab === 'LANGUAGE', onClick: () => setCurrentTab('LANGUAGE') },
]
const switchNetwork = (network: NetworkType | null) => {
if (network) {
@@ -54,7 +54,7 @@ export const Settings = () => {
- {currentTab === 'LANGUAGE' && }
+ {/**currentTab === 'LANGUAGE' && **/}
{currentTab === 'SETTINGS' && (
<>
{
>
)}
- } title="Chain Informations">
+ } title={t('chainInfo')}>
-
- RPC blockheight:{' '}
-
+ {t('rpcBlockheight')}
{formatTokenValue(header?.number.toNumber())}
-
- QueryNode blockheight:{' '}
-
+ {t('qnBlockheight')}
{formatTokenValue(queryNodeState?.indexerHead)}
diff --git a/packages/ui/src/app/pages/WorkingGroups/WorkingGroupsOpening.tsx b/packages/ui/src/app/pages/WorkingGroups/WorkingGroupsOpening.tsx
index 060916a084..0f16c2fb61 100644
--- a/packages/ui/src/app/pages/WorkingGroups/WorkingGroupsOpening.tsx
+++ b/packages/ui/src/app/pages/WorkingGroups/WorkingGroupsOpening.tsx
@@ -122,7 +122,7 @@ export const WorkingGroupOpening = () => {
header={
-
+
{opening.title}
@@ -156,7 +156,9 @@ export const WorkingGroupOpening = () => {
/>
diff --git a/packages/ui/src/common/components/Tooltip/Tooltip.tsx b/packages/ui/src/common/components/Tooltip/Tooltip.tsx
index 7e8ebe1c5c..67410d921f 100644
--- a/packages/ui/src/common/components/Tooltip/Tooltip.tsx
+++ b/packages/ui/src/common/components/Tooltip/Tooltip.tsx
@@ -301,13 +301,16 @@ export const TooltipLink = styled(Link)<{ to: string; target: string }>`
}
`
-export const TooltipExternalLink = styled.a<{ href: string | undefined; target: string }>`
+export const TooltipExternalLink = styled.a<{
+ href: string | undefined
+ target: string
+}>`
display: grid;
grid-auto-flow: column;
grid-column-gap: 8px;
+ margin-top: 10px;
align-items: center;
width: fit-content;
- margin-top: 10px;
font-size: 12px;
line-height: 18px;
font-weight: 400;
diff --git a/packages/ui/src/common/components/page/PreviousPage.tsx b/packages/ui/src/common/components/page/PreviousPage.tsx
index 17df2025eb..893d5e0bed 100644
--- a/packages/ui/src/common/components/page/PreviousPage.tsx
+++ b/packages/ui/src/common/components/page/PreviousPage.tsx
@@ -1,3 +1,4 @@
+import { History } from 'history'
import React from 'react'
import { useHistory } from 'react-router-dom'
import styled from 'styled-components'
@@ -8,14 +9,21 @@ import { Arrow } from '../icons'
interface PreviousPageProps {
children?: React.ReactNode
showOverflow?: boolean
+ customLink?: string
}
-
-export const PreviousPage = ({ children, showOverflow }: PreviousPageProps) => {
+const setPrevHistory = (history: History, customLink?: string) => {
+ if (history.action === 'POP' && customLink) {
+ history.push(customLink)
+ } else {
+ history.goBack()
+ }
+}
+export const PreviousPage = ({ children, showOverflow, customLink }: PreviousPageProps) => {
const history = useHistory()
return (
- history.goBack()} size="small" square>
+ setPrevHistory(history, customLink)} size="small" square>
diff --git a/packages/ui/src/common/constants/videoHints.ts b/packages/ui/src/common/constants/videoHints.ts
index 487533752b..de31b96dc4 100644
--- a/packages/ui/src/common/constants/videoHints.ts
+++ b/packages/ui/src/common/constants/videoHints.ts
@@ -1,7 +1,7 @@
export type VideoHintType = 'workingGroups' | 'proposals' | 'council'
export const videoHints: { [key in VideoHintType]: string } = {
- workingGroups: 'https://play.joystream.org/embedded/video/15',
- proposals: 'https://play.joystream.org/embedded/video/15',
- council: 'https://play.joystream.org/embedded/video/15',
+ workingGroups: '',
+ proposals: '',
+ council: '',
}
diff --git a/packages/ui/src/common/helpers.ts b/packages/ui/src/common/helpers.ts
index e7457e922e..d59cca3c2a 100644
--- a/packages/ui/src/common/helpers.ts
+++ b/packages/ui/src/common/helpers.ts
@@ -96,6 +96,7 @@ export const wgListItemMappings = (value: string) => {
}
}
}
+
export const fileToDataUrl = (file: File) => {
return new Promise((resolve, reject) => {
const reader = new FileReader()
@@ -109,6 +110,7 @@ export const fileToDataUrl = (file: File) => {
reader.readAsDataURL(file)
})
}
+
export const resizeImageFile = async (
file: File,
width: number,
diff --git a/packages/ui/src/council/components/election/CandidateVote/CandidateVote.stories.tsx b/packages/ui/src/council/components/election/CandidateVote/CandidateVote.stories.tsx
index 7c072fbfc7..198c9ea684 100644
--- a/packages/ui/src/council/components/election/CandidateVote/CandidateVote.stories.tsx
+++ b/packages/ui/src/council/components/election/CandidateVote/CandidateVote.stories.tsx
@@ -33,9 +33,9 @@ const args: CandidateVoteProps = {
candidateId: '1',
sumOfAllStakes: new BN(5000000),
totalStake: new BN(500000),
- ownStake: new BN(32000),
votes: 20,
index: 1,
+ myStake: new BN(32000),
myVotes: [],
}
Default.args = args
diff --git a/packages/ui/src/council/components/election/CandidateVote/CandidateVote.tsx b/packages/ui/src/council/components/election/CandidateVote/CandidateVote.tsx
index 866e8fc317..467ac6dfc5 100644
--- a/packages/ui/src/council/components/election/CandidateVote/CandidateVote.tsx
+++ b/packages/ui/src/council/components/election/CandidateVote/CandidateVote.tsx
@@ -25,20 +25,26 @@ export interface CandidateVoteProps {
member: Member
sumOfAllStakes: BN
totalStake: BN
- ownStake?: BN
votes: number
index: number
myVotes: MyCastVote[]
+ myStake?: BN
}
+const AllRevealedButton = (
+
+ Revealed
+
+)
+
export const CandidateVote = ({
candidateId,
member,
sumOfAllStakes,
totalStake,
- ownStake,
votes,
index,
+ myStake,
myVotes,
}: CandidateVoteProps) => {
const { showModal } = useModal()
@@ -50,9 +56,11 @@ export const CandidateVote = ({
}, [showModal])
const roundedPercentage = totalStake.gt(BN_ZERO) ? sumOfAllStakes.muln(100).divRound(totalStake).toNumber() : 0
- const hasOwnStake = ownStake && ownStake.gt(BN_ZERO)
- const hasMyVotes = myVotes.length > 0
+ const userVoted = myVotes.length > 0
const allVotesRevealed = myVotes.every((vote) => vote.voteFor)
+
+ const RevealButton =
+
return (
@@ -74,11 +82,11 @@ export const CandidateVote = ({
- {hasOwnStake && (
+ {myStake?.gt(BN_ZERO) && (
<>
My Stake
-
+
>
)}
@@ -91,16 +99,7 @@ export const CandidateVote = ({
-
- {hasMyVotes &&
- (allVotesRevealed ? (
-
- Revealed
-
- ) : (
-
- ))}
-
+ {userVoted && (allVotesRevealed ? AllRevealedButton : RevealButton)}
diff --git a/packages/ui/src/council/components/election/CandidateVote/RevealingStageVotes.tsx b/packages/ui/src/council/components/election/CandidateVote/RevealingStageVotes.tsx
index 669da46323..db85b04d5f 100644
--- a/packages/ui/src/council/components/election/CandidateVote/RevealingStageVotes.tsx
+++ b/packages/ui/src/council/components/election/CandidateVote/RevealingStageVotes.tsx
@@ -39,7 +39,7 @@ export const RevealingStageVotes = ({ candidateWithVotes, totalStake, onlyMyVote
sumOfAllStakes: candidate.totalStake,
totalStake: totalStake ?? BN_ZERO,
votes: candidate.votesNumber,
- ownStake: candidate.ownStake,
+ myStake: candidate.myStake,
myVotes: candidate.myVotes,
}))}
/>
diff --git a/packages/ui/src/council/components/election/pastElection/PastElectionStats.tsx b/packages/ui/src/council/components/election/pastElection/PastElectionStats.tsx
index a38d3fbe38..94cfed6575 100644
--- a/packages/ui/src/council/components/election/pastElection/PastElectionStats.tsx
+++ b/packages/ui/src/council/components/election/pastElection/PastElectionStats.tsx
@@ -24,7 +24,12 @@ export const PastElectionStats = ({
{finishedAtBlock ? formatDateString(finishedAtBlock.timestamp) : '-'}
-
+
{cycleId} round
diff --git a/packages/ui/src/council/components/election/pastElection/PastElectionTabs.tsx b/packages/ui/src/council/components/election/pastElection/PastElectionTabs.tsx
index ac2ac25b57..eb3bff9de8 100644
--- a/packages/ui/src/council/components/election/pastElection/PastElectionTabs.tsx
+++ b/packages/ui/src/council/components/election/pastElection/PastElectionTabs.tsx
@@ -58,11 +58,11 @@ export const PastElectionTabs = ({ election }: PastElectionTabsProps) => {
revealed: !!myVote,
member: votingResult.candidate.member,
sumOfAllStakes: votingResult.totalStake,
- ownStake: myVote ? myVote.stake : undefined,
totalStake: election.totalStake,
votes: votingResult.votes.length,
index: index + 1,
myVotes: [],
+ myStake: myVote?.stake,
}
})}
/>
diff --git a/packages/ui/src/council/components/election/revealing/RevealingStage.tsx b/packages/ui/src/council/components/election/revealing/RevealingStage.tsx
index 5db52e8609..703a977319 100644
--- a/packages/ui/src/council/components/election/revealing/RevealingStage.tsx
+++ b/packages/ui/src/council/components/election/revealing/RevealingStage.tsx
@@ -32,7 +32,7 @@ export const RevealingStage = ({ election, isLoading }: Props) => {
return {
...candidate,
myVotes: myVotesForCandidate,
- ownStake: myVotesForCandidate.reduce((prev, next) => prev.add(next.stake), BN_ZERO),
+ myStake: myVotesForCandidate.reduce((prev, next) => prev.add(next.stake), BN_ZERO),
}
})
.sort(electionVotingResultComparator)
diff --git a/packages/ui/src/council/hooks/useCouncilRemainingPeriod.ts b/packages/ui/src/council/hooks/useCouncilRemainingPeriod.ts
index f61bbf4cc9..df5a588748 100644
--- a/packages/ui/src/council/hooks/useCouncilRemainingPeriod.ts
+++ b/packages/ui/src/council/hooks/useCouncilRemainingPeriod.ts
@@ -1,5 +1,5 @@
import { sum } from 'lodash'
-import { map, combineLatest, concatMap, EMPTY, merge, Observable, of } from 'rxjs'
+import { map, combineLatest } from 'rxjs'
import { useApi } from '@/api/hooks/useApi'
import { useObservable } from '@/common/hooks/useObservable'
diff --git a/packages/ui/src/council/hooks/useMyCastVotes.ts b/packages/ui/src/council/hooks/useMyCastVotes.ts
index fe7e67b2de..ff30f1fd89 100644
--- a/packages/ui/src/council/hooks/useMyCastVotes.ts
+++ b/packages/ui/src/council/hooks/useMyCastVotes.ts
@@ -14,7 +14,7 @@ export interface MyCastVote extends Vote {
}
export interface CandidateWithMyVotes extends ElectionCandidate {
- ownStake: BN
+ myStake: BN
myVotes: MyCastVote[]
}
diff --git a/packages/ui/src/council/modals/AnnounceCandidacy/AnnounceCandidacyModal.tsx b/packages/ui/src/council/modals/AnnounceCandidacy/AnnounceCandidacyModal.tsx
index 6d9c44de2d..2ae7322991 100644
--- a/packages/ui/src/council/modals/AnnounceCandidacy/AnnounceCandidacyModal.tsx
+++ b/packages/ui/src/council/modals/AnnounceCandidacy/AnnounceCandidacyModal.tsx
@@ -257,7 +257,9 @@ export const AnnounceCandidacyModal = () => {
'Signing this transaction will result in the specified amount of JOY tokens staked for the chosen purpose, resulting in a rivalrous lock applied to this amount until the stake gets recovered.'
return (
{
} />
- Caution, this action is irreversible. Once you withdraw your candidacy, you will not be able to apply again
- with this account in the same election cycle, while still incurring the transaction costs for applying and
- withdrawing candidacy.
+ Withdrawing a candidacy is irreversible however you can announce another one with the same account afterwards.
+ This is currently the only way to edit bullet points and agenda.
diff --git a/packages/ui/src/forum/components/ForumPageHeader.tsx b/packages/ui/src/forum/components/ForumPageHeader.tsx
index c6508a4e8b..0bf4dce1ad 100644
--- a/packages/ui/src/forum/components/ForumPageHeader.tsx
+++ b/packages/ui/src/forum/components/ForumPageHeader.tsx
@@ -9,8 +9,9 @@ interface ForumPageHeaderProps {
title: React.ReactNode
children?: React.ReactNode
buttons?: React.ReactNode
+ description?: React.ReactNode
}
-export const ForumPageHeader = ({ title, children, buttons }: ForumPageHeaderProps) => {
+export const ForumPageHeader = ({ title, children, buttons, description }: ForumPageHeaderProps) => {
const [search, setSearch] = useState('')
const { showModal } = useModal()
@@ -28,6 +29,7 @@ export const ForumPageHeader = ({ title, children, buttons }: ForumPageHeaderPro
{buttons}
+ {description && {description}}
{children}
)
diff --git a/packages/ui/src/forum/components/Thread/WatchlistButton.tsx b/packages/ui/src/forum/components/Thread/WatchlistButton.tsx
index 093daa2aac..2eb6c75d50 100644
--- a/packages/ui/src/forum/components/Thread/WatchlistButton.tsx
+++ b/packages/ui/src/forum/components/Thread/WatchlistButton.tsx
@@ -14,14 +14,14 @@ export const WatchlistButton = ({ threadId }: Props) => {
const addToWatchlist = useCallback(
(e) => {
e.stopPropagation()
- setWatchlist(watchlist ? [...watchlist, threadId] : [threadId])
+ setWatchlist((watchlist = []) => [...watchlist, threadId])
},
[watchlist]
)
const removeFromWatchlist = useCallback(
(e) => {
e.preventDefault()
- setWatchlist(watchlist?.filter((id) => id !== threadId) ?? [])
+ setWatchlist((watchlist = []) => watchlist.filter((id) => id !== threadId))
},
[watchlist]
)
diff --git a/packages/ui/src/forum/components/category/LatestPost.tsx b/packages/ui/src/forum/components/category/LatestPost.tsx
index c2aa409170..85d157cdf0 100644
--- a/packages/ui/src/forum/components/category/LatestPost.tsx
+++ b/packages/ui/src/forum/components/category/LatestPost.tsx
@@ -2,7 +2,6 @@ import React, { memo } from 'react'
import { generatePath } from 'react-router-dom'
import styled from 'styled-components'
-import { Loading } from '@/common/components/Loading'
import { GhostRouterLink } from '@/common/components/RouterLink'
import { TextInlineExtraSmall, TextMedium } from '@/common/components/typography'
import { Colors, Fonts, Overflow, Transitions } from '@/common/constants'
@@ -14,9 +13,7 @@ import { MemberInfo } from '@/memberships/components'
import { CategoryItemFieldProps } from './CategoryListItem'
export const LatestPost = memo(({ categoryId }: CategoryItemFieldProps) => {
- const { post, thread, isLoading } = useCategoryLatestPost(categoryId)
-
- if (isLoading) return
+ const { post, thread } = useCategoryLatestPost(categoryId)
if (!post) return -
diff --git a/packages/ui/src/forum/components/category/PopularThread.tsx b/packages/ui/src/forum/components/category/PopularThread.tsx
index 347bbe8ad6..87297b1500 100644
--- a/packages/ui/src/forum/components/category/PopularThread.tsx
+++ b/packages/ui/src/forum/components/category/PopularThread.tsx
@@ -2,7 +2,6 @@ import React, { memo } from 'react'
import { generatePath } from 'react-router-dom'
import styled from 'styled-components'
-import { Loading } from '@/common/components/Loading'
import { GhostRouterLink } from '@/common/components/RouterLink'
import { TextExtraSmall, TextMedium } from '@/common/components/typography'
import { Overflow, Fonts, Transitions, Colors } from '@/common/constants'
@@ -14,10 +13,9 @@ import { useForumPopularThreads } from '@/forum/hooks/useForumPopularThreads'
import { CategoryItemFieldProps } from './CategoryListItem'
export const PopularThread = memo(({ categoryId }: CategoryItemFieldProps) => {
- const { isLoading, threads } = useForumPopularThreads({ categoryId })
+ const { threads } = useForumPopularThreads({ categoryId })
- if (isLoading) return
- else if (!threads?.[0]) return -
+ if (!threads?.[0]) return -
const thread = threads[0]
diff --git a/packages/ui/src/forum/queries/forum.graphql b/packages/ui/src/forum/queries/forum.graphql
index f4b17ebe7f..671abfbbc6 100644
--- a/packages/ui/src/forum/queries/forum.graphql
+++ b/packages/ui/src/forum/queries/forum.graphql
@@ -164,7 +164,7 @@ fragment ForumPostWithoutReplyFields on ForumPost {
}
threadId
thread {
- categoryId
+ categoryId
}
}
diff --git a/packages/ui/src/memberships/components/MemberProfile/MemberRoleToggle.tsx b/packages/ui/src/memberships/components/MemberProfile/MemberRoleToggle.tsx
index 45437b5821..bae136f73a 100644
--- a/packages/ui/src/memberships/components/MemberProfile/MemberRoleToggle.tsx
+++ b/packages/ui/src/memberships/components/MemberProfile/MemberRoleToggle.tsx
@@ -32,7 +32,7 @@ export const MemberRoleToggle = ({ role }: MemberRoleToggleProps) => {
data: { applicationId: role.applicationId },
})
}, [role])
- const { earnings, currentDayEarnings } = useWorkerEarnings(role.id)
+ const { earnings } = useWorkerEarnings(role.id)
const rewardPeriod = useRewardPeriod(role.group.id)
const [isOpen, toggleOpen] = useToggle()
@@ -67,14 +67,14 @@ export const MemberRoleToggle = ({ role }: MemberRoleToggleProps) => {
-
-
+ {/** TODO fix calculation
+
-
+ **/}
diff --git a/packages/ui/src/memberships/modals/UpdateMembershipModal/UpdateMembershipFormModal.tsx b/packages/ui/src/memberships/modals/UpdateMembershipModal/UpdateMembershipFormModal.tsx
index 6881d26412..5279349702 100644
--- a/packages/ui/src/memberships/modals/UpdateMembershipModal/UpdateMembershipFormModal.tsx
+++ b/packages/ui/src/memberships/modals/UpdateMembershipModal/UpdateMembershipFormModal.tsx
@@ -49,7 +49,7 @@ const getUpdateMemberFormInitial = (member: MemberWithDetails) => ({
id: member.id,
name: member.name || '',
handle: member.handle || '',
- about: '',
+ about: member.about || '',
avatarUri: process.env.REACT_APP_AVATAR_UPLOAD_URL ? '' : typeof member.avatar === 'string' ? member.avatar : '',
rootAccount: member.rootAccount,
controllerAccount: member.controllerAccount,
diff --git a/packages/ui/src/proposals/components/ProposalDiscussions.tsx b/packages/ui/src/proposals/components/ProposalDiscussions.tsx
index cc0ae2b2a7..d534f29c06 100644
--- a/packages/ui/src/proposals/components/ProposalDiscussions.tsx
+++ b/packages/ui/src/proposals/components/ProposalDiscussions.tsx
@@ -25,17 +25,21 @@ interface Props {
proposalId: string
}
+const hints = {
+ open: 'This is an unmoderated discussioon, everyone can comment.',
+ closed: 'This discussion is closed. Only selected members and the council can comment.',
+}
+
export const ProposalDiscussions = ({ thread, proposalId }: Props) => {
const query = useRouteQuery()
const { api } = useApi()
const { active, members } = useMyMemberships()
const initialPost = query.get('post')
- const isAbleToPost =
- thread.mode === 'open' ||
- (thread.mode === 'closed' && active && (thread.whitelistIds?.includes(active.id) || active.isCouncilMember))
- const isInWhitelist = thread.mode === 'closed' && members.find((member) => thread.whitelistIds?.includes(member.id))
- const hasCouncilMembership = thread.mode === 'closed' && members.find((member) => member.isCouncilMember)
+ const isClosed = thread.mode === 'closed'
+ const isAbleToPost = !isClosed || (active && (thread.whitelistIds?.includes(active.id) || active.isCouncilMember))
+ const whitelistedMember = isClosed ? members.find((member) => thread.whitelistIds?.includes(member.id)) : null
+ const hasCouncilMembership = isClosed && members.find((member) => member.isCouncilMember)
const newPostRef = useRef(null)
const postsRefs: AnyKeys = {}
@@ -66,14 +70,15 @@ export const ProposalDiscussions = ({ thread, proposalId }: Props) => {
return Please select your council membership to post in this thread.
}
- if (isInWhitelist) {
- return Please select a whitelisted membership to post in this thread.
+ if (whitelistedMember) {
+ return Please select your other membership to post in this thread: {whitelistedMember.handle}
}
return (
-
- The discussion of this proposal is closed; only members whitelisted by the proposer can comment on it.
-
+ <>
+ The discussion is limited to following whitelisted members:
+ {thread.whitelistIds?.join(' ') ?? ''}
+ >
)
}
@@ -83,7 +88,7 @@ export const ProposalDiscussions = ({ thread, proposalId }: Props) => {
Discussion
{`${thread.mode} `}
-
+
diff --git a/packages/ui/src/proposals/modals/AddNewProposal/components/SpecificParameters/SetMembershipLeadInvitationQuota.tsx b/packages/ui/src/proposals/modals/AddNewProposal/components/SpecificParameters/SetMembershipLeadInvitationQuota.tsx
index ac6f010f54..663157f294 100644
--- a/packages/ui/src/proposals/modals/AddNewProposal/components/SpecificParameters/SetMembershipLeadInvitationQuota.tsx
+++ b/packages/ui/src/proposals/modals/AddNewProposal/components/SpecificParameters/SetMembershipLeadInvitationQuota.tsx
@@ -1,7 +1,6 @@
import React, { useEffect } from 'react'
import { useFormContext } from 'react-hook-form'
-import { CurrencyName } from '@/app/constants/currency'
import { InputComponent, InputNumber } from '@/common/components/forms'
import { Row } from '@/common/components/Modal'
import { RowGapBlock } from '@/common/components/page/PageContent'
@@ -29,22 +28,20 @@ export const SetMembershipLeadInvitationQuota = () => {
{
.required('Field is required'),
}),
setMembershipLeadInvitationQuota: Yup.object().shape({
- amount: BNSchema.test(moreThanMixed(0, 'Amount must be greater than zero')).required('Field is required'),
+ count: BNSchema.test(moreThanMixed(0, 'Quota must be greater than zero')).required('Field is required'),
leadId: Yup.string().test('execution', (value) => !!value),
}),
setInitialInvitationBalance: Yup.object().shape({
diff --git a/packages/ui/src/proposals/queries/__generated__/proposals.generated.tsx b/packages/ui/src/proposals/queries/__generated__/proposals.generated.tsx
index f2319c5511..5c61574321 100644
--- a/packages/ui/src/proposals/queries/__generated__/proposals.generated.tsx
+++ b/packages/ui/src/proposals/queries/__generated__/proposals.generated.tsx
@@ -1,9 +1,8 @@
import * as Types from '../../../common/api/queries/__generated__/baseTypes.generated'
-import * as Apollo from '@apollo/client'
import { gql } from '@apollo/client'
import { MemberFieldsFragmentDoc } from '../../../memberships/queries/__generated__/members.generated'
-
+import * as Apollo from '@apollo/client'
const defaultOptions = {} as const
export type WorkerProposalDetailsFragment = {
__typename: 'Worker'
@@ -387,7 +386,7 @@ export type ProposalWithDetailsFieldsFragment = {
| { __typename: 'SetInitialInvitationBalanceProposalDetails'; newInitialInvitationBalance: string }
| { __typename: 'SetInitialInvitationCountProposalDetails'; newInitialInvitationsCount: number }
| { __typename: 'SetMaxValidatorCountProposalDetails'; newMaxValidatorCount: number }
- | { __typename: 'SetMembershipLeadInvitationQuotaProposalDetails' }
+ | { __typename: 'SetMembershipLeadInvitationQuotaProposalDetails'; newLeadInvitationQuota: number }
| { __typename: 'SetMembershipPriceProposalDetails'; newPrice: string }
| { __typename: 'SetReferralCutProposalDetails'; newReferralCut: number }
| {
@@ -1210,7 +1209,7 @@ export type GetProposalQuery = {
| { __typename: 'SetInitialInvitationBalanceProposalDetails'; newInitialInvitationBalance: string }
| { __typename: 'SetInitialInvitationCountProposalDetails'; newInitialInvitationsCount: number }
| { __typename: 'SetMaxValidatorCountProposalDetails'; newMaxValidatorCount: number }
- | { __typename: 'SetMembershipLeadInvitationQuotaProposalDetails' }
+ | { __typename: 'SetMembershipLeadInvitationQuotaProposalDetails'; newLeadInvitationQuota: number }
| { __typename: 'SetMembershipPriceProposalDetails'; newPrice: string }
| { __typename: 'SetReferralCutProposalDetails'; newReferralCut: number }
| {
@@ -2004,6 +2003,9 @@ export const ProposalWithDetailsFieldsFragmentDoc = gql`
... on SetCouncilBudgetIncrementProposalDetails {
newAmount
}
+ ... on SetMembershipLeadInvitationQuotaProposalDetails {
+ newLeadInvitationQuota
+ }
... on SignalProposalDetails {
text
}
diff --git a/packages/ui/src/proposals/queries/proposals.graphql b/packages/ui/src/proposals/queries/proposals.graphql
index 28b7d05f90..3dbe2f3653 100644
--- a/packages/ui/src/proposals/queries/proposals.graphql
+++ b/packages/ui/src/proposals/queries/proposals.graphql
@@ -160,6 +160,9 @@ fragment ProposalWithDetailsFields on Proposal {
... on SetCouncilBudgetIncrementProposalDetails {
newAmount
}
+ ... on SetMembershipLeadInvitationQuotaProposalDetails {
+ newLeadInvitationQuota
+ }
... on SignalProposalDetails {
text
}
diff --git a/packages/ui/src/proposals/types/ProposalDetails.ts b/packages/ui/src/proposals/types/ProposalDetails.ts
index 42523ed7d0..1f8446b554 100644
--- a/packages/ui/src/proposals/types/ProposalDetails.ts
+++ b/packages/ui/src/proposals/types/ProposalDetails.ts
@@ -59,7 +59,7 @@ export type GroupNameDetail = {
}
export type CountDetail = {
- count: BN
+ count: number
}
export type ProposalDetail = {
@@ -111,6 +111,8 @@ export type SignalDetails = ProposalDetailsNew<'signal', SignalTextDetail>
export type SetMembershipPriceDetails = ProposalDetailsNew<'setMembershipPrice', AmountDetail>
+export type SetMembershipLeadInvitationQuota = ProposalDetailsNew<'setMembershipLeadInvitationQuota', CountDetail>
+
export type SetCouncilBudgetIncrementDetails = ProposalDetailsNew<'setCouncilBudgetIncrement', AmountDetail>
export type CancelWorkingGroupLeadOpeningDetails = ProposalDetailsNew<
@@ -141,6 +143,7 @@ export type ProposalDetails =
| SetWorkingGroupLeadRewardDetails
| TerminateWorkingGroupLeadDetails
| SetMembershipPriceDetails
+ | SetMembershipLeadInvitationQuota
| SetCouncilBudgetIncrementDetails
| SignalDetails
| CancelWorkingGroupLeadOpeningDetails
@@ -231,7 +234,7 @@ const asSetMaxValidatorCount: DetailsCast<'SetMaxValidatorCountProposalDetails'>
fragment
): MaxValidatorCountDetails => ({
type: 'setMaxValidatorCount',
- count: new BN(fragment.newMaxValidatorCount),
+ count: fragment.newMaxValidatorCount,
})
const asFillGroupLeadOpening: DetailsCast<'FillWorkingGroupLeadOpeningProposalDetails'> = (
@@ -296,6 +299,13 @@ const asSetReferralCut: DetailsCast<'SetReferralCutProposalDetails'> = (fragment
amount: asBN(fragment.newReferralCut),
})
+const asSetMembershipLeadInvitationQuota: DetailsCast<'SetMembershipLeadInvitationQuotaProposalDetails'> = (
+ fragment
+): SetMembershipLeadInvitationQuota => ({
+ type: 'setMembershipLeadInvitationQuota',
+ count: fragment.newLeadInvitationQuota,
+})
+
const asSetInitialInvitationBalance: DetailsCast<'SetInitialInvitationBalanceProposalDetails'> = (
fragment
): SetInitialInvitationBalanceDetails => ({
@@ -307,7 +317,7 @@ const asSetInitialInvitationCount: DetailsCast<'SetInitialInvitationCountProposa
fragment
): SetInitialInvitationCountDetails => ({
type: 'setInitialInvitationCount',
- count: new BN(fragment.newInitialInvitationsCount),
+ count: fragment.newInitialInvitationsCount,
})
const asSetCouncilorReward: DetailsCast<'SetCouncilorRewardProposalDetails'> = (
@@ -346,6 +356,7 @@ const detailsCasts: Partial>> =
SetInitialInvitationCountProposalDetails: asSetInitialInvitationCount,
SetCouncilorRewardProposalDetails: asSetCouncilorReward,
VetoProposalDetails: asVeto,
+ SetMembershipLeadInvitationQuotaProposalDetails: asSetMembershipLeadInvitationQuota,
}
export const asProposalDetails = (fragment: DetailsFragment): ProposalDetails => {
diff --git a/packages/ui/src/services/i18n/dict/en/settings.json b/packages/ui/src/services/i18n/dict/en/settings.json
index 0f524c5604..e64d1989ac 100644
--- a/packages/ui/src/services/i18n/dict/en/settings.json
+++ b/packages/ui/src/services/i18n/dict/en/settings.json
@@ -5,5 +5,8 @@
"networkDetails": "Network Details",
"networkAddress": "Network: ",
"QueryNodeAddress": "Query Node: ",
- "faucet": "Faucet: "
+ "faucet": "Faucet: ",
+ "chainInfo": "Chain Information",
+ "rpcBlockheight": "RPC Block Height: ",
+ "qnBlockheight": "Query Node Block Height: "
}
diff --git a/packages/ui/src/working-groups/components/Activities/ActivitiesModals/StakeChanged/StakeChangedModal.tsx b/packages/ui/src/working-groups/components/Activities/ActivitiesModals/StakeChanged/StakeChangedModal.tsx
index 4f3f789692..396d69e33c 100644
--- a/packages/ui/src/working-groups/components/Activities/ActivitiesModals/StakeChanged/StakeChangedModal.tsx
+++ b/packages/ui/src/working-groups/components/Activities/ActivitiesModals/StakeChanged/StakeChangedModal.tsx
@@ -23,39 +23,46 @@ import { useEscape } from '@/common/hooks/useEscape'
interface StakeChangedModalProps {
onClose: () => void
amount?: BN
- eventType?: 'StakeIncreasedEvent' | 'StakeDecreasedEvent'
+ eventType?: 'StakeIncreasedEvent' | 'StakeDecreasedEvent' | 'StakeSlashedEvent'
id?: string
}
+const actions = {
+ StakeIncreasedEvent: { past: 'increased', badge: 'increase' },
+ StakeDecreasedEvent: { past: 'decreased', badge: 'decrease' },
+ StakeSlashedEvent: { past: 'slashed', badge: 'slash' },
+}
+
export const StakeChangedModal = ({ onClose, amount, eventType, id }: StakeChangedModalProps) => {
useEscape(() => onClose())
const slashingRationaleInfo = '' // hidden until needed
+ const action = eventType ? actions[eventType] : { past: 'changes', badge: 'change' }
return (
-
- Stake has been {eventType === 'StakeDecreasedEvent' ? 'reduced' : 'increased'}
-
+ Stake has been {action.past}
- {amount && eventType && id ? (
+ {eventType && id ? (
-
- {eventType === 'StakeDecreasedEvent' ? 'reduce' : 'increase'}
-
-
-
-
-
-
+
+ {action.badge}
- {false && (
+ {amount && (
+
+
+
+
+
+
+ )}
+ {slashingRationaleInfo.length > 0 && (
{slashingRationaleInfo}
diff --git a/packages/ui/src/working-groups/components/Activities/StakeSlashedContent.tsx b/packages/ui/src/working-groups/components/Activities/StakeSlashedContent.tsx
index d47bdef623..df000b8415 100644
--- a/packages/ui/src/working-groups/components/Activities/StakeSlashedContent.tsx
+++ b/packages/ui/src/working-groups/components/Activities/StakeSlashedContent.tsx
@@ -1,24 +1,49 @@
-import React from 'react'
+import React, { useState } from 'react'
import { ActivityContentComponent } from '@/common/components/Activities/ActivityContent'
import { ButtonLink } from '@/common/components/buttons/Buttons'
import { MemberModalLink } from '@/memberships/components/MemberModalLink'
import { StakeSlashedActivity } from '@/working-groups/types'
+import { StakeChangedModal } from './ActivitiesModals/StakeChanged/StakeChangedModal'
+
export const StakeSlashedContent: ActivityContentComponent = ({ activity, isOwn }) => {
- const { member, groupName } = activity
+ const { eventType, member, groupName, id } = activity
+ const [isStakeSlashedModalOpen, setStakeSlashedModalOpen] = useState(false)
if (isOwn) {
- return <>Your stake was reduced by the {groupName} Working Group Lead.>
+ return (
+ <>
+ Your stake have been slashed by the {groupName} lead.{' '}
+ setStakeSlashedModalOpen(!isStakeSlashedModalOpen)}>
+ Read more
+
+ {isStakeSlashedModalOpen && (
+ setStakeSlashedModalOpen(!isStakeSlashedModalOpen)}
+ eventType={eventType}
+ id={id}
+ />
+ )}
+ >
+ )
}
return (
<>
- {member.handle} has been
- reduced by the {groupName} Working Group Lead.{' '}
-
+ The stake of{' '}
+ {member.handle} was slashed
+ by the {groupName} lead.{' '}
+ setStakeSlashedModalOpen(!isStakeSlashedModalOpen)}>
Read more
+ {isStakeSlashedModalOpen && (
+ setStakeSlashedModalOpen(!isStakeSlashedModalOpen)}
+ eventType={eventType}
+ id={id}
+ />
+ )}
>
)
}
diff --git a/packages/ui/src/working-groups/components/OpeningsList/Opening/OpeningDetails.tsx b/packages/ui/src/working-groups/components/OpeningsList/Opening/OpeningDetails.tsx
index 76f3a49764..0894d6b5e4 100644
--- a/packages/ui/src/working-groups/components/OpeningsList/Opening/OpeningDetails.tsx
+++ b/packages/ui/src/working-groups/components/OpeningsList/Opening/OpeningDetails.tsx
@@ -1,9 +1,11 @@
import React from 'react'
+import styled from 'styled-components'
import { ButtonsGroup } from '@/common/components/buttons'
import { LinkButtonGhost } from '@/common/components/buttons/LinkButtons'
import { TransactionButton } from '@/common/components/buttons/TransactionButton'
import { StatiscticContentColumn, Statistics, StatsBlock, MultiColumnsStatistic } from '@/common/components/statistics'
+import { Tooltip, TooltipDefault } from '@/common/components/Tooltip'
import { TextBig, TokenValue } from '@/common/components/typography'
import { Subscription } from '@/common/components/typography/Subscription'
import { isInFuture, nameMapping } from '@/common/helpers'
@@ -66,7 +68,16 @@ export const OpeningDetails = ({ opening, onClick, past }: OpeningListItemProps)
- Minimum Stake Required
+
+ Minimum Stake Required{' '}
+
+
+
+
@@ -87,3 +98,9 @@ export const OpeningDetails = ({ opening, onClick, past }: OpeningListItemProps)
)
}
+
+const MinStake = styled(Subscription)`
+ display: flex;
+ align-items: center;
+ gap: 8px;
+`
diff --git a/packages/ui/src/working-groups/components/WorkingGroupListItem.tsx b/packages/ui/src/working-groups/components/WorkingGroupListItem.tsx
index c752521332..e087568d94 100644
--- a/packages/ui/src/working-groups/components/WorkingGroupListItem.tsx
+++ b/packages/ui/src/working-groups/components/WorkingGroupListItem.tsx
@@ -75,7 +75,7 @@ export function WorkingGroupListItem({ group }: WorkingGroupProps) {
) : (
- No Leader
+ No Lead
)}
diff --git a/packages/ui/src/working-groups/components/WorkingGroupsList.tsx b/packages/ui/src/working-groups/components/WorkingGroupsList.tsx
index 7db814dc67..08c335e2c5 100644
--- a/packages/ui/src/working-groups/components/WorkingGroupsList.tsx
+++ b/packages/ui/src/working-groups/components/WorkingGroupsList.tsx
@@ -20,7 +20,7 @@ export const WorkingGroupsList = ({ groups }: WorkingGroupsListProps) => {
Workers
Current Budget
Openings
- Wg leader
+ WG Lead
diff --git a/packages/ui/src/working-groups/hooks/useWorkerEarnings.ts b/packages/ui/src/working-groups/hooks/useWorkerEarnings.ts
index fb0be800eb..21e1df762f 100644
--- a/packages/ui/src/working-groups/hooks/useWorkerEarnings.ts
+++ b/packages/ui/src/working-groups/hooks/useWorkerEarnings.ts
@@ -14,6 +14,7 @@ export const useWorkerEarnings = (workerId: string) => {
const currentDayEarnings = data?.rewardPaidEvents
.filter((event) => {
+ // TODO use rewardPerBlock
const dayAgo = Date.now() - DAY_IN_MILLISECONDS
const eventDate = new Date(event.createdAt).getTime()
return eventDate > dayAgo
diff --git a/packages/ui/src/working-groups/queries/workingGroups.graphql b/packages/ui/src/working-groups/queries/workingGroups.graphql
index 80cbfd5d1f..377fef292e 100644
--- a/packages/ui/src/working-groups/queries/workingGroups.graphql
+++ b/packages/ui/src/working-groups/queries/workingGroups.graphql
@@ -384,7 +384,11 @@ fragment WorkingGroupApplicationFields on WorkingGroupApplication {
roleAccount
}
-query GetWorkingGroupApplications($where: WorkingGroupApplicationWhereInput, $orderBy: [WorkingGroupApplicationOrderByInput!], $limit: Int) {
+query GetWorkingGroupApplications(
+ $where: WorkingGroupApplicationWhereInput
+ $orderBy: [WorkingGroupApplicationOrderByInput!]
+ $limit: Int
+) {
workingGroupApplications(where: $where, orderBy: $orderBy, limit: $limit) {
...WorkingGroupApplicationFields
}
diff --git a/packages/ui/src/working-groups/types/WorkingGroupActivity/types.ts b/packages/ui/src/working-groups/types/WorkingGroupActivity/types.ts
index 6c2376a156..850f5bddbc 100644
--- a/packages/ui/src/working-groups/types/WorkingGroupActivity/types.ts
+++ b/packages/ui/src/working-groups/types/WorkingGroupActivity/types.ts
@@ -79,7 +79,7 @@ export interface StakeSlashedActivity extends BaseActivity {
}
export interface StakeChangedActivity extends BaseActivity {
- eventType: 'StakeIncreasedEvent' | 'StakeDecreasedEvent'
+ eventType: 'StakeIncreasedEvent' | 'StakeDecreasedEvent' | 'StakeSlashedEvent'
member: MemberDisplayFields
amount: BN
}
diff --git a/packages/ui/src/working-groups/types/WorkingGroupOpening.ts b/packages/ui/src/working-groups/types/WorkingGroupOpening.ts
index 85a00c8384..11c2c64b48 100644
--- a/packages/ui/src/working-groups/types/WorkingGroupOpening.ts
+++ b/packages/ui/src/working-groups/types/WorkingGroupOpening.ts
@@ -116,7 +116,7 @@ export const asWorkingGroupOpening = (fields: WorkingGroupOpeningFieldsFragment)
: 0,
hiring: {
current: fields.openingfilledeventopening?.reduce((total, event) => total + event.workersHired.length, 0) ?? 0,
- limit: fields.metadata?.hiringLimit ?? 0,
+ limit: fields.metadata?.hiringLimit ?? 1,
},
unstakingPeriod: fields.unstakingPeriod,
}
diff --git a/packages/ui/test/_mocks/transactions.ts b/packages/ui/test/_mocks/transactions.ts
index 69a6361f29..89ce321f4d 100644
--- a/packages/ui/test/_mocks/transactions.ts
+++ b/packages/ui/test/_mocks/transactions.ts
@@ -153,9 +153,9 @@ export const stubConst = (api: UseApi, constSubPath: string, value: T) => {
export const stubApi = () => {
const api: UseApi = {
- api: ({
+ api: {
isConnected: true,
- } as unknown) as Api,
+ } as unknown as Api,
isConnected: true,
connectionState: 'connected',
setQnConnectionState: () => undefined,
@@ -267,7 +267,7 @@ export const stubBalances = ({ available, lockId, locked }: Balances) => {
const availableBalance = new BN(available ?? 0)
const lockedBalance = new BN(locked ?? 0)
- const deriveBalances = ({
+ const deriveBalances = {
availableBalance: createType('Balance', availableBalance),
lockedBalance: createType('Balance', lockedBalance),
accountId: createType('AccountId', '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY'),
@@ -286,7 +286,7 @@ export const stubBalances = ({ available, lockId, locked }: Balances) => {
vestingTotal: new BN(0),
votingBalance: new BN(0),
vesting: [],
- } as unknown) as DeriveBalancesAll
+ } as unknown as DeriveBalancesAll
const balance = toBalances(deriveBalances)
mockedBalances.mockReturnValue(balance)
diff --git a/packages/ui/test/bounty/modals/AddBountyModal.test.tsx b/packages/ui/test/bounty/modals/AddBountyModal.test.tsx
index 27d9820804..24792ee409 100644
--- a/packages/ui/test/bounty/modals/AddBountyModal.test.tsx
+++ b/packages/ui/test/bounty/modals/AddBountyModal.test.tsx
@@ -45,8 +45,6 @@ jest.mock('@/common/hooks/useCurrentBlockNumber', () => ({
useCurrentBlockNumber: () => mockUseCurrentBlockNumber(),
}))
-
-
describe('UI: AddNewBountyModal', () => {
const api = stubApi()
const showModal = jest.fn()
diff --git a/packages/ui/test/bounty/modals/SubmitJudgementModal.test.tsx b/packages/ui/test/bounty/modals/SubmitJudgementModal.test.tsx
index dcdb351365..2d331b85e8 100644
--- a/packages/ui/test/bounty/modals/SubmitJudgementModal.test.tsx
+++ b/packages/ui/test/bounty/modals/SubmitJudgementModal.test.tsx
@@ -33,8 +33,6 @@ import {
configure({ testIdAttribute: 'id' })
-
-
jest.mock('@/common/components/CKEditor', () => ({
CKEditor: (props: CKEditorProps) => mockCKEditor(props),
}))
diff --git a/packages/ui/test/council/components/ElectionVotes.test.tsx b/packages/ui/test/council/components/ElectionVotes.test.tsx
index ba642b43ad..c34270f097 100644
--- a/packages/ui/test/council/components/ElectionVotes.test.tsx
+++ b/packages/ui/test/council/components/ElectionVotes.test.tsx
@@ -37,7 +37,7 @@ const Results = ({ onlyMyVotes }: { onlyMyVotes: boolean }) => {
return {
...candidate,
myVotes: myVotesForCandidate,
- ownStake: myVotesForCandidate.reduce((prev, next) => prev.add(next.stake), BN_ZERO),
+ myStake: myVotesForCandidate.reduce((prev, next) => prev.add(next.stake), BN_ZERO),
}
})
.sort(electionVotingResultComparator)
@@ -153,7 +153,7 @@ describe('UI: RevealingStageVotes', () => {
expect(voteNumbers[1].nextSibling?.textContent).toEqual('1')
})
- it('Own stake', async () => {
+ it('My stake', async () => {
seedInformations(server.server, {
votes: [{ voteForId: '0', stake: 2000, castBy: bob.address }],
candidate: [{ memberId: '0', votePower: '3000', votesNumber: 2 }],
diff --git a/packages/ui/test/council/modals/WithdrawCandidacyModal.test.tsx b/packages/ui/test/council/modals/WithdrawCandidacyModal.test.tsx
index e42710ddd2..2b6326a797 100644
--- a/packages/ui/test/council/modals/WithdrawCandidacyModal.test.tsx
+++ b/packages/ui/test/council/modals/WithdrawCandidacyModal.test.tsx
@@ -56,7 +56,7 @@ describe('UI: Withdraw Candidacy Modal', () => {
it('Warning', async () => {
renderModal(getMember('alice'))
- expect(await screen.findByText(/^Caution, this action is irreversible/i)).toBeDefined()
+ expect(await screen.findByText(/^Withdrawing a candidacy is irreversible/i)).toBeDefined()
})
it('Transaction sign', async () => {
diff --git a/packages/ui/test/membership/modals/BuyMembershipModal.test.tsx b/packages/ui/test/membership/modals/BuyMembershipModal.test.tsx
index 6287c7570d..be398ff4cd 100644
--- a/packages/ui/test/membership/modals/BuyMembershipModal.test.tsx
+++ b/packages/ui/test/membership/modals/BuyMembershipModal.test.tsx
@@ -31,8 +31,6 @@ import { mockUseModalCall } from '../../setup'
configure({ testIdAttribute: 'id' })
-
-
describe('UI: BuyMembershipModal', () => {
const api = stubApi()
let transaction: any
diff --git a/packages/ui/test/membership/modals/InviteMemberModal.test.tsx b/packages/ui/test/membership/modals/InviteMemberModal.test.tsx
index 65021e93ff..4bdb749cdb 100644
--- a/packages/ui/test/membership/modals/InviteMemberModal.test.tsx
+++ b/packages/ui/test/membership/modals/InviteMemberModal.test.tsx
@@ -31,8 +31,6 @@ import {
configure({ testIdAttribute: 'id' })
-
-
describe('UI: InviteMemberModal', () => {
beforeAll(async () => {
await cryptoWaitReady()
diff --git a/packages/ui/test/proposals/components/ProposalDiscussion.test.tsx b/packages/ui/test/proposals/components/ProposalDiscussion.test.tsx
index fc2dc47921..4d954bd1dd 100644
--- a/packages/ui/test/proposals/components/ProposalDiscussion.test.tsx
+++ b/packages/ui/test/proposals/components/ProposalDiscussion.test.tsx
@@ -15,9 +15,17 @@ import { getMember } from '../../_mocks/members'
import { MockKeyringProvider } from '../../_mocks/providers'
import { stubApi, stubTransaction } from '../../_mocks/transactions'
-jest.mock('@/common/components/CKEditor', () => ({
- BaseCKEditor: (props: CKEditorProps) => mockCKEditor(props),
-}))
+jest.mock('@/common/components/CKEditor', () => {
+ return {
+ BaseCKEditor: (props: CKEditorProps) => mockCKEditor(props),
+ }
+})
+
+const strings = {
+ isClosed: 'The discussion is limited to following whitelisted members:',
+ selectCouncilor: 'Please select your council membership to post in this thread.',
+ selectWhitelisted: 'Please select your other membership to post in this thread:',
+}
describe('UI: Proposal discussion', () => {
const api = stubApi()
@@ -52,46 +60,35 @@ describe('UI: Proposal discussion', () => {
it('Non-whitelisted member', async () => {
useMyMemberships.setActive(alice)
renderComponent({ ...baseThread, mode: 'closed', whitelistIds: ['111', '13'] })
- expect(
- await screen.findByText(
- 'The discussion of this proposal is closed; only members whitelisted by the proposer can comment on it.'
- )
- ).toBeDefined()
+ expect(await screen.queryByText(/${strings.isClosed}/i)).toBeDefined()
})
it('Whitelisted member', async () => {
useMyMemberships.setActive(alice)
renderComponent({ ...baseThread, mode: 'closed', whitelistIds: ['111', '13', '0'] })
- expect(
- screen.queryByText(
- 'The discussion of this proposal is closed; only members whitelisted by the proposer can comment on it.'
- )
- ).toBeNull()
- expect(screen.queryByText('Please select your council membership to post in this thread.')).toBeNull()
+ expect(await screen.queryByText(/${strings.isClosed}/i)).toBeNull()
+ expect(await screen.queryByText(strings.selectCouncilor)).toBeNull()
expect(await getButton('Create post')).toBeDefined()
})
it('Whitelisted member not selected', async () => {
renderComponent({ ...baseThread, mode: 'closed', whitelistIds: ['111', '13', '0'] })
- expect(await screen.findByText('Please select a whitelisted membership to post in this thread.')).toBeDefined()
+ expect(await screen.queryByText(/${strings.isClosed}/i)).toBeNull()
+ expect(await screen.queryByText(/${strings.selectWhitelisted}/i)).toBeDefined()
})
it('Council member', async () => {
useMyMemberships.setActive(councillor)
renderComponent({ ...baseThread, mode: 'closed', whitelistIds: ['111'] })
- expect(
- screen.queryByText(
- 'The discussion of this proposal is closed; only members whitelisted by the proposer can comment on it.'
- )
- ).toBeNull()
- expect(screen.queryByText('Please select your council membership to post in this thread.')).toBeNull()
+ expect(screen.queryByText(/${strings.isClosed}/i)).toBeNull()
+ expect(screen.queryByText(strings.selectCouncilor)).toBeNull()
expect(await getButton('Create post')).toBeDefined()
})
it('Council member not selected', async () => {
useMyMemberships.members = [councillor]
renderComponent({ ...baseThread, mode: 'closed', whitelistIds: ['111'] })
- expect(await screen.findByText('Please select your council membership to post in this thread.')).toBeDefined()
+ expect(await screen.findByText(strings.selectCouncilor)).toBeDefined()
})
describe('User has both a council and a whitelisted membership', () => {
@@ -99,12 +96,8 @@ describe('UI: Proposal discussion', () => {
useMyMemberships.members = [alice, councillor]
useMyMemberships.setActive(councillor)
renderComponent({ ...baseThread, mode: 'closed', whitelistIds: ['0'] })
- expect(
- screen.queryByText(
- 'The discussion of this proposal is closed; only members whitelisted by the proposer can comment on it.'
- )
- ).toBeNull()
- expect(screen.queryByText('Please select your council membership to post in this thread.')).toBeNull()
+ expect(screen.queryByText(/${strings.isClosed}/i)).toBeNull()
+ expect(screen.queryByText(strings.selectCouncilor)).toBeNull()
expect(await getButton('Create post')).toBeDefined()
})
@@ -112,24 +105,16 @@ describe('UI: Proposal discussion', () => {
useMyMemberships.members = [alice, councillor]
useMyMemberships.setActive(alice)
renderComponent({ ...baseThread, mode: 'closed', whitelistIds: ['0'] })
- expect(
- screen.queryByText(
- 'The discussion of this proposal is closed; only members whitelisted by the proposer can comment on it.'
- )
- ).toBeNull()
- expect(screen.queryByText('Please select your council membership to post in this thread.')).toBeNull()
+ expect(screen.queryByText(strings.isClosed)).toBeNull()
+ expect(screen.queryByText(strings.selectCouncilor)).toBeNull()
expect(await getButton('Create post')).toBeDefined()
})
it('Neither member selected', async () => {
useMyMemberships.members = [alice, councillor]
renderComponent({ ...baseThread, mode: 'closed', whitelistIds: ['0'] })
- expect(
- screen.queryByText(
- 'The discussion of this proposal is closed; only members whitelisted by the proposer can comment on it.'
- )
- ).toBeNull()
- expect(await screen.findByText('Please select your council membership to post in this thread.')).toBeDefined()
+ expect(screen.queryByText(/${strings.isClosed}/i)).toBeNull()
+ expect(await screen.findByText(strings.selectCouncilor)).toBeDefined()
expect(screen.queryByText('Create post')).toBeNull()
})
})
@@ -139,11 +124,7 @@ describe('UI: Proposal discussion', () => {
it('Member selected', async () => {
useMyMemberships.setActive(alice)
renderComponent({ ...baseThread })
- expect(
- screen.queryByText(
- 'The discussion of this proposal is closed; only members whitelisted by the proposer can comment on it.'
- )
- ).toBeNull()
+ expect(screen.queryByText(/${strings.isClosed}/i)).toBeNull()
expect(await getButton('Create post')).toBeDefined()
})
diff --git a/packages/ui/test/working-groups/modals/ChangeAccountModal.test.tsx b/packages/ui/test/working-groups/modals/ChangeAccountModal.test.tsx
index 79ac7e61a3..aab4a70c22 100644
--- a/packages/ui/test/working-groups/modals/ChangeAccountModal.test.tsx
+++ b/packages/ui/test/working-groups/modals/ChangeAccountModal.test.tsx
@@ -34,8 +34,6 @@ import {
import { WORKER as worker } from '../../_mocks/working-groups'
import { mockUseModalCall } from '../../setup'
-
-
describe('UI: ChangeRoleModal', () => {
const api = stubApi()
diff --git a/packages/ui/test/working-groups/modals/LeaveRoleModal.test.tsx b/packages/ui/test/working-groups/modals/LeaveRoleModal.test.tsx
index 3ab3922f91..871e3f121c 100644
--- a/packages/ui/test/working-groups/modals/LeaveRoleModal.test.tsx
+++ b/packages/ui/test/working-groups/modals/LeaveRoleModal.test.tsx
@@ -33,8 +33,6 @@ import {
} from '../../_mocks/transactions'
import { WORKER } from '../../_mocks/working-groups'
-
-
const mockUseModal: UseModal = {
modal: null,
modalData: { workerId: 'forumWorkingGroup-1' },