Sha256: 376ea503cf90259dc4621eeeed42e5e3917b8c3d771a719fd20e3896e1158579

Contents?: true

Size: 1.22 KB

Versions: 20

Compression:

Stored size: 1.22 KB

Contents

import React from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { push } from 'connected-react-router';

import { STATUS } from 'foremanReact/constants';
import { translate as __ } from 'foremanReact/common/I18n';

import ImportRolesAndVariablesTable from './AnsibleRolesAndVariables';
import { onSubmit } from './AnsibleRolesAndVariablesActions';
import { ANSIBLE_ROLES_INDEX } from './AnsibleRolesAndVariablesConstants';
import { selectApiImportStatus } from './AnsibleRolesAndVariablesSelectors';

const WrappedImportRolesAndVariables = props => {
  const cols = [
    { title: __('Name') },
    { title: __('Operation') },
    { title: __('Variables') },
    { title: __('Host count') },
    { title: __('Hostgroup count') },
  ];
  const dispatch = useDispatch();
  const submit = (rows, proxy) => dispatch(onSubmit(rows, proxy));
  const onCancel = () => {
    dispatch(push(ANSIBLE_ROLES_INDEX));
  };
  const apiImportStatus = useSelector(selectApiImportStatus);

  return (
    <ImportRolesAndVariablesTable
      {...props}
      columnsData={cols}
      onSubmit={submit}
      onCancel={onCancel}
      isImporting={apiImportStatus === STATUS.PENDING}
    />
  );
};
export default WrappedImportRolesAndVariables;

Version data entries

20 entries across 20 versions & 1 rubygems

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