Sha256: 5990a4ef8ad9f334484861bd1a6caf04891e5f962302e05cb5992d347076d252

Contents?: true

Size: 675 Bytes

Versions: 6

Compression:

Stored size: 675 Bytes

Contents

import { createSelector } from 'reselect';

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

export const selectInitialFormValues = createSelector(
  selectImportSettings,
  selectExportSettings,
  (importSettings, exportSettings) =>
    importSettings
      .concat(exportSettings)
      .reduce(
        (memo, item) => Object.assign(memo, { [item.name]: item.value }),
        {}
      )
);

const selectFormState = (formName, state) =>
  state.form && state.form[formName] ? state.form[formName] : {};

export const selectRegisteredFields = (formName, state) =>
  selectFormState(formName, state).registeredFields || {};

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
foreman_templates-7.0.7 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-7.0.6 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-7.0.5 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-7.0.4 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-7.0.3 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-7.0.2 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js