webpack/components/AnsibleRolesAndVariables/index.js in foreman_ansible-7.0.4 vs webpack/components/AnsibleRolesAndVariables/index.js in foreman_ansible-7.1.0

- old
+ new

@@ -1,12 +1,15 @@ import React from 'react'; -import { useDispatch } from 'react-redux'; +import { useDispatch, useSelector } from 'react-redux'; import { push } from 'connected-react-router'; +import { STATUS } from 'foremanReact/constants'; + 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' }, @@ -17,15 +20,18 @@ 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;