diff --git a/platform/ui/index.js b/platform/ui/index.js index ac7f13282..4071bb71f 100644 --- a/platform/ui/index.js +++ b/platform/ui/index.js @@ -27,6 +27,9 @@ export { Label, NavBar, Select, + StudyListExpandedRow, + StudyListPagination, + StudyListTable, Svg, Table, TableBody, diff --git a/platform/ui/package.json b/platform/ui/package.json index 6592f5fe3..5c5c65100 100644 --- a/platform/ui/package.json +++ b/platform/ui/package.json @@ -26,7 +26,6 @@ }, "dependencies": { "classnames": "^2.2.6", - "date-fns": "^2.10.0", "docz": "^2.2.0", "gatsby": "2.19.24", "gatsby-plugin-postcss": "^2.1.20", diff --git a/platform/ui/src/components/StudyListExpandedRow/StudyListExpandedRow.js b/platform/ui/src/components/StudyListExpandedRow/StudyListExpandedRow.js new file mode 100644 index 000000000..c913ca9e4 --- /dev/null +++ b/platform/ui/src/components/StudyListExpandedRow/StudyListExpandedRow.js @@ -0,0 +1,50 @@ +import React from 'react'; +import PropTypes from 'prop-types'; + +import { Table, TableHead, TableBody, TableRow, TableCell } from '@ohif/ui'; + +const StudyListExpandedRow = ({ + seriesTableColumns, + seriesTableDataSource, + children, +}) => { + return ( +
+
{children}
+
+ + + + {Object.keys(seriesTableColumns).map((columnKey) => { + return ( + + {seriesTableColumns[columnKey]} + + ); + })} + + + + + {seriesTableDataSource.map((row, i) => ( + + {Object.keys(row).map((cellKey) => { + const content = row[cellKey]; + return {content}; + })} + + ))} + +
+
+
+ ); +}; + +StudyListExpandedRow.propTypes = { + seriesTableDataSource: PropTypes.arrayOf(PropTypes.object).isRequired, + seriesTableColumns: PropTypes.object.isRequired, + children: PropTypes.node.isRequired, +}; + +export default StudyListExpandedRow; diff --git a/platform/ui/src/components/StudyListExpandedRow/index.js b/platform/ui/src/components/StudyListExpandedRow/index.js new file mode 100644 index 000000000..2442a9aaa --- /dev/null +++ b/platform/ui/src/components/StudyListExpandedRow/index.js @@ -0,0 +1,2 @@ +import StudyListExpandedRow from './StudyListExpandedRow'; +export default StudyListExpandedRow; diff --git a/platform/ui/src/views/StudyList/components/StudyListPagination.js b/platform/ui/src/components/StudyListPagination/StudyListPagination.js similarity index 68% rename from platform/ui/src/views/StudyList/components/StudyListPagination.js rename to platform/ui/src/components/StudyListPagination/StudyListPagination.js index 940ac1081..90966d5e3 100644 --- a/platform/ui/src/views/StudyList/components/StudyListPagination.js +++ b/platform/ui/src/components/StudyListPagination/StudyListPagination.js @@ -1,18 +1,22 @@ -import React, { useState } from 'react'; -import { - Typography, - ButtonGroup, - Button, - IconButton, - Icon, -} from '../../../components/'; +import React from 'react'; +import PropTypes from 'prop-types'; +import { Button, ButtonGroup, Icon, IconButton, Typography } from '@ohif/ui'; +<<<<<<< HEAD:platform/ui/src/views/StudyList/components/StudyListPagination.js const StudyListPagination = (props) => { const [currentPage, setCurrentPage] = useState(1); +======= +const StudyListPagination = ({ + onChangePage, + currentPage, + perPage, + onChangePerPage, +}) => { +>>>>>>> d5a288db1... feat: StudyListTable, ExpandedRow, API definitions (#1579):platform/ui/src/components/StudyListPagination/StudyListPagination.js const navigateToPage = (page) => { const toPage = page < 1 ? 1 : page; - setCurrentPage(toPage); + onChangePage(toPage); }; return ( @@ -22,9 +26,15 @@ const StudyListPagination = (props) => {