Sha256: ae135807825db671197327dabd7b7e7fa7e86c85b4addc858883fa4689f49421

Contents?: true

Size: 583 Bytes

Versions: 9

Compression:

Stored size: 583 Bytes

Contents

import {
  cloneDeep,
} from 'lodash';

export const transformForemanData = (fdata) => {
  if (fdata === undefined) {
    return "";
  }
  const result = {};
  fdata.map(item => result[item.id] = item.name)
  return (result);
}

export const filterParameterTypes = (options, parameters) => {
  const newOptions = cloneDeep(options);

  // hostparam can be used multiple times
  const alreadyUsed = parameters.map(item => item["type"]).filter(item => item != 'hostparam');

  // remove already used items
  alreadyUsed.forEach(item => delete newOptions[item])

  return newOptions;
}

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
foreman_acd-0.9.7 webpack/components/ParameterSelection/ParameterSelectionHelper.js
foreman_acd-0.9.5 webpack/components/ParameterSelection/ParameterSelectionHelper.js
foreman_acd-0.9.4 webpack/components/ParameterSelection/ParameterSelectionHelper.js
foreman_acd-0.9.3 webpack/components/ParameterSelection/ParameterSelectionHelper.js
foreman_acd-0.9.2.3 webpack/components/ParameterSelection/ParameterSelectionHelper.js
foreman_acd-0.9.2.2 webpack/components/ParameterSelection/ParameterSelectionHelper.js
foreman_acd-0.9.2.1 webpack/components/ParameterSelection/ParameterSelectionHelper.js
foreman_acd-0.9.2 webpack/components/ParameterSelection/ParameterSelectionHelper.js
foreman_acd-0.9.1 webpack/components/ParameterSelection/ParameterSelectionHelper.js