Skip to content
This repository has been archived by the owner on Sep 22, 2021. It is now read-only.

Added tip support #942

Merged
merged 57 commits into from
Jul 9, 2020
Merged

Added tip support #942

merged 57 commits into from
Jul 9, 2020

Conversation

niklabh
Copy link
Contributor

@niklabh niklabh commented Jun 19, 2020

Screenshot from 2020-06-24 14-29-05

Closes: #914

@niklabh niklabh requested review from Tbaut and erler June 24, 2020 10:22
@niklabh niklabh marked this pull request as ready for review June 24, 2020 10:22
@niklabh
Copy link
Contributor Author

niklabh commented Jun 24, 2020

Have opened it up for review. Do we need to create new notification settings in jwt for tip posts. Isn't new_proposal sufficient?
Need some help with BalanceInput @Tbaut while endorsing tip from sidebar. For some reason cannot enter any numeric value there. Can only enter 0 or letters. Can't seems to find the reason why.
Screenshot from 2020-06-24 15-59-33

@Tbaut
Copy link
Collaborator

Tbaut commented Jun 24, 2020

Sure I'll take a look.

@Tbaut
Copy link
Collaborator

Tbaut commented Jun 24, 2020

Isn't new_proposal sufficient?

You're right, no need to be too granular, new proposals does the job.

One quick thing I see right away from your screenshot, the reason is an encoded string. It should be decoded in the UI. and the Finder is an account, so it should be displayed as such.

Copy link
Collaborator

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow that's a big one! I tried to play with it, but stopped when I realized my hasura was failing over and over because the remote schema didn't contain tip. I guess you're still using 4466 in your docker-compose, for HASURA_CHAIN_DB_REMOTE_SCHEMA, whereas you should have http://localhost:4000, like in test and prod. And this brings us to the fact that the open-server needs new resolver to cater for the new tips (I forgot about it in the issue, just added it).

I went briefly through the code, catching small things here and there. I'll review everything again thoroughly once again and play with it. I checked briefly the input code, couldn't spot any problem at first glance, I'll leave that for my next review as well, when things are running end to end.

Tbaut and others added 2 commits July 8, 2020 21:35
* squash and migrate to v2

* remove useless users mention

* remove first useless proposals table creation

* delete consecutive add drop column proposal_id

* delete consecutive add drop creation and modification_date

* delete consecutive add drop on reply

* delete consecutive add drop on public.reactions

* delete consecutive add drop on public.post_votes

* delete consecutive add drop on public.post.poll_id and public.post.has_poll

* delete consecutive add drop updated at public.poll and poll_votes

* fix tons of nits to make migration sucessful

* fix wrong uppercase

* remove auto-migration (not-working) and update readme

* delete migration_backup and add cron_triggers.yaml
@niklabh
Copy link
Contributor Author

niklabh commented Jul 8, 2020

This must be in the tip creation, the data for the finder is :

{
  "data": {
    "tips": [
      {
        "hash": "0x38107ef91f4a1aca157e19dfe8d97386e51ffe9e7a1a9b3bc4cb1736794c8897",
        "who": "5DwXnSMVwLXBZoEfJDw9LMXAb1Q4pv1yp8DrFzNWqAzuJHPo",
        "finder": "[\"5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y\",186666666658]"
      }
    ]
  }
}

Fixed with ugly hack for now

Copy link
Collaborator

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple comments to make sure we stay consistent on the node-watcher side to prevent bugs

Copy link
Collaborator

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nits here and there, I'll commit them. I want to test the tip endorsement on a new node, which I haven't done yet, and then it should be good to go.

Copy link
Collaborator

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 🎉 🎉
working well on 0.8.14.

We've added some hacks, but it's a VERY complete, thank you so much for all this work.

@niklabh niklabh merged commit 69530bf into master Jul 9, 2020
@niklabh niklabh deleted the niklabh-feature-tip branch July 9, 2020 12:22
Tbaut added a commit to Tbaut/open-polkassembly that referenced this pull request Jul 9, 2020
* Added tip schema

* Tip being added to prisma

* added chain db watcher and frontend

* Added tip proposal

* Added Tip to frontend

* Added tip section

* Added finder

* Added chain db watcher for tip

* remove who

* Added types in refetch

* Added endorse sidebar

* Added tip type for new proposal emai;

* fix

* Update chain-db-watcher/README.md

Co-authored-by: Thibaut Sardan <[email protected]>

* Update chain-db-watcher/README.md

Co-authored-by: Thibaut Sardan <[email protected]>

* chain db open serve modifications for tip

* removed endorsements

* removed datamodel

* yarn generate

* removed endorsements

* fix

* fix

* sidebar component

* fix

* removed code

* fix graphql codegen

* correct tip reason

* allow numbers

* Added time to block

* added status update for tips

* create tip status

* showing only opened status

* codegen

* fix

* added tip closes

* fix finder

* show only open ones

* Hasura migration to v2 and squash (paritytech#950)

* squash and migrate to v2

* remove useless users mention

* remove first useless proposals table creation

* delete consecutive add drop column proposal_id

* delete consecutive add drop creation and modification_date

* delete consecutive add drop on reply

* delete consecutive add drop on public.reactions

* delete consecutive add drop on public.post_votes

* delete consecutive add drop on public.post.poll_id and public.post.has_poll

* delete consecutive add drop updated at public.poll and poll_votes

* fix tons of nits to make migration sucessful

* fix wrong uppercase

* remove auto-migration (not-working) and update readme

* delete migration_backup and add cron_triggers.yaml

* ugly hack

* proper closing and closed display

* Added check for closing

* added more check

* fix

* fix

* Change status name

* tip openend

* Update chain-db-watcher/src/sync/index.ts

Co-authored-by: Thibaut Sardan <[email protected]>

* Update chain-db-watcher/src/sync/queries/chain-db.queries.ts

Co-authored-by: Thibaut Sardan <[email protected]>

* Update front-end/src/screens/Tips/index.tsx

* Update front-end/src/screens/Tips/index.tsx

* Update front-end/src/components/Listings/TipListing.tsx

* Update front-end/src/screens/Tips/index.tsx

* Update chain-db-watcher/src/queries.ts

* closing shouldnot show negative days

Co-authored-by: Thibaut Sardan <[email protected]>
Co-authored-by: thib <[email protected]>

Co-authored-by: Nikhil Ranjan <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add TIP support
2 participants