import React from 'react'; import PropTypes from 'prop-types'; import { getURIsearch } from 'foremanReact/common/urlHelpers'; import { Spinner, Button, Icon } from 'patternfly-react'; import PageLayout from 'foremanReact/routes/common/PageLayout/PageLayout'; import { translate as __ } from 'foremanReact/common/I18n'; import { getURIQuery } from 'foremanReact/common/helpers'; import ExportButton from 'foremanReact/routes/common/PageLayout/components/ExportButton/ExportButton'; import { STATUS } from 'foremanReact/constants'; import { useForemanModal } from 'foremanReact/components/ForemanModal/ForemanModalHooks'; import TasksDashboard from '../TasksDashboard'; import TasksTable from './TasksTable'; import { resolveSearchQuery, getCSVurl } from './TasksTableHelpers'; import ConfirmModal from './Components/ConfirmModal/'; import { TASKS_SEARCH_PROPS, CANCEL_SELECTED_MODAL, RESUME_SELECTED_MODAL, FORCE_UNLOCK_SELECTED_MODAL, CONFIRM_MODAL, } from './TasksTableConstants'; import { ActionSelectButton } from './Components/ActionSelectButton'; import './TasksTablePage.scss'; import { SelectAllAlert } from './Components/SelectAllAlert'; const TasksTablePage = ({ getBreadcrumbs, history, createHeader, selectAllRows, showSelectAll, modalID, openModalAction, ...props }) => { const url = history.location.pathname + history.location.search; const uriQuery = getURIQuery(url); const onSearch = searchQuery => { resolveSearchQuery(searchQuery, history); }; const { setModalOpen, setModalClosed } = useForemanModal({ id: CONFIRM_MODAL, }); const openModal = id => openModalAction(id, setModalOpen); return (