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(form): add (auto)save and local schema repo #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

miguelgrc
Copy link
Collaborator

  • Adds an autosave feature (into localStorage as formuleCurrent). When reloading the page or closing and opening the browser the last state will be loaded automatically
  • Adds the following features in a floating menu in formule-demo:
    • Manual save: with a ctrl+s shortcut as well (into localStorage as formuleForm_<formid>). It shows a badge when there are unsaved changes
    • Load schemas: new drawer listing all the schemas currently stored in localStorage, lets you delete, download and upload schemas
    • Revert: reverts unsaved changes
    • New schema: starts a new schema from scratch
    • View schema: the existing schema viewer has been moved into here
  • Although this menu is exclusive for the demo, the logic of the saving/loading features mentioned above has been implemented and exported from formule as functions so they can be used in any project.
  • The form key is now displayed in the SchemaPreview. It can be disabled with hideSchemaKey.
  • The process of initializing the form has been simplified, now it's not needed to call initFormuleSchema() in a useEffect on first render anymore (you can still do it on demand or if you want to load an existing form).

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