Sha256: e734741b1a77c63ce3b879470dcb35198171192bca117c7ba2ab406c896f4d27

Contents?: true

Size: 1.76 KB

Versions: 43

Compression:

Stored size: 1.76 KB

Contents

import React from 'react';
import PropTypes from 'prop-types';
import PageLayout from 'foremanReact/routes/common/PageLayout/PageLayout';
import InsightsHeader from './Components/InsightsHeader';
import InsightsTable from './Components/InsightsTable';
import RemediationModal from './Components/RemediationModal';
import {
  INSIGHTS_SYNC_PAGE_TITLE,
  INSIGHTS_SEARCH_PROPS,
} from './InsightsCloudSyncConstants';
import './InsightsCloudSync.scss';
import Pagination from './Components/InsightsTable/Pagination';
import ToolbarDropdown from './Components/ToolbarDropdown';
import InsightsSettings from './Components/InsightsSettings';

const InsightsCloudSync = ({ syncInsights, query, fetchInsights }) => {
  const onRecommendationSync = () => syncInsights(fetchInsights, query);
  const toolbarButtons = (
    <>
      <span className="insights-toolbar-buttons">
        <RemediationModal />
        <ToolbarDropdown onRecommendationSync={onRecommendationSync} />
      </span>
      <span className="pull-right">
        <Pagination variant="top" isCompact />
      </span>
    </>
  );

  return (
    <div className="rh-cloud-insights">
      <InsightsSettings />
      <PageLayout
        searchable
        searchProps={INSIGHTS_SEARCH_PROPS}
        onSearch={nextQuery => fetchInsights({ query: nextQuery, page: 1 })}
        header={INSIGHTS_SYNC_PAGE_TITLE}
        toolbarButtons={toolbarButtons}
        searchQuery={query}
        beforeToolbarComponent={<InsightsHeader />}
      >
        <InsightsTable />
      </PageLayout>
    </div>
  );
};

InsightsCloudSync.propTypes = {
  syncInsights: PropTypes.func.isRequired,
  fetchInsights: PropTypes.func.isRequired,
  query: PropTypes.string,
};

InsightsCloudSync.defaultProps = {
  query: '',
};

export default InsightsCloudSync;

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
foreman_rh_cloud-10.0.3 webpack/InsightsCloudSync/InsightsCloudSync.js
foreman_rh_cloud-11.0.3 webpack/InsightsCloudSync/InsightsCloudSync.js
foreman_rh_cloud-9.0.59 webpack/InsightsCloudSync/InsightsCloudSync.js
foreman_rh_cloud-11.0.2 webpack/InsightsCloudSync/InsightsCloudSync.js
foreman_rh_cloud-11.0.1 webpack/InsightsCloudSync/InsightsCloudSync.js
foreman_rh_cloud-11.0.0 webpack/InsightsCloudSync/InsightsCloudSync.js
foreman_rh_cloud-9.0.58 webpack/InsightsCloudSync/InsightsCloudSync.js
foreman_rh_cloud-10.0.2 webpack/InsightsCloudSync/InsightsCloudSync.js
foreman_rh_cloud-9.0.57 webpack/InsightsCloudSync/InsightsCloudSync.js
foreman_rh_cloud-10.0.1 webpack/InsightsCloudSync/InsightsCloudSync.js
foreman_rh_cloud-9.0.56 webpack/InsightsCloudSync/InsightsCloudSync.js
foreman_rh_cloud-9.0.55 webpack/InsightsCloudSync/InsightsCloudSync.js
foreman_rh_cloud-9.0.54 webpack/InsightsCloudSync/InsightsCloudSync.js
foreman_rh_cloud-9.0.53 webpack/InsightsCloudSync/InsightsCloudSync.js
foreman_rh_cloud-9.0.52 webpack/InsightsCloudSync/InsightsCloudSync.js
foreman_rh_cloud-8.0.52 webpack/InsightsCloudSync/InsightsCloudSync.js
foreman_rh_cloud-9.0.51 webpack/InsightsCloudSync/InsightsCloudSync.js
foreman_rh_cloud-8.0.51 webpack/InsightsCloudSync/InsightsCloudSync.js
foreman_rh_cloud-7.0.48 webpack/InsightsCloudSync/InsightsCloudSync.js
foreman_rh_cloud-7.0.47 webpack/InsightsCloudSync/InsightsCloudSync.js