Skip to content

Commit

Permalink
Show billing-related fields on the Cohort and Cohort Sample views (#117)
Browse files Browse the repository at this point in the history
* Add billing field placeholders and correct typo in cohort sample coldef name

* Rename Delivery Date for clarity and hide Complete Date field

* Remove hour and minute marks from cohort-related dates

* Regenerate GraphQl types for billing fields and display samples billing data

* Make cohort samples' Billed field an editable dropdown

* Set cohorts' Billed field to display value dynamically

* Make cohort sample fields editable and all sample fields read-only by default

* Add a status field to the Cohort Sample popup view

* Rename cohort delivery date field to Initial Cohort Delivery Date

* Support searching for select cohort sample billing fields

* Remove the Status field from the Cohort Samples view
  • Loading branch information
qu8n authored Apr 4, 2024
1 parent ba77d40 commit 749416e
Show file tree
Hide file tree
Showing 11 changed files with 34,033 additions and 27,432 deletions.
7 changes: 2 additions & 5 deletions frontend/src/components/RecordsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { ColDef, IServerSideGetRowsParams } from "ag-grid-community";
import { DataName, useHookLazyGeneric } from "../shared/types";
import SamplesList from "./SamplesList";
import { Sample, SampleWhere } from "../generated/graphql";
import { defaultReadOnlyColDef } from "../shared/helpers";
import { defaultColDef } from "../shared/helpers";
import { PatientIdsTriplet } from "../pages/patients/PatientsPage";
import { ErrorMessage, LoadingSpinner, Toolbar } from "../shared/tableElements";

Expand All @@ -36,7 +36,6 @@ interface IRecordsListProps {
setShowDownloadModal: Dispatch<SetStateAction<boolean>>;
handleDownload: () => void;
samplesQueryParam: string | undefined;
samplesDefaultColDef: ColDef;
getSamplesRowData: (samples: Sample[]) => any[];
samplesColDefs: ColDef[];
samplesParentWhereVariables: SampleWhere;
Expand All @@ -63,7 +62,6 @@ export default function RecordsList({
setShowDownloadModal,
handleDownload,
samplesQueryParam,
samplesDefaultColDef,
getSamplesRowData,
samplesColDefs,
samplesParentWhereVariables,
Expand Down Expand Up @@ -214,7 +212,6 @@ export default function RecordsList({
<div className={styles.popupHeight}>
<SamplesList
columnDefs={samplesColDefs}
defaultColDef={samplesDefaultColDef}
getRowData={getSamplesRowData}
parentWhereVariables={samplesParentWhereVariables}
refetchWhereVariables={samplesRefetchWhereVariables}
Expand Down Expand Up @@ -260,7 +257,7 @@ export default function RecordsList({
context={{
navigateFunction: navigate,
}}
defaultColDef={defaultReadOnlyColDef}
defaultColDef={defaultColDef}
onGridReady={(params) => {
params.api.sizeColumnsToFit();
}}
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/components/SamplesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { CSVFormulate } from "../utils/CSVExport";
import {
SampleChange,
SampleMetadataExtended,
defaultColDef,
handleSearch,
} from "../shared/helpers";
import { AgGridReact } from "ag-grid-react";
Expand All @@ -30,7 +31,6 @@ const max_rows = 500;

interface ISampleListProps {
columnDefs: ColDef[];
defaultColDef: ColDef;
getRowData: (samples: Sample[]) => any[];
setUnsavedChanges?: (unsavedChanges: boolean) => void;
parentWhereVariables?: SampleWhere;
Expand All @@ -40,7 +40,6 @@ interface ISampleListProps {

export default function SamplesList({
columnDefs,
defaultColDef,
getRowData,
parentWhereVariables,
refetchWhereVariables,
Expand Down
490 changes: 490 additions & 0 deletions frontend/src/generated/graphql.ts

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions frontend/src/pages/cohorts/CohortsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import {
} from "../../generated/graphql";
import { useState } from "react";
import {
CohortSamplesDetailsColumns,
CohortSampleDetailsColumns,
CohortsListColumns,
cohortSampleFilterWhereVariables,
defaultReadOnlyColDef,
getSampleCohortDataFromSamplesQuery,
handleSearch,
} from "../../shared/helpers";
Expand Down Expand Up @@ -135,8 +134,7 @@ export default function CohortsPage() {
showDownloadModal={showDownloadModal}
setShowDownloadModal={setShowDownloadModal}
handleDownload={() => setShowDownloadModal(true)}
samplesColDefs={CohortSamplesDetailsColumns}
samplesDefaultColDef={defaultReadOnlyColDef}
samplesColDefs={CohortSampleDetailsColumns}
samplesQueryParam={
sampleQueryParamValue &&
`${sampleQueryParamHeaderName} "${sampleQueryParamValue}"`
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/pages/patients/PatientsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { REACT_APP_EXPRESS_SERVER_ORIGIN } from "../../shared/constants";
import {
PatientsListColumns,
SampleDetailsColumns,
defaultEditableColDef,
getSampleMetadataFromSamplesQuery,
sampleFilterWhereVariables,
} from "../../shared/helpers";
Expand Down Expand Up @@ -287,7 +286,6 @@ export default function PatientsPage({
setShowDownloadModal(true);
}}
samplesColDefs={SampleDetailsColumns}
samplesDefaultColDef={defaultEditableColDef}
samplesQueryParam={
sampleQueryParamValue &&
`${sampleQueryParamHeaderName} ${sampleQueryParamValue}`
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/pages/requests/RequestsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { useState } from "react";
import {
RequestsListColumns,
SampleDetailsColumns,
defaultEditableColDef,
getSampleMetadataFromSamplesQuery,
handleSearch,
sampleFilterWhereVariables,
Expand Down Expand Up @@ -85,7 +84,6 @@ export default function RequestsPage() {
setShowDownloadModal={setShowDownloadModal}
handleDownload={() => setShowDownloadModal(true)}
samplesColDefs={SampleDetailsColumns}
samplesDefaultColDef={defaultEditableColDef}
samplesQueryParam={
sampleQueryParamValue &&
`${sampleQueryParamHeaderName} ${sampleQueryParamValue}`
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/pages/samples/SamplesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { PageHeader } from "../../shared/components/PageHeader";
import SamplesList from "../../components/SamplesList";
import {
SampleDetailsColumns,
defaultEditableColDef,
getSampleMetadataFromSamplesQuery,
sampleFilterWhereVariables,
} from "../../shared/helpers";
Expand All @@ -15,7 +14,6 @@ export default function SamplesPage() {

<SamplesList
columnDefs={SampleDetailsColumns}
defaultColDef={defaultEditableColDef}
getRowData={getSampleMetadataFromSamplesQuery}
refetchWhereVariables={(parsedSearchVals) => {
return {
Expand Down
Loading

0 comments on commit 749416e

Please sign in to comment.