Coder Social home page Coder Social logo

governance-ui's Introduction

Archive

This repo is no longer maintained. Please have a look at its new home https://github.com/polkassembly/governance-ui for updates and contributions.

CI status CT status

Polkadot Delegation Dashboard is a PWA - or Progressive Web App - with a focus on efficiency and offline support in the context of Web3.

As a pure web application, it doesn't depend on remote backend to operate but connects to Polkadot nodes. Some data will be fetched to enhance the experience from github.com and polkassembly.io/, although the plan short term is to become fully decentralized.

Use

Register as a delegate

Anyone can register themselves as a delegate.

To add a new delegate, edit this file and push a pull request. Once approved, changes will be transparently picked up and made available to anyone in the application.

The following table outlines the structure of a delegate entry:

Element Key Required Notes
Delegate Name name Yes The chosen name of the delegate.
Delegate Address address Yes The chain address of the delegate.
Manifesto manifesto Yes A description of your goals as a delegate. Supports markdown.

Build

The full website can be started using yarn build. PUBLIC_URL can be set to the final root URL for the considered deplyment environment if required.

Development

A local dev environment can be started using yarn dev.

Testing

Unit tests can be run via yarn test:unit.

Run end-to-end tests via the following steps:

# Setup
yarn
npx playwright install

# Run webapp in a dedicated tab
yarn dev

cd test/

# Run chain in a dedicated tab
yarn zombienet:native

# Launch tests
URL=http://127.0.0.1:1234/?rpc=ws://127.0.0.1:9984 yarn test:e2e

Using containers

You may build a container using:

./scripts/build-container.sh

then run your container with:

podman run --d -p 8080:80 localhost/polkadot-delegation-dashboard

and access the Delegation Dashboard at http://localhost:8080/

governance-ui's People

Contributors

blockseekerio avatar ddozen avatar dependabot[bot] avatar dnlklmn avatar gabreal avatar gunit2481 avatar hamidra avatar jeluard avatar joepetrowski avatar leemo94 avatar lesnikutsa avatar mathcryptodoc avatar matteo-sbond avatar miabarbir avatar nataladazlata avatar nelinam avatar nick-1979 avatar nickdunford avatar paradox-tt avatar paride1 avatar paulormart avatar pavelsupr avatar pioneerzxc avatar pmensik avatar polkadotcurry avatar sagarbutt avatar simonkraus avatar suleymann85 avatar tugytur avatar yx11xy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

governance-ui's Issues

Implement generic error components

Create per track template

Open Gov defines a number of tracks. A custom UI should be used to display relevant details accordingly.

Elements to consider

  • referendum state (only show ongoing?)
  • origin (identicon?)
  • track details (name, decision, lifecycle, curves)
  • proposal details
  • enactment/submission/decision details and lifecycle
  • tally details
  • alarm details

Historical elements (initiator details, voters, delegates, ..) are not considered yet.

Consolidate data into reducer

  • migrate wallets/accounts
  • extract restore in a preliminary step
  • make internal start** sync with reducer creation
  • migrate permissions (using listener)
  • introduce settings (and migrate timeouts, include query params/ENV accesses)
  • migrate fetch chain state to subs
  • abstract away chain access

Deploy on production environment

DApp should be deployed on a production ready and sized to support the planned workload

  • serve from proper domain
  • deploy on dedicated infrastructure
  • use dedicated RPC node
  • enable analytics
  • perform e2e tests

UX fixes

Continue btn when no tracks were selected

the button to continue from tracks should depend on whether you've selected tracks or not
if you haven't selected tracks it should either be

  • disabled + note saying 'select tracks to continue'
  • button saying select delegate first (this way stepper would have to say 1st step isn't done)
  • by default all tracks should be selected IMO

Select all only makes sense with the checkbox if it has additional functionality

  • idea is a copy of gmail select all dropdown (eg. select all / select active / select all technical tracks / etc.)
  • if we don't add extra functionality now, it might make sense to have a simple btn/link that say select all/deselect all

Hints

we could reuse the modal to display hints

  • next to section titles (info on tracks, info on delegates)
  • where else

Delegate cards have to be expandable to display longer text with extra things like matrix handle, website (maybe arbitrary key/value pair?)

  • in full delegate list its easy, they can just open within the columns (they have to be columns x rows, instead of row x columns)
  • in recommended delegates list it won't work b/c it won't fit - should we open in modal? eventually in full page if we have more info? straight to full page now?

Add error notification UX

We need to have an error notification for scenarios where something goes wrong during the delegation process.
Mainly there can be two types of errors:

  • Validation error: This happens when there is an issue in the modal when the delegation happens. (e.g. delegation is not possible because the user does not have free balance to delegate?!)
  • Chain submission error: while submitting the transaction for some reason fails (This can be shown as an overlay notification box?)

Provide a mocked env

Investigate e2e improvements

Finalize delegate label list

Delegate will get assigned labels depending on their conditions:

  • nominator (if this address nominates a validator)
  • fellow (if this address is a fellow)
  • validator (if this address is a validator address)

Query balance for connected account

We need to query the account balance for the connected account to be able to show the user the balance they can delegate,
when they submit the delegation tx.

If the user does not have enough balance to delegate the modal should present an alert message and the delegate button should be disabled.

Implement application monitoring

Add delegate data

We need to pull and aggregate some information regarding delegates to present them to the users.
The below schema is based what is going to be presented in the delegate Cards.

{
    account: {
      name:'can be pulled from identity pallet if available',
      address:'account address'
    },
    roles: ['nominator', 'fellow', 'validator', ...],
    bio: <since currently there is no profile we can have some logic to autogenerate a paragraph based on the delegates information to be used as their bio> >
    stats: [
      { title: 'Most active track', value: 'Staking admin' },
      { title: 'Participation', value: '75.71%' },
      { title: 'Representing', value: '135 addresses' },
      { title: 'DOT', value: '24k DOT' },
    ],
  }

I believe these are reasonable to present to the users in the first iteration.

Allow to deploy local dev chain

During development it is useful to be able to control the underlying relay chain. It should be easy to start a local chain, have the UI connected to it, and play with the app.

Controlled chain

Implement Delegation tx

Implement the delegation transaction to let the user submit delegation tx.

for the MVP we will only let them submit the default conviction (0.01x), but this can be handled by the UX and the implementation should accept parameters as we might extend UX in future iterations.

Fix `@polkadot-onboard/injected-wallets` export

@polkadot-onboard/injected-wallets disable global tree-shaking in parcel via the following message:

@parcel/transformer-js: Unknown usage of CommonJS `exports` object. This causes tree shaking to be disabled.

  /Users/julien/Documents/Projects/jeluard/swipealot/node_modules/@polkadot-onboard/injected-wallets/dist/injectedWallets.js:1:18
  > 1 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  >   |                  ^
    2 |     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    3 |     return new (P || (P = Promise))(function (resolve, reject) {

  ๐Ÿ“ Learn more: https://parceljs.org/features/scope-hoisting/#commonjs

Make sure this is not the case. While there are a couple of others lib (bn.js) that have the same behavior, this would be a step in the right direction.

Implement voting

Once a user went through all referendum it will be presented with a list summarizing their choice (here).

It should now be possible for the user to click on a button to sign-and-send a batch of transactions of all the votes.

Note that at the moment there is no account management implemented. polkadot-wallet-onboard might be considered for this.

  • add wallet selection support
  • implement batch voting

Enable tree shaking

Tree shaking is currently disabled due to an issue with bn.js

@parcel/transformer-js: Unknown usage of CommonJS `module` object. This causes the module to be wrapped, and tree shaking to be disabled.

  /Users/julien/Documents/Projects/jeluard/swipealot/node_modules/bn.js/lib/bn.js:3547:37
    3546 |   };
  > 3547 | })(typeof module === 'undefined' || module, this);
  >      |                                     ^^^^^^
    3548 | 

  ๐Ÿ“ Learn more: https://parceljs.org/features/scope-hoisting/#commonjs

@parcel/transformer-js: Unknown usage of CommonJS `exports` object. This causes tree shaking to be disabled.

  /Users/julien/Documents/Projects/jeluard/swipealot/node_modules/bn.js/lib/bn.js:3547:45
    3546 |   };
  > 3547 | })(typeof module === 'undefined' || module, this);
  >      |                                             ^^^^
    3548 | 

  ๐Ÿ“ Learn more: https://parceljs.org/features/scope-hoisting/#commonjs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.