unlock-protocol / unlock

Ʉnlock is a protocol for memberships built on a blockchain.
https://unlock-protocol.com
MIT License
834 stars 244 forks source link

Add pagination to keys for each lock on Dashboard #465

Closed todo[bot] closed 5 years ago

todo[bot] commented 5 years ago

https://github.com/unlock-protocol/unlock/blob/5decabbfd2098ec96deb41717b27f77963fb2eca/unlock-app/src/components/creator/lock/KeyList.js#L7-L12


This issue was generated by todo based on a TODO comment in 5decabbfd2098ec96deb41717b27f77963fb2eca when #462 was merged. cc @unlock-protocol.
julien51 commented 5 years ago
screen shot 2018-11-18 at 19 13 01
julien51 commented 5 years ago

As of now, this will involve writing the smart contracts to enable for this. I think @nfurfaro can help with that at first.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 3.003 ETH (332.98 USD @ $110.88/ETH) attached to it as part of the Unlock Inc fund.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 2 months, 4 weeks ago. Please review their action plans below:

1) aquiladev has applied to start work _(Funders only: approve worker | reject worker)_.

Gonna figure out what kind of changes required in smart contract, define requirements better, then will design functionality and component.

Learn more on the Gitcoin Issue Details page.

2) wawhal has been approved to start work.

Will add the pagination component at bottom

  1. Lets you select number of keys per page
  2. Lets you jump to a particular page
  3. Has a previous and next button
  4. Will hide this component if the total number of keys are less than or equal to 10

Learn more on the Gitcoin Issue Details page.

julien51 commented 5 years ago

@iamchrissmith Please confirm that you do not plan on submitting a PR for this one? (We'd be happy to take it no matter what ;))

PierrickGT commented 5 years ago

Hi @julien51,

I'm willing to help on this issue through Gitcoin but would like to know how to get some keys in a lock first.

I've started the project but it looks pretty different from the screenshot shared on this page. Is it because this is a final design and not the one in the app now?

I can create locks but how do I get keys in those locks? Also, does the issue is about adding pagination to the keys in the lock only or do we need to add it to the list of locks? Also, how many keys or lock per page do you want?

Thank you for those informations and I hope we can collaborate together. :)

julien51 commented 5 years ago

@PierrickGT So you would need to first deploy a lock, then purchase a key from the demo page.

The demo is actually quite outdated at this point, but it is still the most complete "view" of what Unlock does.

To purcahse keys after you've deployed the lock , click on the on code icon in the toolbar for that lock

screen shot 2018-12-05 at 18 00 43

and then click on the eye icon. You should see a demo page which lets you purchase a key for the lock.

PierrickGT commented 5 years ago

@julien51 I've done that but sadly no button appears to purchase a key.

capture d ecran 2018-12-06 a 14 21 29
julien51 commented 5 years ago

Ho wow. that's weird. Any error in the console?

PierrickGT commented 5 years ago

There's only the following error: Warning: Expected server HTML to contain a matching <a> in <div>.

julien51 commented 5 years ago

Hum, this is really strange. My only explaination is that for some reason the lock has not been deployed. Could you try creating another lock and see if you get the same thing?

PierrickGT commented 5 years ago

You're right, it does seem that the locks I create aren't deployed. Are you sure the dev environment works?

julien51 commented 5 years ago

Hey. It works from here... but it looks like something is not working for you. Let me write a debugging guide and get back to you ASAP. Could you reach out on Telegram too? (this will make async coms easier)

PierrickGT commented 5 years ago

Yes, it will be way more easier on Telegram. :)

julien51 commented 5 years ago

@PierrickGT This PR should help: https://github.com/unlock-protocol/unlock/pull/675

iamchrissmith commented 5 years ago

@julien51 correct, I am not currently planning on working on this. I will let you know if that changes or if i want to pick up another issue in the future.

wawhal commented 5 years ago

@julien51 I have achieved something like this. I can open a PR if you accept my work application from gitcoin :)

gif

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 3.003 ETH (268.2 USD @ $89.31/ETH) has been submitted by:

  1. @wawhal

@julien51 please take a look at the submitted work:


nfurfaro commented 5 years ago

There is still work to be done on the on-chain / backend for this issue. This is a gist I created with some background work I did a while back with an attempt to implement the on-chain portion of this.

https://gist.github.com/nfurfaro/99c63cf4f16610382b06d98a901fb277 The main stumbling block I encountered was the difficulty of returning the key data in a 3-dimensional array when the 2nd-level array is dynamic in size. Essentially, my solution involved returning 10 keys' data fields per request. As the data field on keys is currently unbounded in size, I created a helper function toBytes32 to convert an unbounded array of data into an array of 32-byte arrays. From my testing, I can confirm that his works as expected for a single key. I haven't been able to return the data for multiple keys at once in this way, unfortunately. Solidity won't let me return an array of arrays of 32-byte arrays unless I've missed something here.

I believe @hardlydifficult has some possible ideas around different ways this might be implemented, and @akeem needs to be in the loop with his work on locksmith and off-chain storage of key data.

cc @julien51

wawhal commented 5 years ago

It'd be great if you marked the issue as resolved on gitcoin @julien51

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 3.003 ETH (348.64 USD @ $116.1/ETH) attached to this issue has been approved & issued to @wawhal.

cellog commented 5 years ago

👏🏻👏🏻👏🏻

wawhal commented 5 years ago

Had a great time working with you guys @cellog @julien51 Let us keep in touch :)