Sha256: fe7d99d7af2cc8fefa5a88740e69de753ef7c5d22edcb7e85ecac5a9b25ef4a4

Contents?: true

Size: 1.12 KB

Versions: 58

Compression:

Stored size: 1.12 KB

Contents

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { translate as __ } from 'foremanReact/common/I18n';
import SwitcherPF4 from '../../../common/Switcher/SwitcherPF4';
import './insightsSettings.scss';

class InsightsSettings extends Component {
  componentDidMount() {
    const { getInsightsSyncSettings } = this.props;
    getInsightsSyncSettings();
  }

  render() {
    const { insightsSyncEnabled, setInsightsSyncEnabled } = this.props;
    return (
      <div className="insights_settings">
        <SwitcherPF4
          id="insights_sync_switcher"
          label={__('Sync automatically')}
          tooltip={__(
            'Enable automatic synchronization of Insights recommendations from the Red Hat cloud'
          )}
          isChecked={insightsSyncEnabled}
          onChange={() => setInsightsSyncEnabled(!insightsSyncEnabled)}
        />
      </div>
    );
  }
}

InsightsSettings.propTypes = {
  insightsSyncEnabled: PropTypes.bool.isRequired,
  getInsightsSyncSettings: PropTypes.func.isRequired,
  setInsightsSyncEnabled: PropTypes.func.isRequired,
};

export default InsightsSettings;

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
foreman_rh_cloud-4.0.35 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js
foreman_rh_cloud-5.0.37 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js
foreman_rh_cloud-5.0.36 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js
foreman_rh_cloud-5.0.35 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js
foreman_rh_cloud-5.0.34 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js
foreman_rh_cloud-5.0.33 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js
foreman_rh_cloud-4.0.32 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js
foreman_rh_cloud-5.0.32 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js
foreman_rh_cloud-4.0.31 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js
foreman_rh_cloud-5.0.31 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js
foreman_rh_cloud-5.0.30 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js
foreman_rh_cloud-4.0.30 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js
foreman_rh_cloud-4.0.29 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js
foreman_rh_cloud-5.0.29 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js
foreman_rh_cloud-5.0.28 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js
foreman_rh_cloud-4.0.27 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js
foreman_rh_cloud-4.0.26 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js
foreman_rh_cloud-4.0.25.1 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js