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

feat(examples): add {p,r}/agherasie/forms #3524

Open
wants to merge 44 commits into
base: master
Choose a base branch
from

Conversation

agherasie
Copy link
Contributor

Sorry for the long hiatus which caused #2604 to close, I moved to South Korea this year for a university exchange program and let this PR collect dust for a while.
I've addressed #2604 (comment) in 7a6a032, hoping that the PR might be ready for merge now !
If not, please let me know if any further updates should be made to the code !


As part of the student contributor program, I attempted to create a new example realm that allows the creation and submission of forms on gno !

Features

  • Form Creation: Create new forms with specified titles, descriptions, and fields.
    CreateForm(...)
  • Form Submission: Submit answers to forms.
    SubmitForm(...)
  • Form Retrieval: Retrieve existing forms and their submissions.
    GetForms(...), GetFormByID(...), GetAnswer(...)
  • Form Deadline: Set a precise time range during which a form can be interacted with.

Field Types

The system supports the following field types:

type example
string {"label": "Name", "fieldType": "string", "required": true}
number {"label": "Age", "fieldType": "number", "required": true}
boolean {"label": "Is Student?", "fieldType": "boolean", "required": false}
choice `{"label": "Favorite Food", "fieldType": "[Pizza
multi-choice `{"label": "Hobbies", "fieldType": "{Reading

Demo

The external repo where the initial development took place and where you can find the frontend is here.

The web app itself is hosted here

And the most recent test4 version of the contract is forms2


Screenshots :

gnoweb Render() image
a form response in the web interface image
creating a form in the web interface image

Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

agherasie and others added 28 commits July 16, 2024 19:59
Co-authored-by: Leon Hudak <33522493+leohhhn@users.noreply.github.com>
Co-authored-by: Leon Hudak <33522493+leohhhn@users.noreply.github.com>
Co-authored-by: Guilhem Fanton <8671905+gfanton@users.noreply.github.com>
Co-authored-by: Guilhem Fanton <8671905+gfanton@users.noreply.github.com>
@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Jan 15, 2025
@agherasie
Copy link
Contributor Author

I've left a few comments. Other than that, looks fine.

Hi @notJoon thanks so much for your suggestions !
I've addressed your comments in various commits, let me know what you think about the current state of the code !

@agherasie agherasie requested a review from notJoon January 16, 2025 14:39
@thehowl thehowl added the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Jan 16, 2025
@thehowl
Copy link
Member

thehowl commented Jan 16, 2025

@notJoon let's keep the "triage pending" while you folks are still reviewing it ;)

Copy link
Member

@notJoon notJoon left a comment

Choose a reason for hiding this comment

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

LGTM 👍

removing the review/triage-pending flag because the review is complete.

@notJoon notJoon removed the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Jan 21, 2025
Copy link
Contributor

@leohhhn leohhhn left a comment

Choose a reason for hiding this comment

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

Just check the last few comments, otherwise looks good.

You should consider moving this to your own namespace, and also calling r/leon/hof.Register() inside the realm, in init() so that it shows up on the Hall of Fame :)

@michelleellen michelleellen requested review from alexiscolin and removed request for alexiscolin January 22, 2025 12:05
@thehowl
Copy link
Member

thehowl commented Feb 11, 2025

@agherasie did you have a chance to check the latest comments?

@Gno2D2 Gno2D2 requested a review from a team February 11, 2025 16:31
@agherasie
Copy link
Contributor Author

@agherasie did you have a chance to check the latest comments?

Hi, sorry for the delay ! I tried to quickly address the comments in my latest commits, however I am running into a problem with the tests. Not sure what it's due to yet !
I'm currently traveling so I'm short on time but I'll make sure to finish up everything that's left before the end of the month hopefully, as well as try to get the corresponding r/forms webapp working again since a lot has changed with adena since I made it last summer !
That way, once the PR is merged it will be fully functional alongside the companion dapp.

@thehowl thehowl changed the title feat(examples): forms #2 feat(examples): add {p,r}/agherasie/forms Feb 28, 2025
Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

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

code quality could be improved, but I'd avoid this PR going stale again so merging seeing other approvals.

@thehowl
Copy link
Member

thehowl commented Feb 28, 2025

The CI is failing because of #3240, I think we either need to remove the hof registration or fix that issue...

@leohhhn
Copy link
Contributor

leohhhn commented Feb 28, 2025

Ah, I see the PR also needs updating to the latest std changes. @agherasie could you work through this and we can merge?

@agherasie
Copy link
Contributor Author

Apologies again for the delay, I've been very busy this month as I've been traveling a lot !
I'll make this PR my top priority this weekend :)

code quality could be improved

@thehowl feel free to add comments where you think I could improve the code if you have the time; as of tomorrow I will be a lot quicker to respond and make changes. The earlier requested changes on this PR have been very insightful for me since I'm pretty inexperienced with go/gno and I was able to learn a lot, so I am open to any further suggestions on how to improve the realm !

Thanks everyone for your help, I'm really excited to finally merging it soon !

@thehowl
Copy link
Member

thehowl commented Feb 28, 2025

Let's merge this after #3854, @agherasie please add back the hof registration, it should work after we merge that :)

Copy link

codecov bot commented Mar 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: History
Status: In Review
Development

Successfully merging this pull request may close these issues.

6 participants