Skip to content

Commit

Permalink
Add embargo date to cohort samples table (#122)
Browse files Browse the repository at this point in the history
Signed-off-by: Angelica Ochoa <15623749+ao508@users.noreply.github.com>
  • Loading branch information
ao508 authored May 2, 2024
1 parent dd60268 commit 6e6978b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 28 deletions.
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"mobx": "^6.6.1",
"mobx-react": "^7.5.2",
"mobx-react-lite": "^3.4.0",
"moment": "^2.30.1",
"neo4j-graphql-cli": "^0.0.11",
"pre-commit": "^1.2.2",
"prettier": "1.19.1",
Expand Down
10 changes: 10 additions & 0 deletions frontend/src/shared/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import CheckIcon from "@material-ui/icons/Check";
import { StatusTooltip } from "./components/StatusToolTip";
import { parseUserSearchVal } from "../utils/parseSearchQueries";
import { Dispatch, SetStateAction } from "react";
import moment from "moment";

export interface SampleMetadataExtended extends SampleMetadata {
revisable: boolean;
Expand Down Expand Up @@ -689,6 +690,11 @@ export const CohortSampleDetailsColumns: ColDef[] = [
field: "deliveryDate",
headerName: "Initial Pipeline Run Date",
},
{
field: "embargoDate",
headerName: "Embargo Date",
editable: false,
},
{
field: "billed",
headerName: "Billed",
Expand Down Expand Up @@ -990,6 +996,9 @@ export function prepareSampleCohortDataForAgGrid(samples: Sample[]) {
});
});
const deliveryDate = cohortDates?.sort()[0]; // earliest cohort date
var embargoDateAsDate = new Date(deliveryDate);
embargoDateAsDate.setMonth(embargoDateAsDate.getMonth() + 18); // embargo date is 18 months post earliest delivery date
const embargoDate = moment(embargoDateAsDate).format("YYYY-MM-DD");

const tempo = s.hasTempoTempos?.[0];
const { billed, billedBy, costCenter } = tempo ?? {};
Expand Down Expand Up @@ -1017,6 +1026,7 @@ export function prepareSampleCohortDataForAgGrid(samples: Sample[]) {
...s.hasMetadataSampleMetadata[0],
revisable: s.revisable,
deliveryDate: formatCohortRelatedDate(deliveryDate),
embargoDate,
billed,
billedBy,
costCenter,
Expand Down
47 changes: 19 additions & 28 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3535,10 +3535,10 @@
dependencies:
"@types/react" "*"

"@types/react-dom@^17.0.17":
version "17.0.18"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.18.tgz#8f7af38f5d9b42f79162eea7492e5a1caff70dc2"
integrity sha512-rLVtIfbwyur2iFKykP2w0pl/1unw26b5td16d5xMgp7/yjTHomkyxPYChFoCr/FtEX1lN9wY6lFj1qvKdS5kDw==
"@types/react-dom@^17.0.17", "@types/react-dom@^17.0.2":
version "17.0.25"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.25.tgz#e0e5b3571e1069625b3a3da2b279379aa33a0cb5"
integrity sha512-urx7A7UxkZQmThYA4So0NelOVjx3V4rNFVJwp0WZlbIK5eM4rNJDiN3R/E9ix0MBh6kAEojk/9YL+Te6D9zHNA==
dependencies:
"@types/react" "^17"

Expand Down Expand Up @@ -3571,22 +3571,13 @@
"@types/prop-types" "*"
"@types/react" "^17"

"@types/react@*", "@types/react@>=16.9.11", "@types/react@^17":
version "17.0.52"
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.52.tgz#10d8b907b5c563ac014a541f289ae8eaa9bf2e9b"
integrity sha512-vwk8QqVODi0VaZZpDXQCmEmiOuyjEFPY7Ttaw5vjM112LOq37yz1CDJGrRJwA1fYEq4Iitd5rnjd1yWAc/bT+A==
"@types/react@*", "@types/react@17.0.39", "@types/react@>=16.9.11", "@types/react@^17", "@types/react@^17.0.2":
version "17.0.80"
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.80.tgz#a5dfc351d6a41257eb592d73d3a85d3b7dbcbb41"
integrity sha512-LrgHIu2lEtIo8M7d1FcI3BdwXWoRQwMoXOZ7+dPTW0lYREjmlHl3P0U1VD0i/9tppOuv8/sam7sOjx34TxSFbA==
dependencies:
"@types/prop-types" "*"
"@types/scheduler" "*"
csstype "^3.0.2"

"@types/react@17.0.39":
version "17.0.39"
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.39.tgz#d0f4cde092502a6db00a1cded6e6bf2abb7633ce"
integrity sha512-UVavlfAxDd/AgAacMa60Azl7ygyQNRwC/DsHZmKgNvPmRR5p70AJ5Q9EAmL2NWOJmeV+vVUI4IAP7GZrN8h8Ug==
dependencies:
"@types/prop-types" "*"
"@types/scheduler" "*"
"@types/scheduler" "^0.16"
csstype "^3.0.2"

"@types/resolve@1.17.1":
Expand All @@ -3601,10 +3592,10 @@
resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.0.tgz#2b35eccfcee7d38cd72ad99232fbd58bffb3c84d"
integrity sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==

"@types/scheduler@*":
version "0.16.2"
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39"
integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==
"@types/scheduler@^0.16":
version "0.16.8"
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.8.tgz#ce5ace04cfeabe7ef87c0091e50752e36707deff"
integrity sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==

"@types/semver@^7.3.12":
version "7.3.13"
Expand Down Expand Up @@ -7730,12 +7721,7 @@ graphql-ws@^5.14.0:
resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.14.2.tgz#7db6f6138717a544d9480f0213f65f2841ed1c52"
integrity sha512-LycmCwhZ+Op2GlHz4BZDsUYHKRiiUz+3r9wbhBATMETNlORQJAaFlAgTFoeRh6xQoQegwYwIylVD1Qns9/DA3w==

"graphql@14.0.2 - 14.2.0 || ^14.3.1 || ^15.0.0":
version "15.8.0"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.8.0.tgz#33410e96b012fa3bdb1091cc99a94769db212b38"
integrity sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==

graphql@^16.5.0, graphql@^16.6.0:
"graphql@14.0.2 - 14.2.0 || ^14.3.1 || ^15.0.0", graphql@^16.5.0, graphql@^16.6.0:
version "16.6.0"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.6.0.tgz#c2dcffa4649db149f6282af726c8c83f1c7c5fdb"
integrity sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw==
Expand Down Expand Up @@ -9895,6 +9881,11 @@ moment@2.29.3:
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.3.tgz#edd47411c322413999f7a5940d526de183c031f3"
integrity sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw==

moment@^2.30.1:
version "2.30.1"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae"
integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==

morgan@^1.10.0:
version "1.10.0"
resolved "https://registry.yarnpkg.com/morgan/-/morgan-1.10.0.tgz#091778abc1fc47cd3509824653dae1faab6b17d7"
Expand Down

0 comments on commit 6e6978b

Please sign in to comment.