Sha256: 656f6767ed34dfd443de004defa5e881e9a9558935b89041c7171233943332d3

Contents?: true

Size: 950 Bytes

Versions: 81

Compression:

Stored size: 950 Bytes

Contents

import React from 'react';
import PropTypes from 'prop-types';
import { useSelector, useDispatch } from 'react-redux';
import { selectSettings } from '../InventorySettingsSelectors';
import { handleToggle } from './AdvancedSettingActions';
import SwitcherPF4 from '../../../../common/Switcher/SwitcherPF4';
import { settingsDict } from './AdvancedSettingsConstants';

const AdvancedSetting = ({ setting }) => {
  const settingValue = useSelector(store => selectSettings(store)[setting]);
  const dispatch = useDispatch();
  const onToggle = () =>
    dispatch(handleToggle(settingsDict[setting].name, settingValue));
  return (
    <SwitcherPF4
      id={settingsDict[setting].name}
      label={settingsDict[setting].label}
      tooltip={settingsDict[setting].tooltip}
      isChecked={settingValue}
      onChange={onToggle}
    />
  );
};

AdvancedSetting.propTypes = {
  setting: PropTypes.string.isRequired,
};

export default AdvancedSetting;

Version data entries

81 entries across 81 versions & 1 rubygems

Version Path
foreman_rh_cloud-4.0.27 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
foreman_rh_cloud-3.0.26 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
foreman_rh_cloud-4.0.26 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
foreman_rh_cloud-4.0.25.1 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
foreman_rh_cloud-3.0.25 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
foreman_rh_cloud-4.0.25 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
foreman_rh_cloud-3.0.24.1 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
foreman_rh_cloud-4.0.24.1 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
foreman_rh_cloud-3.0.24 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
foreman_rh_cloud-4.0.24 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
foreman_rh_cloud-3.0.23 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
foreman_rh_cloud-4.0.23 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
foreman_rh_cloud-3.0.22 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
foreman_rh_cloud-4.0.22 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
foreman_rh_cloud-4.0.21.1 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
foreman_rh_cloud-3.0.21.1 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
foreman_rh_cloud-3.0.21 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
foreman_rh_cloud-3.0.20 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
foreman_rh_cloud-3.0.19 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js
foreman_rh_cloud-3.0.18.1 webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/index.js