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
SachaG
da98a6bd53
Merge branch 'form-errors' of https://github.com/OrigenStudio/Vulcan into OrigenStudio-form-errors
...
# Conflicts:
# packages/vulcan-lib/lib/modules/validation.js
2018-06-30 09:26:26 +02:00
SachaG
7a10103590
Pass down disabled prop explicitely
2018-06-30 09:23:49 +02:00
ochicf
7d4a1685d4
add missing import
2018-06-29 13:22:46 +02:00
ochicf
f7b949b86c
use getDeletedValues to apply DRY
2018-06-29 13:22:21 +02:00
ochicf
59965f9614
fix: properly retrieve parent path when current path is of an array elem
...
Example: for path `fieldArray[0]`, parent path was `fieldArray[0`, now is `fieldArray`.
2018-06-29 13:01:56 +02:00
ochicf
8031e9e17b
Merge branch 'devel' into form-errors
2018-06-28 10:32:09 +02:00
ochicf
c8ae445720
pass getLabel as child context
2018-06-27 19:53:21 +02:00
SachaG
973b2bfce3
Pass document to form.reset() to avoid resetting it to pre-submission values
2018-06-21 10:29:00 +09:00
SachaG
b4ac2d23af
Revert formsy/formsy-react-component update
2018-06-21 10:28:34 +09:00
SachaG
eea1a1dadb
Update for new formsy-react & formsy-react-component
2018-06-20 10:23:54 +09:00
SachaG
55f3e10581
Re-enable form on submission success
2018-06-13 18:28:01 +09:00
Erik Schannen
373857131a
SubSchema Fields
...
- Added support for fields that have their own subschema
- The code flattens the subschema fields, so the path for `address: { street }`` becomes `'address.street'`
- Several places needed to be changed to properly support paths, so `currentValues[path]` becomes `get(currentValues, path)`
- In Form.getData(), replaced underscore's `pick` with lodash's `pick` which properly supports paths and returns a new object
- Fixed a bug in collection.getParameters that made it impossible to specify a `limit` with addView or addDefaultView
2018-05-23 16:02:36 -04:00
SachaG
9865eb5f63
Use field.nestedInput instead of type="nested"
2018-05-23 22:04:32 +09:00
SachaG
2edebcf551
Do not apply compact when object is not an array
2018-05-23 17:09:32 +09:00
Apollinaire
f82efb1803
Popup warning on page closing for SmartForm unsaved changes
2018-05-22 09:51:36 +02:00
SachaG
d378cd9654
Small migration improvements
2018-05-22 08:43:27 +09:00
SachaG
2b0f8cdd88
Change data structure of translations in db to match MongoDB standards
2018-05-21 09:42:08 +09:00
SachaG
b10d8bdb5c
Formatting
2018-05-11 09:52:04 +09:00
SachaG
ab674a1163
Merge branch 'devel' into i18n2
...
# Conflicts:
# packages/vulcan-forms/lib/components/Form.jsx
# packages/vulcan-forms/lib/components/FormComponent.jsx
2018-05-11 09:48:34 +09:00
SachaG
f320b3363b
Move registerSetting to index
2018-05-10 10:18:55 +09:00