diff --git a/package-lock.json b/package-lock.json index e3d3ecfbc8229283347d98ab50d8df6a9b309cc9..8a493c2b8bac169b1651a32057be720d171053ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,9 +24,6 @@ "node-request-interceptor": "^0.6.3", "notistack": "^3.0.1", "openapi-backend": "^3.9.2", - "primeflex": "^2.0.0", - "primeicons": "^4.1.0", - "primereact": "^9.6.0", "react": "^18.2.0", "react-cookie": "^4.1.1", "react-dom": "^18.2.0", @@ -28938,35 +28935,6 @@ "node": ">= 0.8" } }, - "node_modules/primeflex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/primeflex/-/primeflex-2.0.0.tgz", - "integrity": "sha512-t6AG3iRI1rh04uI+9nC4JSlbKfA8PnpRDFtjyqi3rDSLRgdfOuhIiunJbjVQ4alnnCfuQAAbVyde1AKN9QxT/w==" - }, - "node_modules/primeicons": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/primeicons/-/primeicons-4.1.0.tgz", - "integrity": "sha512-uEv2pSPk1zQCfaB2VgnUfnUxxlGryYi+5rbdxmZBBt5v9S/pscIQYS5YDLxsQZ7D9jn5c76+Tx5wX/2J1nK6sA==" - }, - "node_modules/primereact": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/primereact/-/primereact-9.6.0.tgz", - "integrity": "sha512-+9nhZkh914aSDh2phuSm3BQNKQW0kpcBZqUd+Jdlpg+f6fvgNGGUr2wgZiqfXljkHeCEHdWO/wqB8WvfzqjOVw==", - "dependencies": { - "@types/react-transition-group": "^4.4.1", - "react-transition-group": "^4.4.1" - }, - "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0", - "react": "^17.0.0 || ^18.0.0", - "react-dom": "^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -61842,25 +61810,6 @@ "integrity": "sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==", "dev": true }, - "primeflex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/primeflex/-/primeflex-2.0.0.tgz", - "integrity": "sha512-t6AG3iRI1rh04uI+9nC4JSlbKfA8PnpRDFtjyqi3rDSLRgdfOuhIiunJbjVQ4alnnCfuQAAbVyde1AKN9QxT/w==" - }, - "primeicons": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/primeicons/-/primeicons-4.1.0.tgz", - "integrity": "sha512-uEv2pSPk1zQCfaB2VgnUfnUxxlGryYi+5rbdxmZBBt5v9S/pscIQYS5YDLxsQZ7D9jn5c76+Tx5wX/2J1nK6sA==" - }, - "primereact": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/primereact/-/primereact-9.6.0.tgz", - "integrity": "sha512-+9nhZkh914aSDh2phuSm3BQNKQW0kpcBZqUd+Jdlpg+f6fvgNGGUr2wgZiqfXljkHeCEHdWO/wqB8WvfzqjOVw==", - "requires": { - "@types/react-transition-group": "^4.4.1", - "react-transition-group": "^4.4.1" - } - }, "process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", diff --git a/package.json b/package.json index 51a055aa0d1b1d3cfee49a777510ab9942042fa0..b5d604a18fbd81e01761a326fa5a0ae2cb7e48d9 100644 --- a/package.json +++ b/package.json @@ -20,9 +20,6 @@ "node-request-interceptor": "^0.6.3", "notistack": "^3.0.1", "openapi-backend": "^3.9.2", - "primeflex": "^2.0.0", - "primeicons": "^4.1.0", - "primereact": "^9.6.0", "react": "^18.2.0", "react-cookie": "^4.1.1", "react-dom": "^18.2.0", diff --git a/src/components/common/table/CustomTable.css b/src/components/common/table/CustomTable.css deleted file mode 100644 index 7e08a10ca778ac9b0c1f55666fa2edc9e3771c42..0000000000000000000000000000000000000000 --- a/src/components/common/table/CustomTable.css +++ /dev/null @@ -1,133 +0,0 @@ -::-webkit-scrollbar { - width: 6px; - height: 6px; -} - -::-webkit-scrollbar-track { - background: #f1f1f1; - border-radius: 3px; -} - -::-webkit-scrollbar-thumb { - background: #888; - border-radius: 3px; -} - -::-webkit-scrollbar-thumb:hover { - background: #555; -} - -.ccce-custom-table .p-ccce-custom-table .p-datatable-scrollable-body { - overflow-y: auto !important; -} - -.ccce-custom-table .p-ccce-custom-table .p-datatable-tbody > tr.p-row-odd { - background: rgba(0, 0, 0, 0.02); -} - -.ccce-custom-table .p-ccce-custom-table .p-datatable-scrollable-header, -.ccce-custom-table .p-ccce-custom-table .p-datatable-thead > tr > th { - background: #e8e9ea; -} - -.ccce-custom-table .p-ccce-custom-table .p-column-title { - font-family: "Segoe UI", "Roboto", "Noto Sans"; - font-weight: 600; - font-size: 0.875rem; -} - -.ccce-custom-table .p-ccce-custom-table .p-datatable-tbody { - font-family: "Segoe UI", "Roboto", "Noto Sans"; - font-size: 0.875rem; -} - -.ccce-custom-table - .p-ccce-custom-table - .p-datatable-tbody - .MuiTypography-body1 { - font-size: 0.875rem; -} - -.ccce-custom-table .p-ccce-custom-table .p-paginator { - font-family: "Segoe UI", "Roboto", "Noto Sans"; - font-size: 0.875rem; -} - -.ccce-custom-table .p-ccce-custom-table .p-paginator .p-link { - font-size: 0.875rem; -} - -.ccce-custom-table .p-ccce-custom-table .p-paginator .p-dropdown-label { - font-size: 0.875rem; -} - -.ccce-custom-table - .p-ccce-custom-table - .p-datatable-tbody - > tr.inconsistentState { - background-color: #f5d2ce; -} -.ccce-custom-table - .p-ccce-custom-table - .p-datatable-tbody - > tr.inconsistentState:hover { - background-color: #f7c7c1; -} - -.ccce-custom-table .p-ccce-custom-table .p-datatable-tbody > tr.discrepancy { - background-color: #ffffc2; -} -.ccce-custom-table - .p-ccce-custom-table - .p-datatable-tbody - > tr.discrepancy:hover { - background-color: #fff380; -} - -.p-datatable-tbody > tr.isLink { - cursor: pointer; -} - -.shortenLongDataLines { - text-overflow: ellipsis; - white-space: nowrap; - overflow: hidden; -} - -.ccce-custom-table - .p-ccce-custom-table - .p-datatable-tbody - > tr.deploymentFailed { - background-color: #f5d2ce; -} -.ccce-custom-table - .p-ccce-custom-table - .p-datatable-tbody - > tr.deploymentFailed:hover { - background-color: #f7c7c1; -} - -.ccce-custom-table .p-ccce-custom-table .p-datatable-tbody > tr.iocNotDeployed { - color: #9e9e9e; -} - -.ccce-custom-table - .p-ccce-custom-table - .p-datatable-tbody - > tr.iocNotDeployed:hover { - color: #8e8e8e; -} - -.ccce-custom-table - .p-ccce-custom-table - .p-datatable-tbody - > tr.csentryIdInvalid { - color: #9e9e9e; -} - -.ccce-custom-table - .p-ccce-custom-table - .p-datatable-tbody - > tr.csentryIdInvalid:hover { - color: #8e8e8e; -} diff --git a/src/components/common/table/CustomTable.js b/src/components/common/table/CustomTable.js deleted file mode 100644 index 071709f6b19113afa5149058d6bcd2eafdea4288..0000000000000000000000000000000000000000 --- a/src/components/common/table/CustomTable.js +++ /dev/null @@ -1,160 +0,0 @@ -import React, { useRef, useState } from "react"; -import PropTypes from "prop-types"; -import { LinearProgress, Paper } from "@mui/material"; -import { DataTable } from "primereact/datatable"; -import { Column } from "primereact/column"; -import { ContextMenu } from "primereact/contextmenu"; -import "primeicons/primeicons.css"; -import "primereact/resources/themes/mdc-light-indigo/theme.css"; -import "primereact/resources/primereact.css"; -import "primeflex/primeflex.css"; -import "./CustomTable.css"; - -export function CustomTable(props) { - const { - columns, - rows, - handleRowClick, - itemLink, - totalCount, - lazyParams, - setLazyParams, - columnSort, - setColumnSort, - rowsPerPage, - loading = false, - paginator = true, - paginatorTemplate - } = props; - - const dynamicColumns = columns.map((col, i) => { - return ( - <Column - key={col.id} - field={col.id} - header={col.label} - style={{ width: col.width, textAlign: col.textAlign }} - body={col.body} - sortable={col.sortable} - /> - ); - }); - - const handleClick = (event) => { - if (handleRowClick) { - handleRowClick(event.data.id, event.data); - } - }; - - const handleRightClickOpenInNewTab = (item) => { - if (itemLink) { - window.open(itemLink(item), "_blank"); - } - }; - - const onPage = (event) => { - setLazyParams(event); - }; - - const onSort = (event) => { - setColumnSort(event); - }; - - const rowClassName = (rowData) => { - var resultObject = {}; - - // if row is clickable -> change cursor by adding 'a new' className - if (handleRowClick) { - resultObject.isLink = true; - } - - if (rowData.iocNotDeployed) { - resultObject.iocNotDeployed = true; - } - - if (rowData.csentryIdInvalid) { - resultObject.csentryIdInvalid = true; - } - - if (rowData.inconsistentState) { - resultObject.inconsistentState = true; - return resultObject; - } else if (rowData.discrepancy) { - resultObject.discrepancy = true; - return resultObject; - } else if (rowData.exporterUnknown) { - resultObject.exporterUnknown = true; - return resultObject; - } else if (rowData.deploymentFailed) { - resultObject.deploymentFailed = true; - } - - return resultObject; - }; - - const cm = useRef(null); - const menuModel = [ - { - label: "Open in new tab", - icon: "pi pi-fw pi-window-maximize", - command: () => handleRightClickOpenInNewTab(selectedItem) - } - ]; - const [selectedItem, setSelectedItem] = useState(null); - - return ( - <div className="ccce-custom-table"> - {itemLink && ( - <ContextMenu - model={menuModel} - ref={cm} - onHide={() => setSelectedItem(null)} - /> - )} - <Paper> - <DataTable - className="p-ccce-custom-table" - lazy - first={lazyParams.page * lazyParams.rows} - onPage={onPage} - onSort={onSort} - sortField={columnSort?.sortField} - sortOrder={columnSort?.sortOrder} - value={rows} - stripedRows - scrollable - resizableColumns - columnResizeMode="fit" - paginator={paginator} - paginatorTemplate={ - paginatorTemplate ?? - "CurrentPageReport FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown" - } - currentPageReportTemplate="Showing {first} to {last} of {totalRecords}" - rows={lazyParams.rows} - rowsPerPageOptions={rowsPerPage} - rowHover={handleRowClick} - onRowClick={(event) => handleClick(event)} - rowClassName={rowClassName} - totalRecords={totalCount} - emptyMessage={loading ? <LinearProgress /> : "No records found"} - contextMenuSelection={selectedItem} - onContextMenuSelectionChange={(e) => setSelectedItem(e.value)} - onContextMenu={ - itemLink ? (e) => cm.current?.show(e.originalEvent) : null - } - > - {dynamicColumns} - </DataTable> - </Paper> - </div> - ); -} - -CustomTable.propTypes = { - columns: PropTypes.arrayOf( - PropTypes.shape({ id: PropTypes.string.isRequired }) - ).isRequired, - rows: PropTypes.array.isRequired, - handleRowClick: PropTypes.func -}; diff --git a/src/components/common/table/index.js b/src/components/common/table/index.js deleted file mode 100644 index 809926a7e333c10c88a684f0a41c84feb513f304..0000000000000000000000000000000000000000 --- a/src/components/common/table/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import { CustomTable } from "./CustomTable"; - -export { CustomTable }; -export default CustomTable; diff --git a/src/components/statistics/HostStatistics/HostStatistics.js b/src/components/statistics/HostStatistics/HostStatistics.js index c4023e959cb9fdde2c6192288faff7617acfccc7..7e5f9af98e6e11f745f4002cd0c77f296058e38a 100644 --- a/src/components/statistics/HostStatistics/HostStatistics.js +++ b/src/components/statistics/HostStatistics/HostStatistics.js @@ -40,7 +40,7 @@ export function HostStatistics() { headerName: "", align: "right" }} - striped + sx={{ border: 0 }} /> </Paper> ); diff --git a/src/components/statistics/IOCStatistics/IOCStatistics.js b/src/components/statistics/IOCStatistics/IOCStatistics.js index 0f5afea7db7bb31bae74eb98c24eb42a2e165228..96f3884ca919b7124df115f2c27fbc7069287c53 100644 --- a/src/components/statistics/IOCStatistics/IOCStatistics.js +++ b/src/components/statistics/IOCStatistics/IOCStatistics.js @@ -34,7 +34,7 @@ export function IOCStatistics() { headerName: "", align: "right" }} - striped + sx={{ border: 0 }} /> </Paper> );