Sha256: 04e0814268c17daf13ae8617c6f0559ebe3e8814d4c7e0d279d7baacde4b13ab

Contents?: true

Size: 1.32 KB

Versions: 41

Compression:

Stored size: 1.32 KB

Contents

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

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

import AnsibleRole from './AnsibleRole';

const AvailableRolesList = ({
  unassignedRoles,
  pagination,
  itemCount,
  onListingChange,
  onAddRole,
  loading,
}) => (
  <ListView>
    <div className="sticky-pagination">
      <PaginationWrapper
        viewType="list"
        itemCount={itemCount}
        pagination={pagination}
        onChange={onListingChange}
        dropdownButtonId="available-ansible-roles-pagination-row-dropdown"
      />
    </div>
    <LoadingState loading={loading}>
      {unassignedRoles.map(role => (
        <AnsibleRole
          key={role.id}
          role={role}
          icon="fa fa-plus-circle"
          onClick={onAddRole}
        />
      ))}
    </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

41 entries across 41 versions & 1 rubygems

Version Path
foreman_ansible-6.3.4 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-6.3.3 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-6.3.2 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-6.3.1 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-6.4.1 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-6.4.0 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-6.3.0 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-6.2.0 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-6.1.1 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-6.0.2 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-6.1.0 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-6.0.1 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-5.1.3 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-6.0.0 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-5.1.2 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-5.1.1 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-5.1.0 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-4.0.3.5 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-4.0.3.4 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
foreman_ansible-4.0.3.3 webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js