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

Form refactorings and fixes #87

Merged
merged 23 commits into from
Oct 28, 2024
Merged

Form refactorings and fixes #87

merged 23 commits into from
Oct 28, 2024

Conversation

csillag
Copy link
Collaborator

@csillag csillag commented Oct 11, 2024

No description provided.

@csillag csillag changed the title Csillag/form enhancements Form refactorings and fixes Oct 11, 2024
@csillag csillag force-pushed the csillag/form-enhancements branch from 66c3fee to b4b72c6 Compare October 12, 2024 04:45
csillag and others added 15 commits October 24, 2024 12:15
Field library:
- Rename (redefine) them as field messages,
  instead of problems.
- Support markdown for the content
- Add a new "info" message type
  (besides the existing "warning" and "error").
- "info" messages won't disappear on clicking,
  unlike warnings and errors.

Blockvote app:
- Re-implement xchain contract and balance
  info display as info messages from the validator,
  as opposed to independent fields.
- Forward onMouseEnter onMouseLeave, onFocus to underlying component
  (for tooltip)
- Implement disabling differently: instead of using the native
  "disabled" prop, we are swallowing the click on the click handler.
  This is necessary because a really disabled html button won't react
  to mouse hover events.
- Use more specific CSS class names on label, to avoid ambiguity
- More HTML rendering from the React component to the hook
- Apply markdown renderer by default
- Allow specifying the HTML tag to use
- Fix a form field alignment issue:
  Remove unwanted flex gap from the end of rows.
- More explicit CSS classnames for the <label> in fields
- Remove some useless classes
- only drop empty items if we have enough remaining items
- properly indicate disabled state
- Turn the title and the intro into form elements
- Turn the prev, next, create buttons into form elements
- Remove all custom "pending" logic
- Don't validate hidden fields
- In form controls, also pass cleanValue
- Cleanup: validate() returning "true" means "hasErrors"
- ArrayList:
  - execute the dropEmptyItems action after validation,
    independently of value cleanup.
  - If there are only empty values, consider the whole value empty,
    and don't validate
- Field group validation:
  - ignore visibility (it is handle internally in each field's validation)
  - sort out boolean semantics and logics
- Validation pending status message can now be MarkDown
- Adapt pending action status output to validation UI
Disable form fields and prev button
@csillag csillag force-pushed the csillag/form-enhancements branch from 6b80c56 to 3c3a5d7 Compare October 24, 2024 11:06
- Rename clearMessage to clearErrorMessages,
  to make it more apparent that this
  method won't remove info messages.
- Input field messages: improve message handling
  Now we can call addMessage() multiple times
  within the same render.
- useAction:

- CSS: Adjust how input field rows are aligned.
- Define ExecutionContext, and use it consistently
  for all process status update stuff on all layers.
- Add debug output about the results of ActionButtons
- Alignment adjustments
- Support confirmQuestion for actions
Reimplement various parts of poll pages
as actions and labels, logic powered by the
standard form logic.
@csillag csillag merged commit d79dea9 into master Oct 28, 2024
1 check passed
@csillag csillag deleted the csillag/form-enhancements branch October 28, 2024 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant