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

🚀 Release 1.9.0 #4617

Merged
merged 7 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.9.0] - 2023-11-03

### Added
- Linkedin to membership social profile

### Fixed
- Proposal history blocks styles.
- Past election total staked value.
- Past election "My contributed votes value".

## [1.8.0] - 2023-10-13

### Added
Expand Down Expand Up @@ -205,7 +215,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.8.0...HEAD
[unreleased]: https://github.com/Joystream/pioneer/compare/v1.9.0...HEAD
[1.9.0]: https://github.com/Joystream/pioneer/compare/v1.8.0...v1.9.0
[1.8.0]: https://github.com/Joystream/pioneer/compare/v1.7.0...v1.8.0
[1.7.0]: https://github.com/Joystream/pioneer/compare/v1.6.0...v1.7.0
[1.6.0]: https://github.com/Joystream/pioneer/compare/v1.5.1...v1.6.0
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@joystream/pioneer",
"version": "1.8.0",
"version": "1.9.0",
"license": "GPL-3.0-only",
"scripts": {
"build": "node --max_old_space_size=4096 ./build.js",
Expand All @@ -27,7 +27,7 @@
"@hcaptcha/react-hcaptcha": "^1.4.4",
"@joystream/js": "1.2.0",
"@joystream/markdown-editor": "^0.1.0",
"@joystream/metadata-protobuf": "^2.0.0",
"@joystream/metadata-protobuf": "^2.10.0",
"@joystream/types": "^2.0.0",
"@nivo/bar": "^0.79.1",
"@nivo/core": "^0.79.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export const PastElections = () => {
<PastElectionsListHeaders $colLayout={PastElectionsColLayout}>
<SortHeader {...getSortProps('cycleId')}>Round</SortHeader>
<SortHeader {...getSortProps('updatedAt')}>Election ended at</SortHeader>
<ListHeader>Total staked</ListHeader>
<ListHeader>Total Candidates staked</ListHeader>
<ListHeader>Total Votes staked</ListHeader>
<ListHeader>Revealed votes</ListHeader>
<ListHeader>Total candidates</ListHeader>
</PastElectionsListHeaders>
Expand All @@ -65,7 +66,7 @@ export const PastElections = () => {
return <PageLayout header={header} main={displayMain()} />
}

export const PastElectionsColLayout = '48px 176px 156px 100px 100px'
export const PastElectionsColLayout = '48px 176px 140px 140px 100px 100px'

const PastElectionsListHeaders = styled(ListHeaders)`
grid-column-gap: 24px;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/ui/src/common/api/schemas/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ enum MembershipExternalResourceType {
IRC
WECHAT
WHATSAPP
LINKEDIN
}

type MemberMetadata implements BaseGraphQLObject {
Expand Down

This file was deleted.

28 changes: 0 additions & 28 deletions packages/ui/src/common/components/BlockTime/BlockHistoryLine.tsx

This file was deleted.

1 change: 1 addition & 0 deletions packages/ui/src/common/components/BlockTime/BlockInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const BlockInfo = ({ block, lessInfo, inline }: BlockInfoProp) => {
const [endpoints] = useNetworkEndpoints()
return (
<BlockLink
onClick={(evt) => evt.stopPropagation()}
href={`https://polkadot.js.org/apps/?rpc=${endpoints.nodeRpcEndpoint}/ws-rpc#/explorer/query/${block.number}`}
>
<BlockInfoContainer lessInfo={lessInfo} inline={inline}>
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/common/components/BlockTime/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './BlockHistoryLine'
export * from './BlockTime'
4 changes: 2 additions & 2 deletions packages/ui/src/common/components/Stepper/Stepper.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Meta, Story } from '@storybook/react'
import React from 'react'

import { BlockHistoryLine } from '@/common/components/BlockTime'
import { BlockTime } from '@/common/components/BlockTime'
import { TemplateBlock } from '@/common/components/storybookParts/previewStyles'
import { randomBlock } from '@/mocks/helpers/randomBlock'

Expand Down Expand Up @@ -32,7 +32,7 @@ Simple.args = {
],
}

const details = <BlockHistoryLine block={randomBlock()} />
const details = <BlockTime block={randomBlock()} layout="reverse-start" lessInfo />
export const History = Template.bind({})
History.args = {
theme: 'dark',
Expand Down
9 changes: 9 additions & 0 deletions packages/ui/src/common/components/icons/socials/Linkedin.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react'

export const LinkedinIcon = ({ className }: { className?: string }) => {
return (
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" className={className}>
<path d="M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z" />
</svg>
)
}
1 change: 1 addition & 0 deletions packages/ui/src/common/components/icons/socials/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ export * from './Telegram'
export * from './Youtube'
export * from './Wechat'
export * from './Whatsapp'
export * from './Linkedin'
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { useMemo, useState } from 'react'
import { useMyAccounts } from '@/accounts/hooks/useMyAccounts'
import { Account } from '@/accounts/types'
import { TabProps, Tabs } from '@/common/components/Tabs'
import { sumStakes } from '@/common/utils/bn'
import { CandidateVoteList } from '@/council/components/election/CandidateVote/CandidateVoteList'
import { electionVotingResultComparator } from '@/council/model/electionVotingResultComparator'
import { ElectionVotingResult, PastElectionWithDetails } from '@/council/types/PastElection'
Expand Down Expand Up @@ -52,17 +53,20 @@ export const PastElectionTabs = ({ election }: PastElectionTabsProps) => {
<CandidateVoteList
votes={votingResults.map((votingResult, index) => {
const myVote = getMyVote(votingResult, allAccounts)
const myVotesTmp = votingResult.votes.filter((vote) =>
allAccounts.some((otherObj) => otherObj.address === vote.castBy)
)

return {
candidateId: votingResult.candidate.id,
revealed: !!myVote,
member: votingResult.candidate.member,
sumOfAllStakes: votingResult.totalStake,
totalStake: election.totalStake,
totalStake: election.totalVoteStake,
votes: votingResult.votes.length,
index: index + 1,
myVotes: [],
myStake: myVote?.stake,
myStake: sumStakes(myVotesTmp),
}
})}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export const PastElectionsListRow = ({ election }: PastElectionsListRowProps) =>
) : (
<></>
)}
<TokenValue value={election.totalStake} />
<TokenValue value={election.totalCandidatesStake} />
<TokenValue value={election.totalVoteStake} />
<Fraction numerator={election.revealedVotes} denominator={election.totalVotes} sameSize />
<CountInfo count={election.totalCandidates} />
</PastElectionsListRowItem>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/ui/src/council/queries/council.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ fragment PastElectionRoundFields on ElectionRound {
}
castVotes {
voteForId
stake
}
}

Expand Down
7 changes: 4 additions & 3 deletions packages/ui/src/council/types/PastElection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ export interface PastElection {
id: string
cycleId: number
finishedAtBlock?: Block
totalStake: BN
totalCandidatesStake: BN
totalCandidates: number
revealedVotes: number
totalVotes: number
totalVoteStake: BN
}

export interface PastElectionWithDetails extends PastElection {
Expand All @@ -30,17 +31,17 @@ export const asPastElection = (fields: PastElectionRoundFieldsFragment): PastEle
id: fields.id,
cycleId: fields.cycleId,
finishedAtBlock: maybeAsBlock(fields.endedAtBlock, fields.endedAtTime, fields.endedAtNetwork),
totalStake: sumStakes(fields.candidates),
totalCandidatesStake: sumStakes(fields.candidates),
totalCandidates: fields.candidates.length,
revealedVotes: fields.castVotes.filter((castVote) => castVote.voteForId).length,
totalVotes: fields.castVotes.length,
totalVoteStake: sumStakes(fields.castVotes),
})

export const asPastElectionWithDetails = (
fields: PastElectionRoundDetailedFieldsFragment
): PastElectionWithDetails => ({
...asPastElection(fields),
totalStake: sumStakes(fields.castVotes),
votingResults: fields.candidates.map((candidate) => {
const candidateVotes = fields.castVotes.filter(({ voteForId }) => voteForId === candidate.id)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const searchFilterOptions: MemberSearchFilter[] = [
'Wechat',
'Whatsapp',
'Youtube',
'Linkedin',
]

export interface MemberListFiltersProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const socialToPlaceholder: Record<Socials, string> = {
TELEGRAM: 'Enter Username',
TWITTER: 'Enter Username',
EMAIL: 'Enter Email',
LINKEDIN: 'Enter Username',
}

interface Props {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const socialToPlaceholder: Record<Socials, string> = {
TELEGRAM: 'Enter Username',
TWITTER: 'Enter Username',
EMAIL: 'Enter Email',
LINKEDIN: 'Enter Username',
}

interface Props {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
WhatsappIcon,
YoutubeIcon,
TelegramIcon,
LinkedinIcon,
} from '@/common/components/icons/socials'
import { RowGapBlock } from '@/common/components/page/PageContent'
import { TextMedium } from '@/common/components/typography'
Expand All @@ -34,6 +35,7 @@ export const socialToIcon: Record<Socials, React.ReactElement> = {
WECHAT: <WechatIcon />,
WHATSAPP: <WhatsappIcon />,
HYPERLINK: <CustomLinkIcon />,
LINKEDIN: <LinkedinIcon />,
}

export const socialMediaList = Object.keys(socialToIcon) as (keyof typeof socialToIcon)[]
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/proposals/components/ProposalHistory.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useMemo } from 'react'

import { BlockHistoryLine } from '@/common/components/BlockTime'
import { BlockTime } from '@/common/components/BlockTime'
import { RowGapBlock } from '@/common/components/page/PageContent'
import { Stepper, StepperStep } from '@/common/components/Stepper'
import { Label } from '@/common/components/typography'
Expand All @@ -24,7 +24,7 @@ export const ProposalHistory = ({ proposal }: ProposalHistoryProps) => {
return steps.map(({ status, inBlock }, index) => ({
title: status,
type: index === steps.length - 1 ? 'active' : 'past',
details: <BlockHistoryLine block={inBlock} />,
details: <BlockTime block={inBlock} layout="reverse-start" lessInfo />,
}))
}, [proposal.id])

Expand Down
20 changes: 18 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3623,7 +3623,23 @@ __metadata:
languageName: unknown
linkType: soft

"@joystream/metadata-protobuf@npm:^2.0.0, @joystream/metadata-protobuf@npm:^2.6.0":
"@joystream/metadata-protobuf@npm:^2.10.0":
version: 2.10.0
resolution: "@joystream/metadata-protobuf@npm:2.10.0"
dependencies:
"@types/iso-3166-2": ^1.0.0
"@types/long": ^4.0.1
google-protobuf: ^3.14.0
i18n-iso-countries: ^6.8.0
iso-3166-2: ^1.0.0
iso-639-1: ^2.1.9
long: ^4.0.0
protobufjs: ^6.11.2
checksum: 4b56f02d6863d6f1e1cd91075606666224338066c078e77cb2b3bac090dc535a740279711106778c666befa8abc8b08b3f11bedf9b5e8c96f14d92887c8cc3ed
languageName: node
linkType: hard

"@joystream/metadata-protobuf@npm:^2.6.0":
version: 2.6.0
resolution: "@joystream/metadata-protobuf@npm:2.6.0"
dependencies:
Expand Down Expand Up @@ -3657,7 +3673,7 @@ __metadata:
"@jest/types": ^27.2.5
"@joystream/js": 1.2.0
"@joystream/markdown-editor": ^0.1.0
"@joystream/metadata-protobuf": ^2.0.0
"@joystream/metadata-protobuf": ^2.10.0
"@joystream/types": ^2.0.0
"@miragejs/graphql": ^0.1.13
"@nivo/bar": ^0.79.1
Expand Down