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.5.1 #4481

Merged
merged 26 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d46fce3
🗝️ Fix `opening:create` on the liberated chain (#4383)
thesan Jun 5, 2023
def2999
🩹 Address some slow or inconsistent tests (#4368)
thesan Jun 5, 2023
bdb8d67
⬆️ Upgrade to Storybook 7 (#4406)
thesan Jun 5, 2023
df46369
🧮 Sort application answers before submitting them (#4382)
thesan Jun 6, 2023
1e272f9
🪢 Merge `1.5.0` into `dev` (#4416)
thesan Jun 6, 2023
36b9aa0
⬆️ Upgrade to TypeScript 5 (#4415)
thesan Jun 9, 2023
f7918ff
Show all applicants (#4426)
traumschule Jun 12, 2023
e1b9bba
📖 POC Proposal preview page stories (#4420)
thesan Jun 13, 2023
5c3bcac
PastElectionStats: drop `round` (#4425)
traumschule Jun 13, 2023
27a9190
Fix/close confirm modal (#4431)
traumschule Jun 14, 2023
0c885ec
🧹 Cleanup the CI (#4441)
thesan Jun 16, 2023
dbe849c
Rename MoveFoundsModal to MoveFundsModal (#4408)
traumschule Jun 19, 2023
bba3aee
🧪 Add Storybook tests to the CI (#4437)
thesan Jun 19, 2023
a8edd46
🧪 POC Move the `ProposalPreview` tests to Storybook (#4446)
thesan Jun 19, 2023
06f68ac
🔧 Fix the storybook CI (#4452)
thesan Jun 21, 2023
67c6681
Hide total balance when wallet was disconected (#4442)
IlyaSmiyukha Jun 23, 2023
195f04a
📚 Add modals support in stories (#4457)
thesan Jun 24, 2023
b50855a
🚚 Move the vote for proposal modal tests to Storybook (#4458)
thesan Jun 27, 2023
cbf66b5
fix `MoveFoundsModal` (#4447) (#4448)
traumschule Jun 29, 2023
7b652c7
Update SetCouncilBudgetIncrement (#4423)
traumschule Jun 29, 2023
d203ca1
🚢 Add App stories (#4462)
thesan Jun 29, 2023
cbfaca1
🕹️ Fix controls in App stories (#4464)
thesan Jul 3, 2023
2f4d5ca
📖 Add stories for the current and past proposals pages (#4465)
thesan Jul 4, 2023
87bf9c3
🧮 Reduce fee re-calculation in `AddNewProposalModal` (#4469)
thesan Jul 18, 2023
c2416dc
🤯 Refactor add new proposal tests (#4473)
thesan Jul 18, 2023
6ca0093
Update changelog for release `1.5.1`
thesan Jul 21, 2023
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
7 changes: 2 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,8 @@
{
"groups": ["builtin", "external", "parent", ["index", "sibling"]],
"pathGroups": [
{
"pattern": "@/**",
"group": "external",
"position": "after"
}
{ "pattern": "@test/**", "position": "after", "group": "builtin" },
{ "pattern": "@/**", "position": "after", "group": "external" }
],
"pathGroupsExcludedImportTypes": ["builtin"],
"newlines-between": "always",
Expand Down
154 changes: 141 additions & 13 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,154 @@
name: CI

on:
push:
branches:
- main
push: { branches: [dev, main] }
pull_request:

jobs:
test:
install:
timeout-minutes: 10
strategy:
matrix: { node: ["18.x"], os: [ubuntu-latest] }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- if: ${{ steps.yarn-cache.outputs.cache-hit != 'true' }}
name: Install dependencies
run: yarn --immutable

ui-unit-tests:
needs: install
timeout-minutes: 60
strategy:
matrix: { node: ["18.x"], os: [ubuntu-latest] }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn --immutable

- name: Verify linting
run: yarn lint

- name: Build Pioneer
run: yarn build

- name: Run tests
run: node --max_old_space_size=7000 --expose-gc $(yarn bin jest) --logHeapUsage --silent
working-directory: packages/ui

interaction-tests:
needs: install
timeout-minutes: 60
strategy:
matrix:
node: ['14.x']
os: [ubuntu-latest]
matrix: { node: ["18.x"], os: [ubuntu-latest] }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn build
- run: yarn ci-test --silent

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn --immutable

- name: Install Playwright
run: npx playwright install --with-deps

- name: Get the Storybook preview deployment url
run: |
if [ "$PREFIX" == 'git-fork' ]; then
BRANCH=$(echo -n '${{ env.LABEL }}' | sed 's/:/-/')
else
BRANCH=$(echo -n '${{ env.LABEL }}' | cut -d ':' -f2-)
fi

URL_BRANCH=$(echo -n "$BRANCH" | tr -d '#' | tr -c '[:alnum:]' '-' | tr '[:upper:]' '[:lower:]')
SUBDOMAIN="${{ env.PROJECT }}-${{ env.PREFIX }}-$URL_BRANCH-joystream"

if [ ${#SUBDOMAIN} -gt 63 ]; then
HASH=$(echo -n "${{ env.PREFIX }}-${BRANCH}${{ env.PROJECT }}" | sha256sum | head -c 6)
SUBDOMAIN="$(echo -n "$SUBDOMAIN" | head -c 46)-$HASH-joystream"
fi

echo "VERCEL_DEPLOYMENT_URL=$SUBDOMAIN.vercel.app" >> "$GITHUB_ENV"
env:
PROJECT: pioneer-2-storybook
PREFIX: ${{ github.event.pull_request.head.repo.fork && 'git-fork' || 'git' }}
LABEL: ${{ github.event.pull_request.head.label || github.ref_name }}

- name: Wait for the deployment to complete
run: |
while true; do
RES=$(curl -L 'https://api.vercel.com/v13/deployments/${{ env.VERCEL_DEPLOYMENT_URL }}')
STATUS=$(echo -n "$RES" | jq -r '.status')
SHA=$(echo -n "$RES" | jq -r '.meta.githubCommitSha')


if [ "$SHA" == 'null' ] || [ "$STATUS" == 'null' ]; then
echo -e "\nError the JSON response is missing expected fields:\n\n$RES\n" >&2
exit 5
fi

if [ "$SHA" == '${{ env.COMMIT_SHA }}' ] && [ "$STATUS" == 'READY' ]; then
exit 0
fi

echo -e '\nWait for the Storybook deployment...\n\n'
sleep 20
done
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Run Storybook tests
run: yarn workspace @joystream/pioneer test-storybook
env:
TARGET_URL: https://${{ env.VERCEL_DEPLOYMENT_URL }}
37 changes: 0 additions & 37 deletions .github/workflows/gh-pages.yml

This file was deleted.

15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.5.1] - 2023-07-25

### Fixed
- Do not ask for confirmation to close transaction success modals.
- Correctly match questions and answers in opening application pages.
- Do not keep showing the total balance after disconnecting a wallet.
- Show all applicants on closed opening pages.

### Changed
- Clarify the label copy of the council budget increment proposal input field.
- Just show past elections cycle id without "round".

## [1.5.0] - 2023-06-06

### Added
Expand Down Expand Up @@ -161,7 +173,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.0...HEAD
[unreleased]: https://github.com/Joystream/pioneer/compare/v1.5.1...HEAD
[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
[1.3.2]: https://github.com/Joystream/pioneer/compare/v1.3.1...v1.3.2
Expand Down
6 changes: 4 additions & 2 deletions docs/mocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ To test most of the extrinsics requires existing on-chain data. To create some o

Available commands:

- `yarn workspace @joystream/pioneer node-mocks council:elect [-d BLOCK_TIME] [--to ELECTION_STAGE]` - Run an election until the specified stage: VOTE, REVEAL, or IDLE (default)
- `yarn workspace @joystream/pioneer node-mocks council:elect [-d BLOCK_TIME¹] [--to ELECTION_STAGE]` - Run an election until the specified stage: VOTE, REVEAL, or IDLE (default)
- `yarn workspace @joystream/pioneer node-mocks council:announce` - Announce enough candidacies to start the voting stage when the announcing stage ends
- `yarn workspace @joystream/pioneer node-mocks council:vote` - Vote for the announced by the previous command candidate to start the revealing stage next
- `yarn workspace @joystream/pioneer node-mocks council:reveal` - Reveal the votes casted by the previous command to start elect a new council and start the idle stage next
- `yarn workspace @joystream/pioneer node-mocks members:create` - generate memberships using query-node mocks data
- `yarn workspace @joystream/pioneer node-mocks set-budget` - Set membership Working Group budget
- `yarn workspace @joystream/pioneer node-mocks opening:create` - Create an opening
- `yarn workspace @joystream/pioneer node-mocks opening:create [-d BLOCK_TIME¹]` - Create an opening
- `yarn workspace @joystream/pioneer node-mocks opening:fill` - Fill existing opening
- `yarn workspace @joystream/pioneer node-mocks upcoming-opening:create` - Create an upcoming opening
- `yarn workspace @joystream/pioneer node-mocks forumCategory:create` - Create a forum category
- `yarn workspace @joystream/pioneer node-mocks transfer` - Transfer tokens between accounts

**(¹)** `BLOCK_TIME` is the time between each block. It is 6000ms by default but on testing chain it is 1000ms. Therefore when running some of the scripts on these testing chain `-d 1000` should be added for the command to succeed.

To show help:

```shell
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"build:storybook": "wsrun --fast-exit --stages -c --exclude @joystream/pioneer --exclude-missing build && wsrun --package @joystream/pioneer -c build:storybook",
"storybook": "wsrun --exclude-missing -c storybook",
"test": "wsrun --fast-exit --package @joystream/pioneer -c test",
"ci-test": "NODE_OPTIONS=--max_old_space_size=7000 wsrun --fast-exit --package @joystream/pioneer -c test",
"start": "wsrun --package @joystream/pioneer -c start",
"prepare": "husky install"
},
Expand All @@ -31,6 +30,12 @@
"lint-staged": ">=10"
},
"resolutions": {
"@babel/core": "~7.21.0",
"@babel/preset-env": "~7.21.0",
"@babel/generator": "~7.21.0",
"@babel/parser": "~7.21.0",
"@babel/traverse": "~7.21.0",
"@babel/types": "~7.21.0",
"@polkadot/api": "8.9.1",
"@polkadot/api-contract": "8.9.1",
"@polkadot/api-derive": "8.9.1",
Expand Down
8 changes: 4 additions & 4 deletions packages/markdown-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
"@ckeditor/ckeditor5-dev-webpack-plugin": "^25.4.5",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"prettier": "^2.4.1",
"prettier": "^2.8.8",
"raw-loader": "^4.0.2",
"terser-webpack-plugin": "^5.2.5",
"ts-loader": "^9.2.6",
"ts-node": "^10.4.0",
"typescript": "4.4.3",
"webpack": "^5.64.1",
"webpack-cli": "^4.9.1"
"typescript": "5",
"webpack": "5",
"webpack-cli": "5"
}
}
9 changes: 9 additions & 0 deletions packages/ui/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const baseConfig = require('../../.eslintrc.json')

const config = {
...baseConfig,
extends: ['plugin:storybook/recommended'],
}

const domains = ['accounts', 'memberships', 'working-groups']
Expand All @@ -26,6 +27,14 @@ config.rules['import/no-restricted-paths'] = [
},
]

config.overrides = [
...config.overrides,
{
files: ['**/*.stories.tsx'],
rules: { 'react-hooks/rules-of-hooks': 'off' },
},
]

config.ignorePatterns = [...config.ignorePatterns, 'src/bounty/**/*', 'test/bounty/**/*']

module.exports = config
14 changes: 8 additions & 6 deletions packages/ui/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = {
{
alias: {
'@/common/utils/crypto/worker$': path.resolve(__dirname, '../src/common/utils/crypto'),
'@apollo/client$': path.resolve(__dirname, '../src/mocks/providers/query-node'),
},
},
shared.resolve
Expand All @@ -31,20 +32,21 @@ module.exports = {

return config
},
core: {
builder: 'webpack5',
framework: {
name: '@storybook/react-webpack5',
options: {},
},
typescript: {
reactDocgen: 'none',
},
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(ts|tsx)'],
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-actions'],
stories: ['../src/**/*.stories.@(ts|tsx)'],
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions', '@storybook/addon-links'],
}

function isCssRule(rule) {
return rule.test.toString().indexOf('css') > -1
return rule.test?.toString().includes('css')
}

function isSvgRule(rule) {
return rule.test.toString().indexOf('svg') > -1
return rule.test?.toString().includes('svg')
}
Loading