Commit graph

204 commits

Author SHA1 Message Date
SachaG
e783d51dca v1.11.2 2018-06-16 08:57:45 +09:00
SachaG
c0650893fa v1.11.1 2018-06-14 08:51:03 +09:00
SachaG
55f3e10581 Re-enable form on submission success 2018-06-13 18:28:01 +09:00
SachaG
d3b6591f63 v1.11.0 2018-06-02 08:35:42 +09:00
SachaG
91ade8cd15 Do not use defaultValues for edit forms 2018-06-02 08:33:50 +09:00
SachaG
8f873fc6ad Revert changes to schema_utils for now because they break FormIntl 2018-05-27 09:59:26 +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
2b05700e41 Pass "raw" component constructor down to FormComponentInner instead of passing function that instantiates it 2018-05-23 17:12:04 +09:00
SachaG
2edebcf551 Do not apply compact when object is not an array 2018-05-23 17:09:32 +09:00
SachaG
1951000118 Merge branch 'master' into devel
# Conflicts:
#	README.md
2018-05-23 15:12:33 +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
cb93292e08 Do not try to be smart about translations order after all 2018-05-21 10:33:36 +09:00
SachaG
2b0f8cdd88 Change data structure of translations in db to match MongoDB standards 2018-05-21 09:42:08 +09:00
SachaG
640a52d3c2 v1.10.1 2018-05-18 08:27:41 +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
9638e4a759 Merge branch 'erikdakoda5' of https://github.com/ErikDakoda/Vulcan into ErikDakoda-erikdakoda5
# Conflicts:
#	packages/vulcan-forms/lib/components/FormComponent.jsx
2018-05-11 09:40:45 +09:00
Erik Dakoda
2fe3b2cd28
Merge branch 'devel' into erikdakoda5 2018-05-10 10:10:27 -04:00
Erik Schannen
150d9392e7 Changes to SmartForm behaviour - refactoring
- Added new `FormComponent.isCustomInput` method
 - Pulled `renderComponent` up from `FormComponentInner` to `FormComponent`
 - Pulled some input-type-specific logic up when it was universal, or pushed it down when it should be handled by each ui library
2018-05-10 10:03:59 -04:00
SachaG
af666027c3 Add locale field to user schema; change it when setLocale is called on client 2018-05-10 17:48:06 +09:00
SachaG
6979ac8bee addLocale -> registerLocale 2018-05-10 17:17:44 +09:00
SachaG
f320b3363b Move registerSetting to index 2018-05-10 10:18:55 +09:00
SachaG
d60b16ea0d Merge branch 'erikdakoda5' of https://github.com/ErikDakoda/Vulcan into ErikDakoda-erikdakoda5
# Conflicts:
#	packages/vulcan-forms/lib/components/FormComponent.jsx
2018-05-10 09:44:50 +09:00
SachaG
6a30f44adf Merge branch 'devel' into i18n2
# Conflicts:
#	packages/vulcan-forms/lib/components/FormComponent.jsx
2018-05-10 08:34:50 +09:00
ochicf
d3cd373606 merge value only when is array or object and is an accepted type 2018-05-09 15:59:59 +02:00
SachaG
e8936b590b Add migration script; fix input prop bug 2018-05-09 10:38:21 +09:00
SachaG
4950f10b20 Get locale from GraphQL header 2018-05-09 09:46:47 +09:00
Erik Schannen
c3f33cb7e0 Changes to SmartForm behaviour
- Moved UI portions of FormComponent to FormComponentInner.jsx in vulcan-ui-bootstrap

 - Added user alert when the user navigates to another route while there are unsaved changed in the form (disabled by default)

 - Added setting forms.warnUnsavedChanges and SmartForm property warnUnsavedChanges to enable user alert

 - Added optional Revert button in FormSubmits to allow the user to discard any changes to the form; this is activated by passing a "revertCallback" property to SmartForm (which can be empty: () => {})

 - Added two functions that form components can access in the child context: refetchForm() to refetch the document from the database (in case it was updated by a background process), isChanged() to determine if there are any unsaved changes

 - For any phrases I have added to en_US.js I also added it to es_ES.js and fr_FR.js with the comment // TODO: translate

 - Updated Form.clearForm and Form.mutationSuccessCallback so that the user can continue working on the document after submitting it

 - The form now scrolls the flash message into view when a submit results in errors

 - Fixed bugs in FormComponent.shouldComponentUpdate() and Form.getDocument()

 - Fixed bug in FormComponent.handleChange() - number fields could not be cleared, only set to 0

 - Fixed a bug in FormComponent.getValue() - it returned the initial value of a checkbox even after it was set to false, and a number even after it was set to 0
2018-05-08 20:09:42 -04:00
SachaG
5b5884d33c Move intl logic to vulcan:lib (keep vulcan:i18n with same API as react-i18n); add isIntlField helper; add IntlString type 2018-05-08 12:23:42 +09:00
SachaG
2c03bd352a Use two-field strategy for getting all locale strings 2018-05-08 11:05:24 +09:00
SachaG
2dadce31e7 Merge branch 'devel' into i18n2 2018-05-07 17:46:14 +09:00
SachaG
55800a9b30 Add support for intl fields to API and SmartForm 2018-05-07 17:41:22 +09:00
SachaG
18bde83fbc v1.10.1 2018-05-04 12:04:10 +09:00
Bernardo Dias
087e5db923 Revert catch callback of removeMutation 2018-05-02 13:39:52 -03:00
Bernardo Dias
37200ec9ae Add document attributes to error catch of editMutation and removeMutation 2018-05-02 13:17:12 -03:00
Bernardo Dias
f099e6557d Include document prop in mutationErrorCallback method 2018-05-02 13:17:12 -03:00
SachaG
dd0ff54f9a Disable FormComponent shouldComponentUpdate callback for now 2018-05-02 18:14:15 +09:00
Bernardo Dias
aeef482e81
Update FormSubmit.jsx
`void` operator expects one argument, otherwise it throws `Uncaught SyntaxError: Unexpected token )`
2018-05-01 16:02:31 -03:00
SachaG
94fc8fffe9 Only rerender FormComponent when necessary 2018-04-30 09:36:42 +09:00
Sacha Greif
d94a568dd8
Merge pull request #1964 from Apollinaire/fieldErrors
Fix field errors display
2018-04-28 11:15:00 +09:00
SachaG
7b1c66cb43 Factor out error handling code; clean up form props; pass currentUser down to FormComponent 2018-04-28 10:54:03 +09:00
Apollinaire
1f67c9c29e Fix field errors display
Added `error.properties` to follow fae7b5a032 .
Kept `error.data` for backwards compatibility, not sure that it's needed. If it is, it might be good to add it to FormErrors too
2018-04-27 18:40:48 +02:00
Sacha Greif
c4efabdd07
Merge pull request #1960 from justinr1234/fix-form-props
Fix Form props
2018-04-24 10:31:04 +09:00
SachaG
f9ed4b0dd5 Button -> Components.Button 2018-04-24 10:20:51 +09:00
Justin Reynolds
30e340d8af Fix Form props 2018-04-23 13:00:08 -05:00
SachaG
2e0f9184cc Fixing mistakes 2018-04-23 09:51:33 +09:00
SachaG
b4f960301b Isolate bootstrap dependencies in new vulcan-ui-bootstrap package 2018-04-23 09:47:04 +09:00
SachaG
63bc4e562a v1.9.1 2018-04-21 18:30:15 +09:00