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

[R20-166] Extend form inputs #1236

Merged
merged 9 commits into from
Jul 15, 2024
Merged

[R20-166] Extend form inputs #1236

merged 9 commits into from
Jul 15, 2024

Conversation

waitingallday
Copy link
Member

Issue: https://digital-vic.atlassian.net/browse/R20-166

What I did

  • Support self-contained layers to add their own custom inputs (without building!)
  • Introduce a customInputs prop into app config that takes
    1. a mapping function for drupal webforms api, and
    2. enough data/options to create a FormKit definition
  • Component is auto-imported via layer, so it doesn't need precompile or transpile, it's just added directly into the input library at runtime
  • Mapping is automatically added from app config in webform mapping, used in TideLandingPage/Webform (utils sourced in ripple-tide-webform)
  • FormKit definition is dynamically created at runtime in TideLandingPage/Webform from the available props
  • Webform utils had to be shuffled around a bit to prevent winston (server only) from running in client, we should revisit this when Nuxt 4 releases and come up with a more systematic way of separating our server/client code
  • Or, set winston up to log to the client as well?

How to test

  • The layer in examples/nuxt-app/layers/ripple-ui-forms-ext demonstrates what is needed to add a simple input (item in this case)
    1. component
    2. mapping function
    3. app config
  • Run nuxt-app in either dev or build mode and go to http://localhost:3000/_test/webform (this page is provided with fixture for testing)

Checklist

For all PR's

  • I've added relevant changes to the project Readme if needed.
  • I've updated the documentation site as needed.
  • I have added unit tests to cover my changes (if not applicable, please state why in a comment)

For new components only

  • I have added a story covering all variants
  • I have checked a11y tab in storybook passes
  • Any events are emitted on the event bus

Copy link

netlify bot commented Jun 26, 2024

Deploy Preview for ripple-docs canceled.

Name Link
🔨 Latest commit 69401b2
🔍 Latest deploy log https://app.netlify.com/sites/ripple-docs/deploys/669466fc9398a30008222b5a

Copy link

cypress bot commented Jul 2, 2024

Passing run #2012 ↗︎

0 176 0 0 Flakiness 0

Details:

build: 👷 update actions to node 20
Project: ripple-framework Commit: 54b46e7105
Status: Passed Duration: 07:42 💡
Started: Jul 2, 2024 6:25 AM Ended: Jul 2, 2024 6:32 AM

Review all test suite changes for PR #1236 ↗︎

export default defineNuxtConfig({
hooks: {
'build:done': async () => {
console.info('Added ripple-ui-forms-ext components')
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 this is a nice way of doing it

@dylankelly dylankelly enabled auto-merge July 15, 2024 00:01
@dylankelly dylankelly added this pull request to the merge queue Jul 15, 2024
Merged via the queue into develop with commit fff0b3f Jul 15, 2024
14 of 16 checks passed
@dylankelly dylankelly deleted the feat/r20-166-extend-forms branch July 15, 2024 00:07
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.

3 participants