Skip to content

Components: Added date-time and boolean components#6

Merged
natalialuzuriaga merged 1 commit intomainfrom
nat/more-components
Jan 7, 2025
Merged

Components: Added date-time and boolean components#6
natalialuzuriaga merged 1 commit intomainfrom
nat/more-components

Conversation

@natalialuzuriaga
Copy link
Copy Markdown
Contributor

Problem

To collect information for fields like lastModified andlocalisation, etc. we need to implement more components.

Solution

This PR implements date-time and boolean components. Now the form can create the following components:

  • Date-time component (CSS is not working atm due to CDN)
  • Single select component for boolean fields with "true" and "false" as options

Result

Users can generate forms using json schemas that have fields with `type: boolean' and 'type: string' + 'format: date-time'

When users fill out the form and click submit, the code.json is generated and downloaded onto their machine.

Test Plan

  1. Start up a HTTP server using python: python3 -m http.server 8000
  2. Click on form.html
  3. Here is the form! Right click -> Inspect to open dev tools
  4. Fill out the form
  5. Click submit and downloads code.json. File contents should match what was submitted in the form!

Will create unit tests in a separate PR after OSAB

Signed-off-by: Natalia Luzuriaga <natalia.luzuriaga@cms.hhs.gov>
@natalialuzuriaga
Copy link
Copy Markdown
Contributor Author

Note that for userInput field, the options were originally "Yes" or "No" but since this is a boolean field, options have changed to "True" and "False" - will need to update across repos

Copy link
Copy Markdown
Contributor

@decause-gov decause-gov left a comment

Choose a reason for hiding this comment

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

LGTM +1 🚢

inputType: "checkbox",
description: fieldObject["description"]
};
case "datetime":
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bigwork! 👏

@natalialuzuriaga natalialuzuriaga merged commit cbb5c4d into main Jan 7, 2025
@natalialuzuriaga natalialuzuriaga deleted the nat/more-components branch January 23, 2025 20:51
DinneK referenced this pull request in DSACMS/outbound-tools-survey-2 May 16, 2025
Signed-off-by: Dinne Kopelevich <dinne.kopelevich@gsa.gov>
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.

2 participants