Sha256: 4cbe24d6a179f2ea2e33e9046de50ec797c34fc7e91b9c30d3de7ee116e1d849

Contents?: true

Size: 1.39 KB

Versions: 21

Compression:

Stored size: 1.39 KB

Contents

import React from 'react';
import PropTypes from 'prop-types';

import { ListView, LoadingState } from 'patternfly-react';
import Pagination from 'foremanReact/components/Pagination';

import AnsibleRole from './AnsibleRole';

const AvailableRolesList = ({
  unassignedRoles,
  pagination,
  itemCount,
  onListingChange,
  onAddRole,
  loading,
}) => (
  <ListView>
    <div className="sticky-pagination">
      <Pagination
        viewType="list"
        itemCount={itemCount}
        updateParamsByUrl={false}
        page={pagination.page}
        perPage={pagination.perPage}
        onChange={onListingChange}
        dropdownButtonId="available-ansible-roles-pagination-row-dropdown"
      />
    </div>
    <LoadingState loading={loading}>
      {unassignedRoles.map((role, index) => (
        <AnsibleRole
          key={role.id}
          role={role}
          icon="fa fa-plus-circle"
          onClick={onAddRole}
          index={index}
        />
      ))}
    </LoadingState>
  </ListView>
);

AvailableRolesList.propTypes = {
  unassignedRoles: PropTypes.arrayOf(PropTypes.object).isRequired,
  pagination: PropTypes.shape({
    page: PropTypes.number,
    perPage: PropTypes.number,
  }).isRequired,
  itemCount: PropTypes.number.isRequired,
  onListingChange: PropTypes.func.isRequired,
  onAddRole: PropTypes.func.isRequired,
  loading: PropTypes.bool.isRequired,
};

export default AvailableRolesList;

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
foreman_ansible-15.0.2 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-15.0.1 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-15.0.0 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-14.2.2 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-14.2.1 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-13.0.7 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-14.2.0 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-14.1.1 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-14.1.0 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-13.0.5 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-14.0.0 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-13.0.4 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-13.0.3 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-13.0.2 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-13.0.1 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-13.0.0 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-12.0.7 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-10.4.4 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-12.0.6 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-12.0.5 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js