Skip to content
Closed
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
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
"pioneer/packages/apps*",
"pioneer/packages/page*",
"pioneer/packages/react*",
"pioneer/packages/joy-utils",
"pioneer/packages/joy-members",
"pioneer/packages/joy-pages",
"pioneer/packages/joy-election",
"pioneer/packages/joy-proposals",
"pioneer/packages/joy-roles",
"utils/api-examples"
],
"resolutions": {
Expand Down
6 changes: 0 additions & 6 deletions pioneer/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@
**/coverage/*
**/node_modules/*
packages/old-apps/*
packages/joy-members/*
packages/joy-election/*
packages/joy-forum/*
packages/joy-help/*
packages/joy-media/*
packages/joy-pages/*
packages/joy-proposals/*
packages/joy-roles/*
packages/joy-settings/*
packages/joy-utils/*
packages/joy-utils-old/*
.eslintrc.js
i18next-scanner.config.js
12 changes: 10 additions & 2 deletions pioneer/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,22 @@ module.exports = {
rules: {
...base.rules,
'@typescript-eslint/no-explicit-any': 'off',
'react/prop-types': 'off',
'new-cap': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/ban-ts-comment': 'error',
// why only required in VSCode!?!? is eslint plugin not working like eslint commandline?
// Or are we having to add this because of new versions of eslint-config-* ?
'no-console': 'off',
'header/header': 'off' // Temporary disable polkadot's rule
// Override some extended config rules:
'camelcase': 'off',
'header/header': 'off',
'sort-keys': 'off',
'react/jsx-sort-props': 'off',
'react/jsx-max-props-per-line': 'off',
'sort-destructure-keys/sort-destructure-keys': 'off',
'@typescript-eslint/unbound-method': 'warn', // Doesn't work well with our version of Formik, see: https://github.com/formium/formik/issues/2589
'react-hooks/exhaustive-deps': 'warn', // Causes more issues than it solves currently
'no-void': 'off' // Otherwise we cannot mark unhandles promises
},
// isolate pioneer from monorepo eslint rules
root: true
Expand Down
2 changes: 1 addition & 1 deletion pioneer/.storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ config.module.rules.push({
use: [
{
loader: require.resolve('babel-loader'),
options: require('@polkadot/dev-react/config/babel')
options: require('@polkadot/dev/config/babel')
},
],
});
Expand Down
9 changes: 5 additions & 4 deletions pioneer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"test": "echo \"skipping tests\"",
"vanitygen": "node packages/app-accounts/scripts/vanitygen.js",
"start": "yarn clean && cd packages/apps && webpack --config webpack.config.js",
"generate-schemas": "json2ts -i packages/joy-types/src/schemas/role.schema.json -o packages/joy-types/src/schemas/role.schema.ts",
"build-storybook": "build-storybook -c .storybook",
"storybook": "start-storybook -s ./packages/apps/public -p 3001"
},
Expand All @@ -40,7 +39,7 @@
"@types/chart.js": "^2.9.23",
"@types/file-saver": "^2.0.1",
"@types/i18next": "^13.0.0",
"@types/jest": "^26.0.7",
"@types/jest": "^26.0.10",
"@types/react-beautiful-dnd": "^13.0.0",
"@types/react-copy-to-clipboard": "^4.3.0",
"@types/react-dom": "^16.9.8",
Expand Down Expand Up @@ -74,11 +73,13 @@
"@storybook/addon-actions": "^5.2.5",
"@storybook/addon-console": "^1.2.1",
"@storybook/react": "^5.2.5",
"json-schema-to-typescript": "^7.1.0",
"storybook-react-router": "^1.0.8",
"typescript": "^3.9.7",
"eslint-plugin-header": "^3.0.0",
"eslint-plugin-sort-destructure-keys": "^1.3.5"
"eslint-plugin-sort-destructure-keys": "^1.3.5",
"jest": "^26.4.1",
"ts-jest": "^26.2.0",
"tsconfig-paths-webpack-plugin": "^3.2.0"
},
"dependencies": {
"@types/lodash": "^4.14.138",
Expand Down
4 changes: 3 additions & 1 deletion pioneer/packages/apps-config/src/api/spec/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import encointerNodeTeeproxy from './encointer-node-teeproxy';
import kulupu from './kulupu';
import nodeTemplate from './node-template';
import stablePoc from './stable-poc';
import joystreamNode from './joystream-node';

export default {
acala,
Expand All @@ -21,5 +22,6 @@ export default {
kulupu,
'node-template': nodeTemplate,
'stable-poc': stablePoc,
stable_poc: stablePoc
stable_poc: stablePoc,
'joystream-node': joystreamNode
};
3 changes: 3 additions & 0 deletions pioneer/packages/apps-config/src/api/spec/joystream-node.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { types } from '@joystream/types';

export default types;
5 changes: 5 additions & 0 deletions pioneer/packages/apps-config/src/settings/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ function createDev (t: TFunction): LinkOption[] {

function createLive (t: TFunction): LinkOption[] {
return [
{
info: 'joystream',
text: t<string>('rpc.joystream', 'Joystream (Current Testnet, hosted by Jsgenesis)', { ns: 'apps-config' }),
value: 'wss://rome-rpc-endpoint.joystream.org:9944'
},
{
dnslink: 'polkadot',
info: 'polkadot',
Expand Down
4 changes: 3 additions & 1 deletion pioneer/packages/apps-config/src/ui/logos/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import nodeNodle from './nodes/nodle.svg';
import nodePolkadot from './nodes/polkadot-circle.svg';
import nodePolkadotJs from './nodes/polkadot-js.svg';
import nodeSubstrate from './nodes/substrate-hexagon.svg';
import nodeJoystream from './nodes/joystream-node.svg';

// extensions
import extensionPolkadotJs from './extensions/polkadot-js.svg';
Expand Down Expand Up @@ -48,7 +49,8 @@ const nodeLogos: Record<string, any> = [
['Nodle Chain Node', nodeNodle],
['parity-polkadot', nodePolkadot],
['polkadot-js', nodePolkadotJs],
['substrate-node', nodeSubstrate]
['substrate-node', nodeSubstrate],
['joystream-node', nodeJoystream]
].reduce((logos, [node, logo]): Record<string, any> => ({
...logos,
[(node as string).toLowerCase().replace(/-/g, ' ')]: logo
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 25 additions & 42 deletions pioneer/packages/apps-routing/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,69 +9,52 @@ import appSettings from '@polkadot/ui-settings';
// When adding here, also ensure to add to Dummy.tsx

import accounts from './accounts';
import claims from './claims';
import contracts from './contracts';
import council from './council';
// import dashboard from './dashboard';
import democracy from './democracy';
import explorer from './explorer';
import extrinsics from './extrinsics';
import genericAsset from './generic-asset';
import js from './js';
import parachains from './parachains';
import poll from './poll';
import settings from './settings';
import society from './society';
import staking from './staking';
import storage from './storage';
import sudo from './sudo';
import techcomm from './techcomm';
import toolbox from './toolbox';
import transfer from './transfer';
import treasury from './treasury';
// Joy packages
import members from './joy-members';
import { terms, privacyPolicy } from './joy-pages';
import election from './joy-election';
import proposals from './joy-proposals';
import roles from './joy-roles';

export default function create (t: <T = string> (key: string, text: string, options: { ns: string }) => T): Routes {
return appSettings.uiMode === 'light'
? [
// dashboard,
explorer(t),
accounts(t),
claims(t),
poll(t),
transfer(t),
genericAsset(t),
null,
staking(t),
democracy(t),
council(t),
// TODO Not sure about the inclusion of treasury, parachains & society here
members(t),
roles(t),
election(t),
proposals(t),
null,
transfer(t),
accounts(t),
settings(t)
]
: [
// dashboard(t),
explorer(t),
accounts(t),
claims(t),
poll(t),
transfer(t),
genericAsset(t),
members(t),
roles(t),
election(t),
proposals(t),
null,
staking(t),
democracy(t),
council(t),
treasury(t),
techcomm(t),
parachains(t),
society(t),
transfer(t),
accounts(t),
settings(t),
null,
contracts(t),
explorer(t),
storage(t),
extrinsics(t),
js(t),
toolbox(t),
sudo(t),
null,
settings(t),
toolbox(t),
js(t)
// Those are hidden
terms(t),
privacyPolicy(t)
];
}
17 changes: 17 additions & 0 deletions pioneer/packages/apps-routing/src/joy-election.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Route } from './types';

import Election from '@polkadot/joy-election/index';
import SidebarSubtitle from '@polkadot/joy-election/SidebarSubtitle';

export default function create (t: <T = string> (key: string, text: string, options: { ns: string }) => T): Route {
return {
Component: Election,
display: {
needsApi: ['query.council.activeCouncil', 'query.councilElection.stage']
},
text: t<string>('nav.election', 'Council', { ns: 'apps-routing' }),
icon: 'university',
name: 'council',
SubtitleComponent: SidebarSubtitle
};
}
15 changes: 15 additions & 0 deletions pioneer/packages/apps-routing/src/joy-members.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Route } from './types';

import Members from '@polkadot/joy-members/index';

export default function create (t: <T = string> (key: string, text: string, options: { ns: string }) => T): Route {
return {
Component: Members,
display: {
needsApi: ['query.members.nextMemberId']
},
icon: 'users',
name: 'members',
text: t<string>('nav.membership', 'Membership', { ns: 'apps-routing' })
};
}
27 changes: 27 additions & 0 deletions pioneer/packages/apps-routing/src/joy-pages.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Route } from './types';

import { ToS, Privacy } from '@polkadot/joy-pages/index';

export function terms (t: <T = string> (key: string, text: string, options: { ns: string }) => T): Route {
return {
Component: ToS,
display: {
isHidden: true
},
text: t<string>('nav.terms', 'Terms of Service', { ns: 'apps-routing' }),
icon: 'file',
name: 'pages/tos'
};
}

export function privacyPolicy (t: <T = string> (key: string, text: string, options: { ns: string }) => T): Route {
return {
Component: Privacy,
display: {
isHidden: true
},
text: t<string>('nav.privacy', 'Privacy Policy', { ns: 'apps-routing' }),
icon: 'file',
name: 'pages/privacy'
};
}
16 changes: 16 additions & 0 deletions pioneer/packages/apps-routing/src/joy-proposals.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Route } from './types';

import Proposals from '@polkadot/joy-proposals/index';

export default function create (t: <T = string> (key: string, text: string, options: { ns: string }) => T): Route {
return {
Component: Proposals,
display: {
needsApi: ['query.proposalsEngine.proposalCount']
},
text: t<string>('nav.proposals', 'Proposals', { ns: 'apps-routing' }),
icon: 'tasks',
name: 'proposals'
// TODO: useCounter with active proposals count? (could be a nice addition)
};
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import { Routes } from './types';
import { Route } from './types';

import Roles from '@polkadot/joy-roles/index';

export default ([
{
export default function create (t: <T = string> (key: string, text: string, options: { ns: string }) => T): Route {
return {
Component: Roles,
display: {
needsApi: [
'query.contentWorkingGroup.mint',
'query.storageWorkingGroup.mint'
]
},
i18n: {
defaultValue: 'Working groups'
},
text: t<string>('nav.roles', 'Working groups', { ns: 'apps-routing' }),
icon: 'users',
name: 'working-groups'
}
] as Routes);
};
}
2 changes: 2 additions & 0 deletions pioneer/packages/apps-routing/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export interface Route {
name: string;
text: string;
useCounter?: () => number | string | null;
// Joystream-specific
SubtitleComponent?: React.ComponentType<any>;
}

export type Routes = (Route | null)[];
Binary file modified pioneer/packages/apps/public/favicon.ico
Binary file not shown.
11 changes: 11 additions & 0 deletions pioneer/packages/apps/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@
<link rel="manifest" href="manifest.json">
<link rel="shortcut icon" href="favicon.ico">
<title><%= htmlWebpackPlugin.options.PAGE_TITLE %></title>
<% if (htmlWebpackPlugin.options.IS_PROD) { %>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-133429788-6"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-133429788-6', { 'anonymize_ip': true });
</script>
<% } %>
<script type="text/javascript" src="/env-config.js"></script>
</head>
<body>
Expand Down
Loading