Move registerSetting to index

This commit is contained in:
SachaG 2018-05-10 10:18:55 +09:00
parent d60b16ea0d
commit f320b3363b
2 changed files with 6 additions and 6 deletions

View file

@ -24,7 +24,7 @@ This component expects:
import {
registerComponent, Components, runCallbacks, getCollection,
getErrors, registerSetting, getSetting, Utils
getErrors, getSetting, Utils
} from 'meteor/vulcan:core';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
@ -42,9 +42,6 @@ import isEqualWith from 'lodash/isEqualWith';
import { convertSchema, formProperties } from '../modules/schema_utils';
registerSetting('forms.warnUnsavedChanges', false,
'Warn user about unsaved changes before leaving route', true);
// unsetCompact
const unsetCompact = (object, path) => {
const parentPath = path.slice(0, path.lastIndexOf('.'));
@ -621,6 +618,7 @@ class Form extends Component {
// run error callback if it exists
if (this.props.errorCallback) this.props.errorCallback(document, error);
// scroll back up to show error messages
Utils.scrollIntoView('.flash-message');
};

View file

@ -1,5 +1,7 @@
import { registerComponent } from 'meteor/vulcan:core';
import { registerComponent, registerSetting } from 'meteor/vulcan:core';
registerSetting('forms.warnUnsavedChanges', false, 'Warn user about unsaved changes before leaving route', true);
import './components.js';
export {default as FormWrapper} from '../components/FormWrapper.jsx';
export { default as FormWrapper } from '../components/FormWrapper.jsx';