Sha256: 04b0ccdf9dbff898f86a9595d386b2a3f74eddb4a10271065eeed99dbcb9742b

Contents?: true

Size: 1.77 KB

Versions: 23

Compression:

Stored size: 1.77 KB

Contents

import React from 'react';
import PropTypes from 'prop-types';
import { Grid } from 'patternfly-react';

import SearchBar from 'foremanReact/components/SearchBar';
import Pagination from 'foremanReact/components/Pagination/PaginationWrapper';
import { getControllerSearchProps } from 'foremanReact/constants';

import TargetingHosts from './TargetingHosts';
import './TargetingHostsPage.scss';

const TargetingHostsPage = ({
  handleSearch,
  searchQuery,
  apiStatus,
  items,
  totalHosts,
  pagination,
  handlePagination,
}) => (
  <div id="targeting_hosts">
    <Grid.Row>
      <Grid.Col md={6} className="title_filter">
        <SearchBar
          onSearch={query => handleSearch(query)}
          data={{
            ...getControllerSearchProps('hosts'),
            autocomplete: {
              id: 'targeting_hosts_search',
              searchQuery,
              url: '/hosts/auto_complete_search',
              useKeyShortcuts: true,
            },
            bookmarks: {},
          }}
        />
      </Grid.Col>
    </Grid.Row>
    <br />
    <TargetingHosts apiStatus={apiStatus} items={items} />
    <Pagination
      viewType="table"
      itemCount={totalHosts}
      pagination={pagination}
      onChange={args => handlePagination(args)}
      dropdownButtonId="targeting-hosts-pagination-dropdown"
      className="targeting-hosts-pagination"
    />
  </div>
);

TargetingHostsPage.propTypes = {
  handleSearch: PropTypes.func.isRequired,
  searchQuery: PropTypes.string.isRequired,
  apiStatus: PropTypes.string,
  items: PropTypes.array.isRequired,
  totalHosts: PropTypes.number.isRequired,
  pagination: PropTypes.object.isRequired,
  handlePagination: PropTypes.func.isRequired,
};

TargetingHostsPage.defaultProps = {
  apiStatus: null,
};

export default TargetingHostsPage;

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
foreman_remote_execution-5.0.8 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js
foreman_remote_execution-5.0.7 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js
foreman_remote_execution-5.0.6 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js
foreman_remote_execution-5.0.5 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js
foreman_remote_execution-5.0.4 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js
foreman_remote_execution-5.0.3 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js
foreman_remote_execution-5.0.2 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js
foreman_remote_execution-5.1.0 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js
foreman_remote_execution-5.0.1 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js
foreman_remote_execution-5.0.0 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js
foreman_remote_execution-4.8.0 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js
foreman_remote_execution-4.5.6 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js
foreman_remote_execution-4.5.5 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js
foreman_remote_execution-4.5.4 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js
foreman_remote_execution-4.7.0 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js
foreman_remote_execution-4.5.3 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js
foreman_remote_execution-4.5.2 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js
foreman_remote_execution-4.5.1 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js
foreman_remote_execution-4.6.0 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js
foreman_remote_execution-4.5.0 webpack/react_app/components/TargetingHosts/TargetingHostsPage.js