Giter VIP home page Giter VIP logo

formio-builder's People

Contributors

charstring avatar sergei-maertens avatar silviaamam avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

formio-builder's Issues

Implement builder validation

  • Look into zod for this
  • Check if we can specify validators at the builder field level to properly encapsulate this
  • ... otherwise set up validator schema as composable thing.

Properly implement tooltips

The current tooltip solution is quick and dirty and has some issues:

  • #33 (comment) z-index fighting
  • Long texts fall of the screen or sit behind other panels in multi-column layouts
  • Hovering over them doesn't really allow clicking any potential URLs inside or copy-pasting something. Not necessarily a dealbreaker, but could be annoying
  • Hover on desktop displays the tooltip but also the title HTML attribute.

A proper implementation would be to use https://floating-ui.com/docs/react, which we already use in the SDK for date pickers. It would also solve some other issues in the SDK/renderer eventually by not having to use the tooltip library of formio itself.

Unreadable text in translation view

This rule from bootstrap sets a background-color without specifying a foreground-color. This results in near-white on near-white in dark mode.

.form-control:disabled, .form-control[readonly] {
  background-color: #e9ecef;
  opacity: 1;
}

image

Implement date edit form

  • Edit form
  • Validation schema
    • Especially take the date constraint into account!
  • Preview
  • Datepicker library/solution? Flatpickr is... not ideal just use input type="date"

Specify full component schema and infer validation fields etc. from it

Hooks like useManageTranslations would definitely benefit from typescript information to know which keys are translatable (string type and present in the FormioTypeSchema)

We'd then be able to do something like:

Translations.useManageTranslations<EmailSchema>(['label', 'bad']);
hasAnyError<EmailSchema>(...)

-> compiler should then warn about 'bad' not being a valid name.

This would also be useful to combine in a higher order EditForm component with generics, so you can do something like:

<EditForm<EmailSchema> manageTranslations={['label', 'description']} manageValidatorTranslations={['required']}>
{({hasAnyError}) => (
  <Tabs>
    <TabList>...</TabList>
    <TabPanel>...</TabPanel>
  </Tabs>
)}
</EditForm>

Code cleanup: organize various types

  • Split out generic/reusable types into own library so the formio-renderer can use them
  • Ensure that the other types end up in the types entrypoint in the package

The content of index.ts is now resulting in our own index.d.ts being overwritten

Implement textfield preview

The preview currently shows the JSON schema

Instead, this should show the component preview (and strip out/ignore certain attributes, like 'hidden' etc.).

Sort out i18n

All texts/literals are now provided via react-intl components, however we need to either or both:

  • Ship translations for NL that can be picked up by downstream projects
  • Ensure that our messages are picked up by downstream project builds

Prototype possible validation approaches

  • generically based on component.validate -> requires order/mapping with component type
  • specify explicitly at the preview component level (e.g. map component.type -> (component) => ZodSchema)

Clean up getErrorNames functionality

  • Check if we can use TS mapped types to get all (deeply nested) field names
  • Check if we can provide a generic implementation to make it reusable in component types
  • Check if we need to specify the type var, or if we can rely on the type information from useFormikContext().errors instead (see #29 (comment))

Handle changes in defaultValue in builder form

These should ensure the component preview gets updated appropriately

Essentially, the Formik initialValues should be sourced from this value

Tangentially related - the defaultValues now behaves incorrectly in the builder form when toggling multiple true/false.

  • Fix preview
  • Fix defaultValue i.c.w. multiple

Set up storybook test runner

Run the tests and build all in CI

This executes the play function, or if those are missing, ensures each story renders.

Implement WYSIWYG 'content' component

See if we can use TinyMCE and feed it the config from the main project, instead of Formio's own editor.

Managing translations also requires special attention.

Component key override resets when switching tabs

Due to the ref/effect being scoped to the Key component, when you switch tabs and the Basic tab content gets unmounted, this resets upon switching back to the basic tab.

A hook useDerivedKey is probably a better approach which can run on the entire for component.

Story doesn't work in Firefox

See: #34 (comment)

In the story with path /story/builder-components-textfield--preview-initial-values, the interaction tests fail because clicking on the checkbox 'multiple values' doesn't seem to actually check the checkbox.

Implement 'multiple' behaviour

  • Default value should change into a list of default values
  • Preview component should update UI with button to "add another item"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.