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

[WIP] More detail on use of definitions #188

Merged
merged 3 commits into from
Jul 25, 2018

Conversation

dmethvin-gov
Copy link
Contributor

I skipped the address.js one for the moment because it's super crazy to explain, but is the format of these others okay? I think an example will be useful since it can be copy/pasted. I tried to de-emphasize the Source since that is not the actual code they include, although the link will be helpful since it contains the definitions and for ones like address.js it is super difficult to use without reading the source because of all the options it has.

@bernars-usa
Copy link
Contributor

This looks great! Very descriptive and helpful. 👍

Copy link
Contributor

@annekainicUSDS annekainicUSDS left a comment

Choose a reason for hiding this comment

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

One minor thing!

- `schema`: No
- Function or object: Object
```js
import { uiSchema as bankAccountUI }
Copy link
Contributor

Choose a reason for hiding this comment

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

This has tripped me up before, but I'm pretty sure using the curly braces in the import statement here will cause an issue because there's a default export in bankAccount.js. I think instead the import statement should be import bankAccountUI from 'us-forms-system/lib/js/definitions/bankAccount';.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I started from address.js and copied from that, which defines two exported functions with no default. The way we've got the definitions set up, it's inconsistent; some are default and some are not. So I guess for now I'll change these all to just working although the examples won't be consistent.

Formats and validates a US currency field. The display includes a leading `$` character. Call this exported function and pass it the label to be used on the field.

```js
import { uiSchema as currencyUI }
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this one, as well as most of the definitions, also have default exports, so might want to double check all the import statements in these code examples.

serviceStart: monthYearRangeUI()
}
```
Source: [/src/js/definitions/monthYearRange.js](../../src/js/definitions/monthYearRange.js)

### Non-required full name
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one is supposed to be a schema modifier but we don't have the actual schema for fullName here do we? The starter app has it copied there rather than importing it from USFS. In any case I wonder if we should delete this for now, it's not that important and could be distracting.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, the schema for fullName doesn't exist in USFS.


- File: [/src/js/definitions/file.js](../../src/js/definitions/file.js)
- `uiSchema`: Yes
- `schema`: Yes (the same as in vets-json-schema)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a schema in file.js but it looks like nobody uses it and it's just there as a "serving suggestion".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, file.js is strange because it does an export default on the uiSchema but just plain export on the schema. So to import both parts you'd have to do something like:

import { default as fileUI, fileSchema } from '/path/to/file';

@dmethvin-gov
Copy link
Contributor Author

I still have address, autosuggest, and personID to document. Should we just drop personID? I saved address and autosuggest for last because they are complicated.

@dmethvin-gov
Copy link
Contributor Author

Just wrestled autosuggest to the ground, at least for a "simple" case. I need to find something already working for address, it's just too complicated to experiment with and I'm also concerned that it isn't the best thing to open with on that page. @annekainicUSDS is there a simple form somewhere that uses it?

Other than address I think this is ready, so feel free to provide feedback now. Even if we can't get address straightened out in time it would be useful to merge this tomorrow before the hackathon.

@dmethvin-gov dmethvin-gov merged commit abe1763 into usds:master Jul 25, 2018
annekainicUSDS pushed a commit that referenced this pull request Aug 10, 2018
* [WIP] More detail on use of definitions

* Fix imports; further updates

* Add autosuggest section
annekainicUSDS added a commit that referenced this pull request Aug 20, 2018
* Relative links will be the end of me

* Relative links to definitions directory

* Two more

* Add links to docs and starter app, tighten up other copy

* Significantly faster cc @annekainicUSDS

* Add a consoleSubmit option for debugging output (#153)

* Add a consoleSubmit option for debugging output

Fixes #135

* Use pre-push hook to ensure build artifacts are up to date (#151)

Fixes #97

* Add docs for creating a simple form (#149)

* Add docs for creating a simple form

* Fix link (#157)

* [WIP] Add placeholder topic for available components (#154)

* Add placeholder topic for available components

* Additional changes after discussion with @dmethvin-gov and @fatimanoorva

* Add a consoleSubmit option for debugging output (#153)

* Add a consoleSubmit option for debugging output

Fixes #135

* Use pre-push hook to ensure build artifacts are up to date (#151)

Fixes #97

* Add docs for creating a simple form (#149)

* Add docs for creating a simple form

* Add some code examples and explanations on components

* Better headings

* Revert "Better headings"

This reverts commit 66f40ae.

* Apply Dave's changes again because Git is hard

* Big reorg

* Add placeholder topic for available components

* fixes few relative links

* add "contributing to this project" section

include: links to code of conduct, CONTRIBUTING.md, and instructions on how to join the forms listserv

* Update shortdesc

* More line breaks 😩

* A bit more elaboration courtesy of Anne

* Field component props and what they do

* Clarify the purpose of this description once and for all

* Clarify this weird point

* What are "they"?

* Links back to README, fix markdown

* Better headings

* Add these links

* Add a hopefully better description of the keepInPageOnReview property

* Keep consistent with "review page"

* Use Anne's language, needs clarification on the second sentence

* Introduction component

* Form footer

* Prgoress bar

* Title and subtitle

* Update mini-toc with new combined section header

* For example

* Date fields

* Hidden contextual information - needs info on how to specify cc @dmethvin-gov

* Radio Button and Checkbox Group - needs a code sample cc @dmethvin-gov

* Password usage guidelines - what do we want to say about this?

* Just kidding, the previous commit was for required fields, this one's for password

* Duplicate field validation

* Conditional form fields

* Small reword

* Add widget descriptions (#166)

* Complete table with widget information

* Add more description for some components

* Add usage info for error messages

* Edits from review

* Remove password description

* Make review edits

* Add remaining descriptions (#174)

* Add remaining descriptions

* Make updates from review

* Update language

* Refactor from review comments

* Remove one word

* Rename components topic

* Remove hidden contextual information cc #173

* Minor cleanup

* Set the property to `true`

* Create the new individual files

* Move content, turn table rows into sections for linking

* Move content

* Add more descriptions for widgets

* Rename to "Available" rather than "Common"

* Edits from @dmethvin-gov

* Fix link to docs (#181)

* Widget links as appropriate

* Add guidance on using widgets

* currencyUI

* This is guidance for adding widgets, the previous commit was for definitions

* Combine info more coherently

* Remove less specific information

* Definitions for widgets and... definitions

* More verbose explanation of the example

* Remove AddressField per @annekainicUSDS

* Improve content on the form config (#186)

* Separate out advanced information on how the form config works, and create new content at a beginner level for basic information you need to know about creating a form config

* Move to new customization map

* Update links after move

* Rename new conceptual topic

* Rename map

* Update main README after renames and moves

* Rename again

* Copy edits

* Update shortdesc cc @annekainicUSDS

* Remove these sections

* Not "our"

* Small fixes

* Fix misspelling

* H1 header

* Fake breadcrumbs

* relative link

* 😩

* Once more

* Two dots

* Map topic readme links

* Relative links for every breadcrumb

* Topic links

* Add folder name

* This is broken

* Fix links

* All these commits are going to have the same commit message

* Add folder

* Once more

* All breadcrumbs

* Small link fixes here

* Fix relative link?

* Remove directory

* Add markdown extension

* Relative link

* One more level

* All small fixes for "Building a form"

* Small updates for "Customizing the library"

* Add react

* Lots of hardcoded links

* Remove containing directory

* Line link doesn't work

* Not plural

* Markdown extension

* MARKDOWN EXTENSION

* Fix the example for conditionally hiding fields (#183)

This is simplified from the big form I'm building.

* More detail on use of definitions (#188)

* [WIP] More detail on use of definitions

* Fix imports; further updates

* Add autosuggest section

* Add missing expandable group styles (#192)

* Add basic tutorial (#194)

* Add basic tutorial

* Fix language

* Add Dave's suggestions

* Add Sheri's suggestions

* More edits from Sheri

* Edit images

* Small edits

* No apostrophe (#197)

* Don't show back button on first page (#195)

Routes in `pageList` mocks now reflect the way they really look, using a leading slash.
Also cleans up FormPage/ReviewPage unit tests which had remnants of vets.gov user login.

Fixes #177

* TOC at the top of the tutorial

* Minor cleanup

* Add readme links

* Minor cleanup of review section

* Add breadcrumbs

* Add content to question issue template

* Clarify a couple of questions

* Typos

* Do not filter out properties on inactive pages that also appear on active pages (#155)

* Add functionality to not filter out properties on inactive pages that also appear on active pages

Refactor

Refactor

Remove duplicate properties from array

Return properties

* Write unit tests for new functionality

* Refactor from code review

* Change _.uniq to only be called once

* Run build on latest changes

* Clean up and dry out the FormPage unit tests (#202)

* Update node-sass to remove the node-gyp vuln (#213)

* 1.1.0

* Fix merge conflict
@dmethvin-gov dmethvin-gov deleted the defns-detail branch August 31, 2018 12:43
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