Sha256: 82ee478f5dcbea98f693115d85b65224cce8ce60a01095285016691763bf3427

Contents?: true

Size: 1.06 KB

Versions: 3

Compression:

Stored size: 1.06 KB

Contents

import { connect } from 'react-redux';
import { reduxForm } from 'redux-form';

import * as FormActions from 'foremanReact/redux/actions/common/forms';

import { NEW_TEMPLATE_SYNC_FORM_NAME } from './NewTemplateSyncFormConstants';
import NewTemplateSyncForm from './NewTemplateSyncForm';

import {
  selectImportSettings,
  selectExportSettings,
} from '../../NewTemplateSyncSelectors';
import {
  selectInitialFormValues,
  selectRegisteredFields,
} from './NewTemplateSyncFormSelectors';

const mapStateToProps = (state, ownProps) => {
  const importSettings = selectImportSettings(state);

  const exportSettings = selectExportSettings(state);

  const initialFormValues = selectInitialFormValues(state);

  const currentFields = selectRegisteredFields(
    NEW_TEMPLATE_SYNC_FORM_NAME,
    state
  );

  return {
    initialValues: { ...initialFormValues },
    importSettings,
    exportSettings,
    currentFields,
  };
};

const form = reduxForm({ form: NEW_TEMPLATE_SYNC_FORM_NAME })(
  NewTemplateSyncForm
);
export default connect(
  mapStateToProps,
  FormActions
)(form);

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
foreman_templates-7.0.4 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/index.js
foreman_templates-7.0.3 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/index.js
foreman_templates-7.0.2 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/index.js