diff --git a/forms-flow-web/src/components/CustomComponents/TableComponents.js b/forms-flow-web/src/components/CustomComponents/TableComponents.js deleted file mode 100644 index 2d21c058cd..0000000000 --- a/forms-flow-web/src/components/CustomComponents/TableComponents.js +++ /dev/null @@ -1,137 +0,0 @@ -import React from "react"; -import { useTranslation } from "react-i18next"; -import Pagination from "react-js-pagination"; -import { Dropdown } from "react-bootstrap"; -import { HelperServices } from "@formsflow/service"; -import { CustomButton, DownArrowIcon } from "@formsflow/components"; -import PropTypes from "prop-types"; - -export const ReusableTableRow = ({ item, gotoEdit, buttonLabel }) => { - const { t } = useTranslation(); - return ( - - - {item.name} - - - {item.parentProcessKey} - - {HelperServices?.getLocaldate(item.modified)} - - - - {item.status === "active" ? t("Live") : t("Draft")} - - - - - gotoEdit(item)} - dataTestid={`Edit ${buttonLabel} Button`} - /> - - - - ); -}; -ReusableTableRow.propTypes = { - item: PropTypes.shape({ - name: PropTypes.string.isRequired, - parentProcessKey: PropTypes.string, - modified: PropTypes.string, - status: PropTypes.string, - _id: PropTypes.string.isRequired, - }).isRequired, - gotoEdit: PropTypes.func.isRequired, - buttonLabel: PropTypes.string.isRequired, -}; -export const TableFooter = ({ - limit, - activePage, - totalCount, - handlePageChange, - onLimitChange, - pageOptions, -}) => { - const { t } = useTranslation(); - - return ( - - -
- - {t("Showing")} {(limit * activePage) - (limit - 1)} {t("to")}  - {Math.min(limit * activePage, totalCount)} {t("of")}  - {totalCount} {t("results")} - -
- - -
- -
- - -
- {t("Rows per page")} -
- - - {limit} - - - {pageOptions.map((option) => ( - onLimitChange(option.value)} - > - {option.text} - - ))} - - - -
-
- - - ); -}; -TableFooter.propTypes = { - limit: PropTypes.number.isRequired, - activePage: PropTypes.number.isRequired, - totalCount: PropTypes.number.isRequired, - handlePageChange: PropTypes.func.isRequired, - onLimitChange: PropTypes.func.isRequired, - pageOptions: PropTypes.arrayOf( - PropTypes.shape({ - value: PropTypes.number.isRequired, - text: PropTypes.string.isRequired, - }) - ).isRequired, -}; diff --git a/forms-flow-web/src/components/Modeler/DecisionTable.js b/forms-flow-web/src/components/Modeler/DecisionTable.js index 66a06a3718..9b82a0a090 100644 --- a/forms-flow-web/src/components/Modeler/DecisionTable.js +++ b/forms-flow-web/src/components/Modeler/DecisionTable.js @@ -1,13 +1,9 @@ import React, { useState, useEffect } from "react"; import { useSelector, useDispatch } from "react-redux"; -import { CustomButton, CustomSearch } from "@formsflow/components"; +import { CustomButton, CustomSearch ,ReusableProcessTableRow ,TableFooter} from "@formsflow/components"; import LoadingOverlay from "react-loading-overlay-ts"; import { useTranslation } from "react-i18next"; import SortableHeader from "../CustomComponents/SortableHeader"; -import { - ReusableTableRow, - TableFooter, -} from "../CustomComponents/TableComponents"; import { fetchAllProcesses } from "../../apiManager/services/processServices"; import { MULTITENANCY_ENABLED } from "../../constants/constants"; import { push } from "connected-react-router"; @@ -169,7 +165,7 @@ const DecisionTable = React.memo(() => { {dmn.map((dmnItem) => ( - { const searchText = useSelector((state) => state.process.bpmnSearchText); @@ -185,7 +182,7 @@ const SubFlow = React.memo(() => { {process.map((processItem) => ( -