Skip to content

Commit

Permalink
fix: remove ascending and descending ordering (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
jabahum authored Nov 28, 2023
1 parent bf69fb2 commit 2456e29
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 46 deletions.
5 changes: 3 additions & 2 deletions src/completed-list/completed-list.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
formatDate,
parseDate,
usePagination,
isDesktop,
} from "@openmrs/esm-framework";
import {
DataTable,
Expand Down Expand Up @@ -119,7 +120,7 @@ const CompletedList: React.FC<CompletedlistProps> = ({ fulfillerStatus }) => {
return (
<div>
<div className={styles.headerBtnContainer}></div>
<DataTable rows={tableRows} headers={columns} isSortable useZebraStyles>
<DataTable rows={tableRows} headers={columns} useZebraStyles>
{({
rows,
headers,
Expand Down Expand Up @@ -170,7 +171,7 @@ const CompletedList: React.FC<CompletedlistProps> = ({ fulfillerStatus }) => {
<TableRow>
{headers.map((header) => (
<TableHeader {...getHeaderProps({ header })}>
{header.header}
{header.header?.content ?? header.header}
</TableHeader>
))}
</TableRow>
Expand Down
42 changes: 2 additions & 40 deletions src/queue-list/laboratory-patient-list.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,44 +140,6 @@ const LaboratoryPatientList: React.FC<LaboratoryPatientListProps> = () => {
},
}));
}, [paginatedQueueEntries, t]);

// const handleFilter = ({
// rowIds,
// headers,
// cellsById,
// inputValue,
// getCellId,
// }: FilterProps): Array<string> => {
// return rowIds.filter((rowId) =>
// headers.some(({ key }) => {
// const cellId = getCellId(rowId, key);
// const filterableValue = cellsById[cellId].value;
// const filterTerm = inputValue.toLowerCase();

// if (typeof filterableValue === "boolean") {
// return false;
// }
// if (filterableValue.hasOwnProperty("content")) {
// if (Array.isArray(filterableValue.content.props.children)) {
// return (
// "" + filterableValue.content.props.children[1].props.children
// )
// .toLowerCase()
// .includes(filterTerm);
// }
// if (typeof filterableValue.content.props.children === "object") {
// return ("" + filterableValue.content.props.children.props.children)
// .toLowerCase()
// .includes(filterTerm);
// }
// return ("" + filterableValue.content.props.children)
// .toLowerCase()
// .includes(filterTerm);
// }
// return ("" + filterableValue).toLowerCase().includes(filterTerm);
// })
// );
// };
if (isLoading) {
return <DataTableSkeleton role="progressbar" />;
}
Expand All @@ -186,7 +148,7 @@ const LaboratoryPatientList: React.FC<LaboratoryPatientListProps> = () => {
return (
<div>
<div className={styles.headerBtnContainer}></div>
<DataTable rows={tableRows} headers={columns} isSortable useZebraStyles>
<DataTable rows={tableRows} headers={columns} useZebraStyles>
{({
rows,
headers,
Expand Down Expand Up @@ -223,7 +185,7 @@ const LaboratoryPatientList: React.FC<LaboratoryPatientListProps> = () => {
<TableExpandHeader />
{headers.map((header) => (
<TableHeader {...getHeaderProps({ header })}>
{header.header}
{header.header?.content ?? header.header}
</TableHeader>
))}
</TableRow>
Expand Down
4 changes: 2 additions & 2 deletions src/review-list/review-list.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const ReviewList: React.FC<ReviewlistProps> = ({ fulfillerStatus }) => {
return (
<div>
<div className={styles.headerBtnContainer}></div>
<DataTable rows={tableRows} headers={columns} isSortable useZebraStyles>
<DataTable rows={tableRows} headers={columns} useZebraStyles>
{({
rows,
headers,
Expand Down Expand Up @@ -199,7 +199,7 @@ const ReviewList: React.FC<ReviewlistProps> = ({ fulfillerStatus }) => {
<TableRow>
{headers.map((header) => (
<TableHeader {...getHeaderProps({ header })}>
{header.header}
{header.header?.content ?? header.header}
</TableHeader>
))}
</TableRow>
Expand Down
4 changes: 2 additions & 2 deletions src/work-list/work-list.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ const WorkList: React.FC<WorklistProps> = ({ fulfillerStatus }) => {
return (
<div>
<div className={styles.headerBtnContainer}></div>
<DataTable rows={tableRows} headers={columns} isSortable useZebraStyles>
<DataTable rows={tableRows} headers={columns} useZebraStyles>
{({
rows,
headers,
Expand Down Expand Up @@ -239,7 +239,7 @@ const WorkList: React.FC<WorklistProps> = ({ fulfillerStatus }) => {
<TableRow>
{headers.map((header) => (
<TableHeader {...getHeaderProps({ header })}>
{header.header}
{header.header?.content ?? header.header}
</TableHeader>
))}
</TableRow>
Expand Down

0 comments on commit 2456e29

Please sign in to comment.