draft of refactor to make custom confirm modal work for upload; need to further edit sb-file-uploader
Add support for custom confirm modal to sb-file-uploader
Show custom confirm modal when confirming project upload
got custom upload refactor of file upload working, and tested failure case
cleaned up debug code, make project file upload work
simplified logic around canceling file upload
removed old sb-file-uploader.jsx; fixed linter errors
reverted two components to use old strings, not shared
(can do that refactor another time)
removed unnecessary confirm container
removed stray comment
moved, updated sb file uploader tests, related project state tests
removed custom modal, to reduce scope of changes
sb file uploader test uses intl
Adding this caught a couple of important things:
- The sound integration tests have a `.only` in them
- The project-saver-hoc tests had two tests with the same description, causing possible confusion if that test broke
A few modifications were made while making this test:
- Change the "defaultMin/Max" to just be called "min/max", and pass the state through to make the inputs a controlled component. It is best to make form elements controlled since it makes it more clear how data flows.
- Force the passed in data to always be of type `number`, and transform it in the constructor to always be of type `string`, and change the onOk to transform it back to a number. With inputs, it is best to be very explicit about data types, and make it clear where you are using strings and where you are using numbers.
- Do not reset the state to `0` when the field is blank, that makes typing into it very hard (only applies after making it a controlled field)
- Use consistent booleans. Since the VM uses `isDiscrete`, change it so we do not use any opposite flags (like `decimal`) for clarity.
Writing tests for this really helped me understand the behavior. If you read through the test descriptions and see anything you did not intend, let me know.
* Export initial states for each reducer
* combine all gui reducers (excludes scratchPaint and intl)
* combine all initial states to create default guiState for preloading in www
* expect all of the gui state to be accessible at `state.scratchGui`