Sha256: d0d1762de1f8df658adf078f882b72947a7f3cfa8073634abe657b0a75c2ec95

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 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

2 entries across 2 versions & 1 rubygems

Version Path
foreman_templates-7.0.6 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/index.js
foreman_templates-7.0.5 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/index.js