-
Notifications
You must be signed in to change notification settings - Fork 389
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): forms #2604
feat(examples): forms #2604
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR! I've left some comments, try to address them 🙏
Co-authored-by: Leon Hudak <[email protected]>
Co-authored-by: Leon Hudak <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sgtm (after formatting the markdown table)
Co-authored-by: Guilhem Fanton <[email protected]>
Co-authored-by: Guilhem Fanton <[email protected]>
Removed the "review team" label because this is already reviewed by core devs. |
type times struct { | ||
openAt *time.Time | ||
closeAt *time.Time | ||
} | ||
|
||
func parseDates(openAt string, closeAt string) (times, error) { | ||
var openAtTime, closeAtTime *time.Time | ||
|
||
const dateFormat = "2006-01-02T15:04:05Z" | ||
|
||
// Parse openAt if it's not empty | ||
if openAt != "" { | ||
res, err := time.Parse(dateFormat, openAt) | ||
if err != nil { | ||
return times{}, errInvalidDate | ||
} | ||
openAtTime = &res | ||
} | ||
|
||
// Parse closeAt if it's not empty | ||
if closeAt != "" { | ||
res, err := time.Parse(dateFormat, closeAt) | ||
if err != nil { | ||
return times{}, errInvalidDate | ||
} | ||
closeAtTime = &res | ||
} | ||
|
||
return times{openAtTime, closeAtTime}, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- this(
times
) seems to be a redundant design; - using time.Time directly (without a pointer) is perfectly fine.
@leohhhn
This PR is stale because it has been open 3 months with no activity. Remove stale label or comment or this will be closed in 3 months. |
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Alas, author seems unresponsive. @agherasie, feel free to re-open this PR and bring it up to date also in the CI and I'll try to get it merged. |
Hi @thehowl , sorry for taking so long to update ! |
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
CreateForm(...)
SubmitForm(...)
GetForms(...), GetFormByID(...), GetAnswer(...)
Field Types
The system supports the following field types:
{"label": "Name", "fieldType": "string", "required": true}
{"label": "Age", "fieldType": "number", "required": true}
{"label": "Is Student?", "fieldType": "boolean", "required": false}
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()
a form response in the web interface
creating a form in the web interface
Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description