diff --git a/src/app/(post-login)/submission/program/[shortName]/clinical-data/ClinicalEntityDataTable.tsx b/src/app/(post-login)/submission/program/[shortName]/clinical-data/ClinicalEntityDataTable.tsx
index 8acb0227..b5521a27 100644
--- a/src/app/(post-login)/submission/program/[shortName]/clinical-data/ClinicalEntityDataTable.tsx
+++ b/src/app/(post-login)/submission/program/[shortName]/clinical-data/ClinicalEntityDataTable.tsx
@@ -475,10 +475,12 @@ const ClinicalEntityDataTable = ({
.sort(sortEntityData);
}
+ const styleThickBorderString = `3px solid ${theme.colors.grey}`;
const getHeaderBorder = (key) =>
(showCompletionStats && key === completionColumnHeaders.followUps) ||
- (!showCompletionStats && key === 'donor_id')
- ? `3px solid ${theme.colors.grey}`
+ (!showCompletionStats && key === 'donor_id') ||
+ key === 'FO'
+ ? styleThickBorderString
: '';
const [stickyDonorIDColumnsWidth, setStickyDonorIDColumnsWidth] = useState(74);
@@ -636,51 +638,112 @@ const ClinicalEntityDataTable = ({
borderBottom: `1px solid ${theme.colors.grey_2}`,
};
+ const headerStyle = css`
+ background-color: ${theme.colors.grey_4};
+ border-bottom: 1px solid ${theme.colors.grey_2};
+ border-right: 1px solid ${theme.colors.grey_2};
+ font-size: 13px;
+ padding: 5px;
+ text-align: left;
+ `;
+
+ const stickyCSS = css`
+ background-color: white;
+ left: 0;
+ position: sticky !important;
+ top: 0;
+ z-index: 1;
+ `;
+
columns = [
{
id: 'clinical_core_completion_header',
- header: (
-
- CLINICAL CORE COMPLETION
-
- For clinical completeness, each donor requires:
- DO: at least one Donor record
- PD: at least one Primary Diagnosis record
- NS: all the registered Normal DNA Specimen record
- TS: all the registered Tumour DNA Specimen record
- TR: at least one Treatment record
- FO: at least one Follow Up record
-
- }
+ meta: { customHeader: true },
+ sortingFn: sortEntityData,
+ header: (props) => {
+ return (
+
-
-
-
- ),
+
+ CLINICAL CORE COMPLETION
+
+ For clinical completeness, each donor requires:
+ DO: at least one Donor record
+ PD: at least one Primary Diagnosis record
+ NS: all the registered Normal DNA Specimen record
+ TS: all the registered Tumour DNA Specimen record
+ TR: at least one Treatment record
+ FO: at least one Follow Up record
+
+ }
+ >
+
+
+
+ |
+ );
+ },
headerStyle: completionHeaderStyle,
- columns: columns.slice(0, 7).map((column) => ({
+ columns: columns.slice(0, 7).map((column, index) => ({
...column,
+ sortingFn: sortEntityData,
+ header: (props) => {
+ const value = props.header.id;
+ const coreCompletionColumnsCount = 7;
+ const isLastElement = index === coreCompletionColumnsCount - 1;
+ const isSticky = value === 'donor_id';
+ const isSorted = props.sorted;
+
+ return (
+
+ {value}
+ |
+ );
+ },
maxWidth: noTableData ? 50 : 250,
style: noTableData ? noDataCellStyle : {},
+ meta: { customCell: true, customHeader: true },
cell: (context) => {
const value = context.getValue();
+ const isSticky = context.column.id === 'donor_id';
- const { isCompletionCell, errorState } = getCellStyles(
+ const { isCompletionCell, errorState, style } = getCellStyles(
undefined,
context.row,
context.column,
@@ -688,19 +751,47 @@ const ClinicalEntityDataTable = ({
const showSuccessSvg = isCompletionCell && !errorState;
- return showSuccessSvg ? (
+ const content = showSuccessSvg ? (
) : (
value
);
+
+ return (
+
+
+ {content}
+
+ |
+ );
},
})),
},
{
id: 'submitted_donor_data_header',
- header: SUBMITTED DONOR DATA
,
+ meta: { customHeader: true },
+ header: (props) => (
+
+ SUBMITTED DONOR DATA
+ |
+ ),
headerStyle: dataHeaderStyle,
- columns: columns.slice(7).map((column, i) => column),
+ columns: columns.slice(7),
},
];
}
@@ -757,6 +848,7 @@ const ClinicalEntityDataTable = ({
/>
)}
+
);
diff --git a/src/app/(post-login)/submission/program/[shortName]/clinical-data/page.tsx b/src/app/(post-login)/submission/program/[shortName]/clinical-data/page.tsx
index 92620b4c..bdba3b87 100644
--- a/src/app/(post-login)/submission/program/[shortName]/clinical-data/page.tsx
+++ b/src/app/(post-login)/submission/program/[shortName]/clinical-data/page.tsx
@@ -28,8 +28,7 @@ import useUrlParamState from '@/app/hooks/useUrlParamState';
import { notNull } from '@/global/utils';
import { css } from '@/lib/emotion';
import { useQuery } from '@apollo/client';
-import { useTheme } from '@emotion/react';
-import { Loader, Typography, VerticalTabs } from '@icgc-argo/uikit';
+import { Loader, Typography, VerticalTabs, useTheme } from '@icgc-argo/uikit';
import { useState } from 'react';
import { setConfiguration } from 'react-grid-system';
import ClinicalEntityDataTable from './ClinicalEntityDataTable';