Skip to content

Commit

Permalink
🚀 Release 1.1.0 (#4001)
Browse files Browse the repository at this point in the history
  • Loading branch information
thesan authored Jan 6, 2023
2 parents 7e501b1 + 978b97a commit d659bb6
Show file tree
Hide file tree
Showing 58 changed files with 289 additions and 193 deletions.
34 changes: 33 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
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": "1.0.0",
"version": "1.1.0",
"license": "GPL-3.0-only",
"scripts": {
"build": "node --max_old_space_size=4096 ./build.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@ 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 (
<LockItem
lock={lock}
address={address}
isRecoverable={isRecoverable}
createdInEvent={createdInEvent}
lockRecovery={{ unrecoverableLabel: 'Unrecoverable' }}
lockRecovery={recoveryInfo}
/>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const ClaimVestingModal = () => {
<InputComponent
inputSize="l"
validation={canAfford ? undefined : 'invalid'}
message={canAfford ? '' : 'Insufficient balance to cover fee.'}
message={isReady ? (canAfford ? '' : 'Insufficient balance to cover fee.') : ''}
>
<SelectVestingAccount selected={selectedAccount} onChange={setSelectedAccount} />
</InputComponent>
Expand Down
7 changes: 6 additions & 1 deletion packages/ui/src/app/pages/Forum/ForumCategory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -73,6 +73,11 @@ export const ForumCategory = () => {
<PageTitle>{category.title}</PageTitle>
</PreviousPage>
}
description={
<TextMedium className="category-description" normalWeight inter lighter truncateLines={2}>
{category.description}
</TextMedium>
}
buttons={
<TransactionButton
style="primary"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/app/pages/Forum/ForumThread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const ForumThread = () => {
{tag.title}
</BadgeStatus>
))}
<BlockTime block={thread.createdInBlock} />
<BlockTime block={thread.createdInBlock} layout="reverse" position="end" />
</BadgesRow>
</RowGapBlock>
</PageHeaderWrapper>
Expand Down
14 changes: 5 additions & 9 deletions packages/ui/src/app/pages/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const Settings = () => {
const [currentTab, setCurrentTab] = useState<Tab>('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) {
Expand All @@ -54,7 +54,7 @@ export const Settings = () => {
<MainPanel>
<RowGapBlock gap={32}>
<Tabs tabsSize="xs" tabs={tabs} />
{currentTab === 'LANGUAGE' && <LanguageSelect />}
{/**currentTab === 'LANGUAGE' && <LanguageSelect />**/}
{currentTab === 'SETTINGS' && (
<>
<SimpleSelect
Expand All @@ -81,17 +81,13 @@ export const Settings = () => {
<PolkadotAppInfo rpcUrl={endpoints.nodeRpcEndpoint} />
</>
)}
<SettingsInformation icon={<WarnedIcon />} title="Chain Informations">
<SettingsInformation icon={<WarnedIcon />} title={t('chainInfo')}>
<ColumnGapBlock gap={5}>
<TextMedium lighter bold>
RPC blockheight:{' '}
</TextMedium>
<TextMedium lighter>{t('rpcBlockheight')}</TextMedium>
<TextMedium lighter>{formatTokenValue(header?.number.toNumber())}</TextMedium>
</ColumnGapBlock>
<ColumnGapBlock gap={5}>
<TextMedium lighter bold>
QueryNode blockheight:{' '}
</TextMedium>
<TextMedium lighter>{t('qnBlockheight')}</TextMedium>
<TextMedium lighter>{formatTokenValue(queryNodeState?.indexerHead)}</TextMedium>
</ColumnGapBlock>
</SettingsInformation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export const WorkingGroupOpening = () => {
header={
<PageHeaderWrapper>
<PageHeaderRow>
<PreviousPage>
<PreviousPage customLink={WorkingGroupsRoutes.openings}>
<PageTitle>{opening.title}</PageTitle>
</PreviousPage>
<ButtonsGroup>
Expand Down Expand Up @@ -156,7 +156,9 @@ export const WorkingGroupOpening = () => {
/>
<TokenValueStat
title="Minimal stake"
tooltipText="Minimal amount of tokens required to be staked for any applicant to such role."
tooltipText="Minimum tokens free of rivalrous locks required as application stake to this role."
tooltipLinkText="Learn more"
tooltipLinkURL="https://joystream.gitbook.io/testnet-workspace/system/working-groups#staking"
value={opening.stake}
/>
<ApplicationStats applicants={opening.applicants} hiring={opening.hiring} status={opening.status} />
Expand Down
7 changes: 5 additions & 2 deletions packages/ui/src/common/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 11 additions & 3 deletions packages/ui/src/common/components/page/PreviousPage.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { History } from 'history'
import React from 'react'
import { useHistory } from 'react-router-dom'
import styled from 'styled-components'
Expand All @@ -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<unknown>, customLink?: string) => {
if (history.action === 'POP' && customLink) {
history.push(customLink)
} else {
history.goBack()
}
}
export const PreviousPage = ({ children, showOverflow, customLink }: PreviousPageProps) => {
const history = useHistory()
return (
<PreviousPageBlock showOverflow={showOverflow}>
<PreviousPageButtonContainer>
<PreviousPageButton onClick={() => history.goBack()} size="small" square>
<PreviousPageButton onClick={() => setPrevHistory(history, customLink)} size="small" square>
<BackArrow direction="left" />
</PreviousPageButton>
</PreviousPageButtonContainer>
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/src/common/constants/videoHints.ts
Original file line number Diff line number Diff line change
@@ -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: '',
}
2 changes: 2 additions & 0 deletions packages/ui/src/common/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export const wgListItemMappings = (value: string) => {
}
}
}

export const fileToDataUrl = (file: File) => {
return new Promise<string>((resolve, reject) => {
const reader = new FileReader()
Expand All @@ -109,6 +110,7 @@ export const fileToDataUrl = (file: File) => {
reader.readAsDataURL(file)
})
}

export const resizeImageFile = async (
file: File,
width: number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
<ButtonPrimary size="medium" disabled>
Revealed
</ButtonPrimary>
)

export const CandidateVote = ({
candidateId,
member,
sumOfAllStakes,
totalStake,
ownStake,
votes,
index,
myStake,
myVotes,
}: CandidateVoteProps) => {
const { showModal } = useModal()
Expand All @@ -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 = <RevealVoteButton myVotes={myVotes} voteForHandle={member.handle} />

return (
<CandidateVoteWrapper onClick={showCandidate}>
<VoteIndex lighter inter>
Expand All @@ -74,11 +82,11 @@ export const CandidateVote = ({
</StatsValue>
</StakeAndVotesRow>
<StakeAndVotesRow>
{hasOwnStake && (
{myStake?.gt(BN_ZERO) && (
<>
<Subscription>My Stake</Subscription>
<StatsValue>
<TokenValue value={ownStake} />
<TokenValue value={myStake} />
</StatsValue>
</>
)}
Expand All @@ -91,16 +99,7 @@ export const CandidateVote = ({
</StakeAndVotesRow>
</StakeAndVotesGroup>
</VoteIndicatorWrapper>
<ButtonsGroup>
{hasMyVotes &&
(allVotesRevealed ? (
<ButtonPrimary size="medium" disabled>
Revealed
</ButtonPrimary>
) : (
<RevealVoteButton myVotes={myVotes} voteForHandle={member.handle} />
))}
</ButtonsGroup>
<ButtonsGroup>{userVoted && (allVotesRevealed ? AllRevealedButton : RevealButton)}</ButtonsGroup>
<CandidateCardArrow>
<Arrow direction="right" />
</CandidateCardArrow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}))}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ export const PastElectionStats = ({
<StatisticItem title="Ended at">
{finishedAtBlock ? formatDateString(finishedAtBlock.timestamp) : '-'}
</StatisticItem>
<StatisticItem title="Election round" tooltipText="Lorem ipsum...">
<StatisticItem
title="Election round"
tooltipText="Ordinal number of the election round since the genesis block of the network."
tooltipLinkText="Learn more"
tooltipLinkURL="https://joystream.gitbook.io/testnet-workspace/system/council#election"
>
<TextHuge bold>{cycleId} round</TextHuge>
</StatisticItem>
<NumericValueStat title="Total candidates" value={totalCandidates} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
})}
/>
Expand Down
Loading

1 comment on commit d659bb6

@vercel
Copy link

@vercel vercel bot commented on d659bb6 Jan 6, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

dao – ./

dao-joystream.vercel.app
dao-git-main-joystream.vercel.app
pioneerapp.xyz
dao.joystream.org

Please sign in to comment.