Commit graph

347 commits

Author SHA1 Message Date
SachaG
dfa4c77314 ESLint fixes 2018-09-16 11:48:38 +09:00
ochicf
b392bad1db update clearForm call, pass document as initial only for edit mutations 2018-09-14 11:14:05 +02:00
ochicf
01b918a8f6 remove options 2018-09-14 11:13:38 +02:00
ochicf
157527fda4 update clearForm call 2018-09-14 11:13:05 +02:00
ochicf
55895431a3 simplify clearForm options 2018-09-14 11:12:45 +02:00
ochicf
f7bda07db0 Merge remote-tracking branch 'upstream/devel' into fix/clear-current-values-on-edit 2018-09-14 11:08:09 +02:00
ochicf
40af573cb5 do not clear current document on edit, and set it as initial 2018-09-12 16:01:14 +02:00
ochicf
a70e476887 retrieve and pass clear form options 2018-09-12 15:58:21 +02:00
ochicf
95d0e9c3d7 add option to parametrize whether to clear initial document or not 2018-09-12 15:57:37 +02:00
ochicf
7866fc380c add option to parametrize whether to clear current document or not 2018-09-12 15:54:40 +02:00
SachaG
a18c4ebb6a v1.12.6 2018-09-12 14:52:49 +09:00
SachaG
0c99b9a7ac v1.12.5 2018-09-12 12:01:10 +09:00
SachaG
5fc0e30f40 Fix ESLint 2018-09-12 11:59:00 +09:00
SachaG
8e325122c6 v1.12.4 2018-09-12 10:32:45 +09:00
Eric Burel
755d5f6ad0 allow user to return nothing in submitCallback
Useful when the callback is meant for side effect and not for modifying the data
2018-09-05 17:08:29 +02:00
SachaG
ebbf9fa1d6 Add defaultValues to initialDocument 2018-09-05 10:44:56 +09:00
SachaG
092cec26f4 Pass currentValues, errors, and deletedValues to FormSubmit component in case it needs them 2018-09-04 21:47:05 +09:00
SachaG
0be73085c3 Fields with "$" should never be included in generated fragments (fix #2044) 2018-09-01 07:41:55 +09:00
SachaG
2482bae51b v1.12.3 2018-08-31 22:51:49 +09:00
SachaG
6e9d7e9412 v1.12.2 2018-08-31 07:07:27 +09:00
SachaG
32fef20cd4 v1.12.1 2018-08-30 20:02:55 +09:00
SachaG
0f4f77a058 v1.12.0 2018-08-30 07:51:28 +09:00
SachaG
a388e1663f Renaming 2018-08-29 20:36:36 +09:00
Sacha Greif
26f28a98ce Rework required field validation to make it work for intl fields when creating new documents
1. make intl fields use [IntlValue] and [IntlValueInput] types
2. add isIntlData marker to fields storing intl data
3. only validate intl fields that are marked as required
4. remove all instance of `__typename` from documents in edit forms
2018-08-17 19:02:44 +09:00
Sacha Greif
0b961aca2b Add Date2 form component (useful for date of birth for example) 2018-08-17 13:49:15 +09:00
Apollinaire
06607e5e9a [Forms] Add currentDocument to clearForm
allows for the form fields to be correctly cleared when calling clearForm with `clearCurrentValues == true`
2018-08-10 14:46:49 +02:00
SachaG
497987d91e Export account helpers 2018-08-10 13:08:12 +09:00
SachaG
87ed3ea5ea Use UNSAFE_componentWillReceiveProps to compare old props and new props before resetting state when props change 2018-08-09 11:41:06 +09:00
SachaG
fe86f84870 Put currentDocument on state, too; use isEmptyValue to test for empty values (will catch [], '', and undefined as well as null) 2018-08-07 16:42:45 +09:00
SachaG
92a8ae8e75 Improve error handling in nested arrays and nested objects 2018-08-07 16:05:24 +09:00
SachaG
ae12907877 Merge branch 'devel' into feature/nested-schema 2018-08-07 10:16:40 +09:00
SachaG
2f4a0acb8e Get rid of merging to generate document; instead update currentDocument every time updateCurrentValues is called. Add support for { mode: 'merge'} in updateCurrentValues options. 2018-08-07 10:13:06 +09:00
SachaG
929e479f59 Do not pass down nestedInput prop in intlInput components to avoid treating them like Nested Objects components 2018-08-06 10:52:37 +09:00
SachaG
059d2651b9 Merge branch 'devel' into lbke-feature/nested-schema
# Conflicts:
#	packages/vulcan-forms/lib/components/Form.jsx
#	packages/vulcan-forms/lib/components/FormComponent.jsx
2018-08-06 10:46:40 +09:00
SachaG
a9d81cb747 Simplify getValue; do not merge in getValue anymore, instead get value from Form's getDocument() 2018-08-06 10:43:00 +09:00
SachaG
cdd59a1cbf When checking to update FormComponent when a field has been deleted, update parent component if child has been deleted. 2018-08-06 10:31:06 +09:00
SachaG
e1faef0d39 Add getFieldType, getNullValue form utils 2018-08-06 10:29:36 +09:00
SachaG
517fc97ade Change getDocument's merge function to allow array replacement (e.g. replace ['foo', 'bar', 'baz'] by ['foo', 'baz'] if 'bar' has been deleted) instead of always attempting to merge 2018-08-06 10:29:06 +09:00
SachaG
9b4d913fab Handle form deletions more explicitly (split into two cases); pass value down to FormNested; uniq -> uniqBy 2018-08-05 11:17:46 +09:00
SachaG
eb9a86ee47 uniq -> uniqBy 2018-08-05 10:30:56 +09:00
SachaG
96a396fd8c Merge branch 'feature/nested-schema' of https://github.com/lbke/Vulcan into lbke-feature/nested-schema 2018-08-03 11:44:20 +09:00
Eric Burel
e79b8a524f updated schema_utils and FormComponent to correctly detect nested objects 2018-07-27 17:27:44 +02:00
ochicf
d661e1a48b add opencrud field properties so they are passed to the form 2018-07-27 09:50:44 +02:00
Eric Burel
b5e54ead17 Splitted FormNested between objects an arrays
Nested form is much simpler for objects than for arrays.
2018-07-26 17:25:33 +02:00
Eric Burel
25db5c04b8 load Components correctly in tests
Now `vulcan:ui-bootstrap` is explicitely loaded in the `vulcan:forms`
package. This avoid undefined `Components.Button` if the use did not
load a specific styling package
2018-07-26 16:39:40 +02:00
Eric Burel
d21dd5fcfa wrote passing tests and a failing test for nested objects 2018-07-25 18:03:43 +02:00
Eric Burel
56eb3ab4b6 fixed nested form generation
Schema must be passed explicitely to the field retrieval methods
(otherwise the main schema will be used instead of the nested schemas)
2018-07-24 20:33:43 +02:00
Eric Burel
4d6e87cbca pass the nested schema to the field retrieval methods 2018-07-24 18:29:27 +02:00
Eric Burel
474456148e setup tests 2018-07-24 18:13:34 +02:00
Eric Burel
f4ed4bffcf use meteortesting:mocha instead of TinyTest 2018-07-18 12:06:04 +02:00