-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Khp3 6317 adapt lab manifest UI to match design (#295)
* Manifest dashboard summary done * Lab manifest listing ui adaptation done * Manifest detail header ui refactor done, * Delete dialog refactored to have samples table for thos selected * Previewing selected orders to be added to manifest in the sample dialog form * Cleaned up code * Fixed bug on lab manifest form and also on mutating links
- Loading branch information
Showing
27 changed files
with
662 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
packages/esm-lab-manifest-app/src/forms/active-order-selection-preview.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import React from 'react'; | ||
|
||
import { | ||
DataTable, | ||
Table, | ||
TableBody, | ||
TableCell, | ||
TableContainer, | ||
TableHead, | ||
TableHeader, | ||
TableRow, | ||
} from '@carbon/react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import styles from '../tables/lab-manifest-table.scss'; | ||
import { ActiveRequestOrder } from '../types'; | ||
|
||
interface ActiveOrdersSelectionPreviewProps { | ||
orders?: Array<ActiveRequestOrder>; | ||
} | ||
|
||
const ActiveOrdersSelectionPreview: React.FC<ActiveOrdersSelectionPreviewProps> = ({ orders = [] }) => { | ||
const { t } = useTranslation(); | ||
|
||
const headers = [ | ||
{ | ||
header: t('patientName', 'Patient name'), | ||
key: 'patientName', | ||
}, | ||
{ | ||
header: t('cccKDODNumber', 'CCC/KDOD Number'), | ||
key: 'cccKdod', | ||
}, | ||
{ | ||
header: t('dateRequested', 'Date Requested'), | ||
key: 'dateRequested', | ||
}, | ||
]; | ||
|
||
const tableRows = | ||
orders?.map((activeRequest) => { | ||
return { | ||
id: `${activeRequest.orderUuid}`, | ||
patientName: activeRequest.patientName, | ||
cccKdod: activeRequest.cccKdod, | ||
dateRequested: activeRequest.dateRequested, | ||
}; | ||
}) ?? []; | ||
return ( | ||
<div className={styles.widgetContainer}> | ||
<DataTable | ||
useZebraStyles | ||
size="sm" | ||
rows={tableRows ?? []} | ||
headers={headers} | ||
render={({ rows, headers, getHeaderProps, getRowProps, getTableProps, getTableContainerProps }) => ( | ||
<> | ||
<TableContainer {...getTableContainerProps()}> | ||
<Table {...getTableProps()}> | ||
<TableHead> | ||
<TableRow> | ||
{headers.map((header, i) => ( | ||
<TableHeader key={i} {...getHeaderProps({ header })}> | ||
{header.header} | ||
</TableHeader> | ||
))} | ||
</TableRow> | ||
</TableHead> | ||
<TableBody> | ||
{rows.map((row, i) => ( | ||
<TableRow key={i} {...getRowProps({ row })} onClick={(evt) => {}}> | ||
{row.cells.map((cell) => ( | ||
<TableCell key={cell.id}>{cell.value}</TableCell> | ||
))} | ||
</TableRow> | ||
))} | ||
</TableBody> | ||
</Table> | ||
</TableContainer> | ||
</> | ||
)} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ActiveOrdersSelectionPreview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.