Sha256: 511c2880f4c4d44937fc34f694cce73927a19a239c64c210dfeac5b6bdbbcea1

Contents?: true

Size: 551 Bytes

Versions: 16

Compression:

Stored size: 551 Bytes

Contents

import { createSelector } from 'reselect';

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

export const transformInitialValues = settings =>
  settings.reduce(
    (memo, item) => Object.assign(memo, { [item.name]: item.value }),
    {}
  );

export const selectInitialFormValues = createSelector(
  selectImportSettings,
  selectExportSettings,
  (importSettings, exportSettings) => ({
    import: transformInitialValues(importSettings),
    export: transformInitialValues(exportSettings),
  })
);

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
foreman_templates-10.0.2 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-10.0.1 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-10.0.0 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-9.5.1 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-9.5.0 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-9.3.3 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-9.3.2 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-9.3.1 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-9.4.0 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-9.3.0 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-9.2.0 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-9.1.0 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-9.0.2 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-9.0.1 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-9.0.0 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js
foreman_templates-8.0.0 webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js