Skip to content

Commit

Permalink
🚀 Release 1.6.0 (#4512)
Browse files Browse the repository at this point in the history
  • Loading branch information
thesan authored Sep 1, 2023
2 parents 3b1eeb6 + c6ff23a commit 35ff3ff
Show file tree
Hide file tree
Showing 43 changed files with 1,727 additions and 76 deletions.
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.6.0] - 2023-09-01

### Added
- Multiple recipient funding request proposal creation.

### Fixed
- Forum category page reloading multiple time on opening.
- Broken links to members on forum posts.
- Reduce the amount of queries from the forum category page.

### Changed
- Display amount staked by voting for a council candidate instead of their candidacy stake when applicable.

## [1.5.1] - 2023-07-25

### Fixed
Expand Down Expand Up @@ -173,7 +186,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.5.1...HEAD
[unreleased]: https://github.com/Joystream/pioneer/compare/v1.6.0...HEAD
[1.6.0]: https://github.com/Joystream/pioneer/compare/v1.5.1...v1.6.0
[1.5.1]: https://github.com/Joystream/pioneer/compare/v1.5.0...v1.5.1
[1.5.0]: https://github.com/Joystream/pioneer/compare/v1.4.0...v1.5.0
[1.4.0]: https://github.com/Joystream/pioneer/compare/v1.3.2...v1.4.0
Expand Down
15 changes: 15 additions & 0 deletions packages/ui/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import { ModalContextProvider } from '../src/common/providers/modal/provider'
import { TransactionStatusProvider } from '../src/common/providers/transactionStatus/provider'
import { MockProvidersDecorator, MockRouterDecorator } from '../src/mocks/providers'
import { i18next } from '../src/services/i18n'
import { KeyringContext } from '../src/common/providers/keyring/context'
import { Keyring } from '@polkadot/ui-keyring'


configure({ testIdAttribute: 'id' })

Expand Down Expand Up @@ -64,11 +67,23 @@ const ModalDecorator: Decorator = (Story) => (
</TransactionStatusProvider>
)

const KeyringDecorator: Decorator = (Story) => {
const keyring = {
encodeAddress: (address: string) => address,
decodeAddress: (address: string) => {
if (!/^[A-HJ-NP-Za-km-z1-9]{10,}$/.test(address)) throw new Error('Invalid address')
else return address
},
} as unknown as Keyring
return <KeyringContext.Provider value={keyring}><Story /></KeyringContext.Provider>
}

export const decorators = [
ModalDecorator,
stylesWrapperDecorator,
i18nextDecorator,
RHFDecorator,
KeyringDecorator,
MockProvidersDecorator,
MockRouterDecorator,
]
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.4.0",
"version": "1.6.0",
"license": "GPL-3.0-only",
"scripts": {
"build": "node --max_old_space_size=4096 ./build.js",
Expand Down
12 changes: 1 addition & 11 deletions packages/ui/src/app/pages/Forum/ForumCategory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import { PageTitle } from '@/common/components/page/PageTitle'
import { PreviousPage } from '@/common/components/page/PreviousPage'
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'
import { MILLISECONDS_PER_BLOCK } from '@/common/model/formatters'
import { ForumCategoryList } from '@/forum/components/category/ForumCategoryList'
import { ForumPageHeader } from '@/forum/components/ForumPageHeader'
import { ThreadFilters } from '@/forum/components/threads/ThreadFilters'
Expand Down Expand Up @@ -48,17 +46,9 @@ export const ForumCategory = () => {
},
{ perPage: THREADS_PER_PAGE, page }
)
const isRefetched = useRefetchQueries({
interval: MILLISECONDS_PER_BLOCK,
include: ['GetForumThreads', 'GetForumThreadsCount'],
})

const { showModal } = useModal()

if (isLoadingThreads && !isRefetched) {
return <Loading />
}

if (isLoadingCategory) {
return <Loading />
}
Expand Down Expand Up @@ -126,7 +116,7 @@ export const ForumCategory = () => {
<ThreadList
threads={threads}
getSortProps={getSortProps}
isLoading={isLoadingThreads && !isRefetched}
isLoading={isLoadingThreads}
isArchive={isArchive}
page={page}
pageCount={threadCount && Math.ceil(threadCount / THREADS_PER_PAGE)}
Expand Down
89 changes: 89 additions & 0 deletions packages/ui/src/app/pages/Proposals/CurrentProposals.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,95 @@ export const SpecificParametersFundingRequest: Story = {
}),
}

export const SpecificParametersMultipleFundingRequest: Story = {
play: specificParametersTest('Funding Request', async ({ args, createProposal, modal, step }) => {
const bob = member('bob')
const charlie = member('charlie')
await createProposal(async () => {
const nextButton = getButtonByText(modal, 'Create proposal')
expect(nextButton).toBeDisabled()

await userEvent.click(modal.getByTestId('pay-multiple'))

const csvField = modal.getByTestId('accounts-amounts')

// Invalid
await userEvent.clear(csvField)
await userEvent.type(csvField, `${alice.controllerAccount},500${bob.controllerAccount},500`)
expect(await modal.findByText(/Not valid CSV format/))
// ensure its not being open-able while the CSV syntax is valid
const previewButton = getButtonByText(modal, 'Preview and Validate')
expect(previewButton).toBeDisabled()
await waitFor(() => expect(modal.queryByTestId('sidePanel-overlay')).toBeNull())
expect(nextButton).toBeDisabled()

// Invalid Accounts error
await userEvent.clear(csvField)
await userEvent.type(csvField, `5GNJqTPy,500\n${bob.controllerAccount},500`)

await waitFor(() => expect(modal.queryByText(/Not valid CSV format/)).toBeNull())
expect(await modal.findByText(/Please preview and validate the inputs to proceed/))
expect(nextButton).toBeDisabled()
expect(previewButton).toBeEnabled()

await userEvent.click(previewButton)
expect(await modal.findByText(/Incorrect destination accounts detected/))
await userEvent.click(modal.getByTestId('sidePanel-overlay'))

// Max Amount error
await userEvent.clear(csvField)
await userEvent.type(csvField, `${alice.controllerAccount},166667\n${bob.controllerAccount},500`)
expect(await modal.findByText(/Please preview and validate the inputs to proceed/))
expect(nextButton).toBeDisabled()
await waitFor(() => expect(previewButton).toBeEnabled())
await userEvent.click(previewButton)
expect(await modal.findByText(/Max payment amount is exceeded/))
await userEvent.click(modal.getByTestId('sidePanel-overlay')) //ensure create proposal is still disabled
expect(nextButton).toBeDisabled()

// Max Allowed Accounts error
await userEvent.clear(csvField)
await userEvent.type(
csvField,
`${alice.controllerAccount},400\n${bob.controllerAccount},500\n${charlie.controllerAccount},500`
)
expect(await modal.findByText(/Please preview and validate the inputs to proceed/))
expect(nextButton).toBeDisabled()
await waitFor(() => expect(previewButton).toBeEnabled())
await userEvent.click(previewButton)
expect(await modal.findByText(/Maximum allowed accounts exceeded/))
await userEvent.click(modal.getByTestId('sidePanel-overlay')) //ensure create proposal is still disabled
expect(nextButton).toBeDisabled()

// delete one account from the list'
await waitFor(() => expect(previewButton).toBeEnabled())
await userEvent.click(previewButton)
await userEvent.click(modal.getByTestId('removeAccount-2'))
await waitFor(() => expect(modal.queryByText(/Maximum allowed accounts exceeded/)).toBeNull())
await userEvent.click(modal.getByTestId('sidePanel-overlay'))

// Valid
await userEvent.clear(csvField)
await userEvent.type(csvField, `${alice.controllerAccount},500\n${bob.controllerAccount},500`)
expect(nextButton).toBeDisabled()

await waitFor(() => expect(previewButton).toBeEnabled())
await userEvent.click(previewButton)
await userEvent.click(modal.getByTestId('sidePanel-overlay'))
})

step('Transaction parameters', () => {
const [, specificParameters] = args.onCreateProposal.mock.calls.at(-1)
expect(specificParameters.toJSON()).toEqual({
fundingRequest: [
{ account: alice.controllerAccount, amount: 500_0000000000 },
{ account: bob.controllerAccount, amount: 500_0000000000 },
],
})
})
}),
}

export const SpecificParametersSetReferralCut: Story = {
play: specificParametersTest('Set Referral Cut', async ({ args, createProposal, modal, step }) => {
await createProposal(async () => {
Expand Down
Loading

1 comment on commit 35ff3ff

@vercel
Copy link

@vercel vercel bot commented on 35ff3ff Sep 1, 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 – ./

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

Please sign in to comment.