eric-burel
38ce8ef886
expose mergeWithComponents
2018-11-29 14:24:18 +01:00
SachaG
77332324f1
If "addFields" prop is specified, add its fields to default generated fragments; fix FormIntl key issue; add class to FormGroup
2018-11-22 16:09:31 +09:00
Eric Burel
08b9cf5c5e
updated tests, reuse utils for Form and FormWrapper
2018-10-29 22:34:29 +01:00
Eric Burel
284cdbae18
start splitting code, reuse options handler
2018-10-29 22:08:41 +01:00
Eric Burel
5d0ff2d05f
add a changeCallback to forms
2018-10-29 08:50:51 +01:00
Eric Burel
3cacbc8cb7
form components layout are now replaceable
2018-10-29 08:50:51 +01:00
Eric Burel
562400dc77
fixed field path and default setup
2018-10-24 16:52:34 +02:00
Eric Burel
ae6b45f847
clean createField and allow to create field for the array subfield
2018-10-23 14:31:17 +02:00
Eric Burel
767f075e1e
do not discard subfield definition in arrays
2018-10-23 14:29:46 +02:00
Sacha Greif
66b1aa467f
Merge pull request #2080 from VulcanJS/custom-form-components
...
Custom form components
2018-10-08 07:22:03 +09:00
Sacha Greif
725c9b6959
Merge pull request #2060 from OrigenStudio/fix/clear-current-values-on-edit
...
only clear current values for new document's form
2018-10-05 09:43:35 +09:00
ochicf
16ca286a05
clear everything, allow to initialize form with a new document
2018-10-04 20:08:14 +02:00
Bogdan Dimofte
3ea00f6ded
SmartForm: use prop schema
, if given
2018-10-01 11:03:10 +03:00
Erik Dakoda
73086be5ca
SubmitButtonLabels
...
- `submitLabel`, `cancelLabel`, and `revertLabel` now take a node (which is backwards compatible with string) so that you can include a FormattedMessage, an icon, etc.
2018-09-25 09:42:56 -04:00
SachaG
6864b572be
Merge branch 'devel' into custom-form-components
...
# Conflicts:
# packages/vulcan-forms/lib/components/FormNestedArray.jsx
2018-09-23 08:16:48 +09:00
SachaG
07427a2c96
Add formComponents
prop to forms to enable customizing a specific form's components
2018-09-23 08:13:09 +09:00
Erik Dakoda
5ca08daa8e
SmartForm.getLabel() now falls back to a "global" namespace when a collection-specific intl string is not found; then it falls back to using no namespace
2018-09-19 21:12:27 -04:00
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
55895431a3
simplify clearForm options
2018-09-14 11:12:45 +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
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
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
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
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
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
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
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
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
SachaG
b34f0a25ce
Add support for new addFields form props to force adding unmutable "static" (disabled) fields
2018-07-10 10:02:08 +02:00
SachaG
8a446680cf
Minor fixes to form, mutators; query, and payments
2018-07-07 18:49:04 +02:00
SachaG
a55ef866b0
Clear all current values
2018-07-04 11:25:44 +02:00
SachaG
e0b540eeb1
Use callback ref; fix withMutation; handle errors with no path
2018-07-04 10:59:10 +02:00
SachaG
861980b468
Internationalize field labels in forms and form errors
2018-07-02 16:59:29 +02:00
SachaG
35c811e791
Fix form error labels to work with intl fields
2018-06-30 11:48:37 +02:00
SachaG
bb80001056
Fix eslint issues
2018-06-30 11:34:17 +02:00
Sacha Greif
5230f3ae06
Merge pull request #2011 from OrigenStudio/field-value-merge
...
FormComponent value handling improvements
2018-06-30 09:35:42 +02:00