Sha256: 9079f094e82baf4f6d5d41fbf37ed16aa29ee1c46eeb9b7c305a874d98fe0151

Contents?: true

Size: 1.21 KB

Versions: 52

Compression:

Stored size: 1.21 KB

Contents

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Switch, FieldLevelHelp } from 'patternfly-react';
import { translate as __ } from 'foremanReact/common/I18n';
import './insightsSyncSwitcher.scss';

class InsightsSyncSwitcher extends Component {
  handleToggle = () => {
    const { insightsSyncEnabled, setInsightsSyncEnabled } = this.props;

    const toggledInsightsSyncEnabled = !insightsSyncEnabled;
    setInsightsSyncEnabled(toggledInsightsSyncEnabled);
  };

  render() {
    const { insightsSyncEnabled } = this.props;

    return (
      <div className="insights_sync_switcher">
        <span>Synchronize Automatically</span>
        <FieldLevelHelp
          content={__(
            'Enable automatic synchronization of Insights recommendations from the Red Hat cloud'
          )}
        />
        <Switch
          size="mini"
          value={insightsSyncEnabled}
          onChange={this.handleToggle}
        />
      </div>
    );
  }
}

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

InsightsSyncSwitcher.defaultProps = {
  insightsSyncEnabled: true,
};

export default InsightsSyncSwitcher;

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
foreman_rh_cloud-3.0.33 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
foreman_rh_cloud-3.0.32 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
foreman_rh_cloud-3.0.29 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
foreman_rh_cloud-3.0.28 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
foreman_rh_cloud-3.0.26 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
foreman_rh_cloud-3.0.25 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
foreman_rh_cloud-3.0.24.1 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
foreman_rh_cloud-4.0.24.1 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
foreman_rh_cloud-3.0.24 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
foreman_rh_cloud-4.0.24 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
foreman_rh_cloud-3.0.23 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
foreman_rh_cloud-4.0.23 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
foreman_rh_cloud-3.0.22 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
foreman_rh_cloud-4.0.22 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
foreman_rh_cloud-4.0.21.1 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
foreman_rh_cloud-3.0.21.1 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
foreman_rh_cloud-3.0.21 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
foreman_rh_cloud-3.0.20 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
foreman_rh_cloud-3.0.19 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js
foreman_rh_cloud-2.0.18.1 webpack/InsightsCloudSync/Components/InsightsSyncSwitcher/InsightsSyncSwitcher.js