Skip to content

Commit

Permalink
May 2024 update to production (#398)
Browse files Browse the repository at this point in the history
* Documentation: Add documentation for the staging and production instance (#317)

* Add documentation for staging and prod

* Modify README.md

* code formatting

* Grammatical fixes

* Add Keycloak related info

* Merge outstanding dependency updates (#331)

* Bump mongoose from 6.2.11 to 6.4.6 in /server

Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.2.11 to 6.4.6.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](Automattic/mongoose@6.2.11...6.4.6)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump jose from 2.0.5 to 2.0.6 in /test-node

Bumps [jose](https://github.com/panva/jose) from 2.0.5 to 2.0.6.
- [Release notes](https://github.com/panva/jose/releases)
- [Changelog](https://github.com/panva/jose/blob/v2.0.6/CHANGELOG.md)
- [Commits](panva/jose@v2.0.5...v2.0.6)

---
updated-dependencies:
- dependency-name: jose
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump loader-utils from 1.4.0 to 1.4.2 in /react

Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.0 to 1.4.2.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md)
- [Commits](webpack/loader-utils@v1.4.0...v1.4.2)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump deep-object-diff from 1.1.7 to 1.1.9 in /react

Bumps [deep-object-diff](https://github.com/mattphillips/deep-object-diff) from 1.1.7 to 1.1.9.
- [Release notes](https://github.com/mattphillips/deep-object-diff/releases)
- [Commits](https://github.com/mattphillips/deep-object-diff/commits)

---
updated-dependencies:
- dependency-name: deep-object-diff
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump decode-uri-component from 0.2.0 to 0.2.2 in /react

Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](SamVerschueren/decode-uri-component@v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump json5 from 1.0.1 to 1.0.2 in /server

Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](json5/json5@v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump json5 from 1.0.1 to 1.0.2 in /test-node

Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](json5/json5@v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump json5 from 1.0.1 to 1.0.2 in /react

Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](json5/json5@v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add gnomadHet column w/ number of heterozygotes (#334)

* Add gnomadHet calculation
- Add comments

* Change gnomadHet to use PrimaryAF
- Kept AF displayed as max between primary and secondary AF

* Update tests

* Add maleCount field to table rows (#335)

* Fix male count (#337)

* Add allele count column, remove gnomadHet and male count (#338)

* Replace gnomadHet with AC count

* Add AC column to frontend
- update tests

* Update typedefs

* Fix graphQL query, frontend query preparing

* Hide male count by default

* Comment out male count; redundant info

* React: Bump timeout from 90 sec to 900 sec (#339)

* Bump timeout from 90 sec to 900 sec
- Suggested by Matt, Magda (2023-03-13)

* Reduce to 5 minutes

* Revert "Reduce to 5 minutes"

This reverts commit 758f9b9.

* Fix comment

* CMH Integration  (#341)

* Fix typo in g4rdAdapter

* Add CMH adapter

* Add source prefixes; fix error messages

* Update docs

* Update staging server deploy with CMH vars

* Remove cmh env vars from docker prod (for now)

* Bump keycloak-connect from 17.0.0 to 21.0.1 in /server (#336)

Bumps [keycloak-connect](https://github.com/keycloak/keycloak-nodejs-connect) from 17.0.0 to 21.0.1.
- [Release notes](https://github.com/keycloak/keycloak-nodejs-connect/releases)
- [Commits](keycloak/keycloak-nodejs-connect@17.0.0...21.0.1)

---
updated-dependencies:
- dependency-name: keycloak-connect
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump undici from 5.9.1 to 5.19.1 in /server (#333)

Bumps [undici](https://github.com/nodejs/undici) from 5.9.1 to 5.19.1.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v5.9.1...v5.19.1)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Rearrange columns, add tooltips  (#342)

* Add source to duplicate variant check

* Move some columns to Case Details

* Add tooltips for all the columns

* Fix CMH assembly (#343)

* Change CMH adapter to GRCh38

* Fix liftOver if no dataForAnnotation

* Perform LiftOver for CMH query results (GRCh38 -> h37) (#353)

* Add CMHVariantIndelCoordinate type

* More comments

* Update mongo query to accomodate CMH format

* Fix "chrchr" mapping in liftOver

* Remove logger debugs

* Fix gnomad query to exclude CMH if none found
- Fix getCoordinates to not do "chrchr"

* Remove ref[0] == alt[0] query check

* Bump word-wrap from 1.2.3 to 1.2.4 in /server (#350)

Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](jonschlinkert/word-wrap@1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump word-wrap from 1.2.3 to 1.2.4 in /test-node (#351)

Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](jonschlinkert/word-wrap@1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump word-wrap from 1.2.3 to 1.2.4 in /react (#352)

Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](jonschlinkert/word-wrap@1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump semver from 5.7.1 to 5.7.2 in /test-node (#348)

Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](npm/node-semver@v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump semver from 6.3.0 to 6.3.1 in /server (#347)

Bumps [semver](https://github.com/npm/node-semver) from 6.3.0 to 6.3.1.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v6.3.1/CHANGELOG.md)
- [Commits](npm/node-semver@v6.3.0...v6.3.1)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump semver from 5.7.1 to 5.7.2 in /react (#346)

Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](npm/node-semver@v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump tough-cookie from 4.0.0 to 4.1.3 in /react (#345)

Bumps [tough-cookie](https://github.com/salesforce/tough-cookie) from 4.0.0 to 4.1.3.
- [Release notes](https://github.com/salesforce/tough-cookie/releases)
- [Changelog](https://github.com/salesforce/tough-cookie/blob/master/CHANGELOG.md)
- [Commits](salesforce/tough-cookie@v4.0.0...v4.1.3)

---
updated-dependencies:
- dependency-name: tough-cookie
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump tough-cookie from 4.0.0 to 4.1.3 in /server (#344)

Bumps [tough-cookie](https://github.com/salesforce/tough-cookie) from 4.0.0 to 4.1.3.
- [Release notes](https://github.com/salesforce/tough-cookie/releases)
- [Changelog](https://github.com/salesforce/tough-cookie/blob/master/CHANGELOG.md)
- [Commits](salesforce/tough-cookie@v4.0.0...v4.1.3)

---
updated-dependencies:
- dependency-name: tough-cookie
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump mongoose from 6.4.6 to 6.11.3 in /server (#349)

* Bump mongoose from 6.4.6 to 6.11.3 in /server

Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.4.6 to 6.11.3.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](Automattic/mongoose@6.4.6...6.11.3)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix deprecation warning for strictQuery setting

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mackenzie Ian Frew <mackenzie.frew@sickkids.ca>

* Set ApolloServer cache to bounded (#354)

* Bump apollo-server-core from 3.10.1 to 3.12.1 in /server (#356)

Bumps [apollo-server-core](https://github.com/apollographql/apollo-server/tree/HEAD/packages/apollo-server-core) from 3.10.1 to 3.12.1.
- [Release notes](https://github.com/apollographql/apollo-server/releases)
- [Commits](https://github.com/apollographql/apollo-server/commits/apollo-server-core@3.12.1/packages/apollo-server-core)

---
updated-dependencies:
- dependency-name: apollo-server-core
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add check for hg38 before filtering gene hits (#357)

* Bump @babel/traverse from 7.17.3 to 7.23.2 in /react (#360)

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.3 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump graphql from 16.3.0 to 16.8.1 in /server (#358)

* Bump graphql from 16.3.0 to 16.8.1 in /server

Bumps [graphql](https://github.com/graphql/graphql-js) from 16.3.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v16.3.0...v16.8.1)

---
updated-dependencies:
- dependency-name: graphql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump @babel/traverse from 7.17.3 to 7.23.2 in /react (#360)

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.3 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump graphql from 16.3.0 to 16.8.1 in /server

Bumps [graphql](https://github.com/graphql/graphql-js) from 16.3.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v16.3.0...v16.8.1)

---
updated-dependencies:
- dependency-name: graphql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mackenzie Ian Frew <mackenzie.frew@sickkids.ca>

* Bump undici from 5.19.1 to 5.26.3 in /server (#359)

* Bump undici from 5.19.1 to 5.26.3 in /server

Bumps [undici](https://github.com/nodejs/undici) from 5.19.1 to 5.26.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v5.19.1...v5.26.3)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump @babel/traverse from 7.17.3 to 7.23.2 in /react (#360)

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.3 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump graphql from 16.3.0 to 16.8.1 in /server (#358)

* Bump graphql from 16.3.0 to 16.8.1 in /server

Bumps [graphql](https://github.com/graphql/graphql-js) from 16.3.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v16.3.0...v16.8.1)

---
updated-dependencies:
- dependency-name: graphql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump @babel/traverse from 7.17.3 to 7.23.2 in /react (#360)

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.3 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump graphql from 16.3.0 to 16.8.1 in /server

Bumps [graphql](https://github.com/graphql/graphql-js) from 16.3.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v16.3.0...v16.8.1)

---
updated-dependencies:
- dependency-name: graphql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mackenzie Ian Frew <mackenzie.frew@sickkids.ca>

* Bump undici from 5.19.1 to 5.26.3 in /server

Bumps [undici](https://github.com/nodejs/undici) from 5.19.1 to 5.26.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v5.19.1...v5.26.3)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mackenzie Ian Frew <mackenzie.frew@sickkids.ca>

* Bump @babel/traverse from 7.17.9 to 7.23.2 in /server (#361)

* Bump @babel/traverse from 7.17.9 to 7.23.2 in /server

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.9 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump graphql from 16.3.0 to 16.8.1 in /server (#358)

* Bump graphql from 16.3.0 to 16.8.1 in /server

Bumps [graphql](https://github.com/graphql/graphql-js) from 16.3.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v16.3.0...v16.8.1)

---
updated-dependencies:
- dependency-name: graphql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump @babel/traverse from 7.17.3 to 7.23.2 in /react (#360)

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.3 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump graphql from 16.3.0 to 16.8.1 in /server

Bumps [graphql](https://github.com/graphql/graphql-js) from 16.3.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v16.3.0...v16.8.1)

---
updated-dependencies:
- dependency-name: graphql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mackenzie Ian Frew <mackenzie.frew@sickkids.ca>

* Bump undici from 5.19.1 to 5.26.3 in /server (#359)

* Bump undici from 5.19.1 to 5.26.3 in /server

Bumps [undici](https://github.com/nodejs/undici) from 5.19.1 to 5.26.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v5.19.1...v5.26.3)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump @babel/traverse from 7.17.3 to 7.23.2 in /react (#360)

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.3 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump graphql from 16.3.0 to 16.8.1 in /server (#358)

* Bump graphql from 16.3.0 to 16.8.1 in /server

Bumps [graphql](https://github.com/graphql/graphql-js) from 16.3.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v16.3.0...v16.8.1)

---
updated-dependencies:
- dependency-name: graphql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump @babel/traverse from 7.17.3 to 7.23.2 in /react (#360)

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.3 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump graphql from 16.3.0 to 16.8.1 in /server

Bumps [graphql](https://github.com/graphql/graphql-js) from 16.3.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v16.3.0...v16.8.1)

---
updated-dependencies:
- dependency-name: graphql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mackenzie Ian Frew <mackenzie.frew@sickkids.ca>

* Bump undici from 5.19.1 to 5.26.3 in /server

Bumps [undici](https://github.com/nodejs/undici) from 5.19.1 to 5.26.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v5.19.1...v5.26.3)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mackenzie Ian Frew <mackenzie.frew@sickkids.ca>

* Bump @babel/traverse from 7.17.9 to 7.23.2 in /server

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.9 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mackenzie Ian Frew <mackenzie.frew@sickkids.ca>

* Bump browserify-sign from 4.2.1 to 4.2.2 in /react (#363)

Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.2.1 to 4.2.2.
- [Changelog](https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md)
- [Commits](browserify/browserify-sign@v4.2.1...v4.2.2)

---
updated-dependencies:
- dependency-name: browserify-sign
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump chromedriver from 100.0.0 to 119.0.1 in /server (#364)

Bumps [chromedriver](https://github.com/giggio/node-chromedriver) from 100.0.0 to 119.0.1.
- [Commits](giggio/node-chromedriver@100.0.0...119.0.1)

---
updated-dependencies:
- dependency-name: chromedriver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump axios from 0.26.1 to 1.6.0 in /server (#365)

* Bump axios from 0.26.1 to 1.6.0 in /server

Bumps [axios](https://github.com/axios/axios) from 0.26.1 to 1.6.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v0.26.1...v1.6.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update jest config for new axios version

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mackenzie Ian Frew <mackenzie.frew@sickkids.ca>

* Add PT Pagination support for G4RD Staging (#366)

* Add fetchPhenotipsVariant for collecting paginated results

* Don't infinite loop

* Finish pagination support for G4RD

* Fix linting issues

* Formatting

* Fix test suite

* Server: fix pagination bugs with G4RD (#369)

* Fix searching for X, Y chromosomes by position

* Add "pagination" for patient queries

* Linting and formatting

* Use function to get auth token to prevent token expiry mid-query

* Better debug messages

* format

* Add retries to fetchPhenotipsVariants (#370)

- Add check for failed patient query to prevent uncaught exception

* Server: formatting

* Handle null params passed to transform func (#371)

* TEMPORARY: trace GC in staging/prod server (#372)

* TEMPORARY: Add heap profiler for staging/prod (#373)

* TEMPORARY: inspect-brk

* TEMPORARY: inspect-brk to localhost

* TEMPORARY: put inspect back to global

* TEMPORARY: revert to inspect, not inspect-brk

* TEMPORARY: make smaller heap to debug

* TEMPORARY: smaller heap limit

* Remove node debugging flags

* All: Merge outstanding dependency updates (#378)

* Bump follow-redirects from 1.14.9 to 1.15.4 in /react

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.9 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.14.9...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump follow-redirects from 1.15.3 to 1.15.4 in /server

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.3 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.3...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump undici from 5.26.3 to 5.28.3 in /server

Bumps [undici](https://github.com/nodejs/undici) from 5.26.3 to 5.28.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v5.26.3...v5.28.3)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump ip from 2.0.0 to 2.0.1 in /server

Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](indutny/node-ip@v2.0.0...v2.0.1)

---
updated-dependencies:
- dependency-name: ip
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump ip from 1.1.5 to 1.1.9 in /react

Bumps [ip](https://github.com/indutny/node-ip) from 1.1.5 to 1.1.9.
- [Commits](indutny/node-ip@v1.1.5...v1.1.9)

---
updated-dependencies:
- dependency-name: ip
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Frontend: Update search bar to allow search by position only (#382)

* Rename from GeneSearch to GeneNameSearch

* Move search component to separate folder

* Create GenePositionSearch component

* Update validator to fail on first rule break

* Create combined search bar

* Fix no variants found error

* Use combobox instead of select element

* WIP making new dropdown for search bar styling

* Fix styling

* Adjust spacing

* Formatting + linting

* Server formatting

* React: Remove errant console.log

* React/Server: Add Gene Name to results table (#383)

* Add Gene Name to results table

* Formatting

* Server: implement support for Pagination API on CMH (#390)

* Update /rest/variants/match request

* Do the pagination

* Update to support CMH

* Fix 2nd page fetch fail

* Add liftover for positions

* Fix requests

* CI/CD: Fix deprecated workflow commands in GitHub Actions workflows (#391)

* Replace deprecated set-output with GITHUB_OUTPUT env file append

* Update actions versions

* Undo SSH configure workflow change (#392)

* Server: Fix Gnomad annotation bug with GRCh38 + CMH (#395)

* Fix form to clear gene when switching assemblies

* Update Gnomad model handling to use factory functions

* format

* All: merge outstanding dependencies (#396)

* Bump jose from 2.0.6 to 2.0.7 in /test-node

Bumps [jose](https://github.com/panva/jose) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/panva/jose/releases)
- [Changelog](https://github.com/panva/jose/blob/v2.0.7/CHANGELOG.md)
- [Commits](panva/jose@v2.0.6...v2.0.7)

---
updated-dependencies:
- dependency-name: jose
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump follow-redirects from 1.15.4 to 1.15.6 in /server

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.4...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump follow-redirects from 1.15.4 to 1.15.6 in /react

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.4...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump express from 4.17.3 to 4.19.2 in /server

Bumps [express](https://github.com/expressjs/express) from 4.17.3 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](expressjs/express@4.17.3...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump express from 4.17.3 to 4.19.2 in /react

Bumps [express](https://github.com/expressjs/express) from 4.17.3 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](expressjs/express@4.17.3...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump express from 4.17.3 to 4.19.2 in /test-node

Bumps [express](https://github.com/expressjs/express) from 4.17.3 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](expressjs/express@4.17.3...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump undici from 5.28.3 to 5.28.4 in /server

Bumps [undici](https://github.com/nodejs/undici) from 5.28.3 to 5.28.4.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v5.28.3...v5.28.4)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump tar from 6.1.11 to 6.2.1 in /react

Bumps [tar](https://github.com/isaacs/node-tar) from 6.1.11 to 6.2.1.
- [Release notes](https://github.com/isaacs/node-tar/releases)
- [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md)
- [Commits](isaacs/node-tar@v6.1.11...v6.2.1)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump mysql2 from 2.3.3 to 3.9.7 in /test-node

Bumps [mysql2](https://github.com/sidorares/node-mysql2) from 2.3.3 to 3.9.7.
- [Release notes](https://github.com/sidorares/node-mysql2/releases)
- [Changelog](https://github.com/sidorares/node-mysql2/blob/master/Changelog.md)
- [Commits](sidorares/node-mysql2@v2.3.3...v3.9.7)

---
updated-dependencies:
- dependency-name: mysql2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump ejs from 3.1.7 to 3.1.10 in /react

Bumps [ejs](https://github.com/mde/ejs) from 3.1.7 to 3.1.10.
- [Release notes](https://github.com/mde/ejs/releases)
- [Commits](mde/ejs@v3.1.7...v3.1.10)

---
updated-dependencies:
- dependency-name: ejs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add CMH environment to node prod workflow (#397)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Jenny <ziyixu686@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed May 21, 2024
1 parent c0630ed commit e4c0ca2
Show file tree
Hide file tree
Showing 30 changed files with 963 additions and 608 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/node-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ jobs:
run:
working-directory: server
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v1
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
cache: yarn
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
environment: OSMP_PROD
concurrency: OSMP_PROD
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: docker/login-action@v1
with:
registry: ghcr.io
Expand Down Expand Up @@ -118,6 +118,14 @@ jobs:
G4RD_GRANT_TYPE: ${{ secrets.G4RD_GRANT_TYPE }}
G4RD_TOKEN_URL: ${{ secrets.G4RD_TOKEN_URL }}
G4RD_CLIENT_ID: ${{ secrets.G4RD_CLIENT_ID }}
CMH_AZURE_CLIENT_ID: ${{ secrets.CMH_AZURE_CLIENT_ID }}
CMH_AZURE_CLIENT_SECRET: ${{ secrets.CMH_AZURE_CLIENT_SECRET }}
CMH_TOKEN_URL: ${{ secrets.CMH_TOKEN_URL }}
CMH_RESOURCE: ${{ secrets.CMH_RESOURCE }}
CMH_SCOPE: ${{ secrets.CMH_SCOPE }}
CMH_GRANT_TYPE: ${{ secrets.CMH_GRANT_TYPE }}
CMH_GENE42_SECRET: ${{ secrets.CMH_GENE42_SECRET }}
CMH_URL: ${{ secrets.CMH_URL }}
KEYCLOAK_AUTH_URL: ${{ secrets.KEYCLOAK_AUTH_URL }}
KEYCLOAK_REALM: ${{ secrets.KEYCLOAK_REALM }}
KEYCLOAK_CLIENT_ID: ${{ secrets.KEYCLOAK_CLIENT_ID }}
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ jobs:
run:
working-directory: server
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v1
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
cache: yarn
Expand Down Expand Up @@ -77,17 +77,17 @@ jobs:
run:
working-directory: test-node
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v1
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
cache: yarn
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
environment: SSMP_SERVER_DEV
concurrency: SSMP_SERVER_DEV
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: docker/login-action@v1
with:
registry: ghcr.io
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/react-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ jobs:
shell: bash
working-directory: react
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
run: echo "dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand Down Expand Up @@ -69,14 +69,14 @@ jobs:
concurrency: OSMP_PROD
if: github.ref == 'refs/heads/production'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Get yarn cache path
id: yarn-cache-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
run: echo "dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v4
id: restore
with:
path: |
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:
shell: bash
working-directory: react
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
run: echo "dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand Down Expand Up @@ -58,14 +58,14 @@ jobs:
concurrency: SSMP_BUILD
if: github.ref == 'refs/heads/develop'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Get yarn cache path
id: yarn-cache-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
run: echo "dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v4
id: restore
with:
path: |
Expand Down
3 changes: 1 addition & 2 deletions react/src/components/ComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ interface ComboBoxProps<T> {
}

export const Wrapper = styled(Flex)`
position: relative
min-height: 38px;
flex-wrap: wrap;
flex-grow: 0;
Expand Down Expand Up @@ -128,7 +127,7 @@ export default function ComboBox<T extends {}>({
</>
)}
</Header>
<SelectableListWrapper fullWidth>
<SelectableListWrapper>
{open && (
<SelectableList
ref={ref}
Expand Down
19 changes: 19 additions & 0 deletions react/src/components/ErrorText.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';
import styled from 'styled-components/macro';
import Typography from './Typography';

const ErrorWrapper = styled.div`
margin: 0 0 ${props => props.theme.space[2]};
padding: ${props => props.theme.space[4]} 0.75rem 0;
`;

const ErrorText: React.FC<{ error?: string }> = ({ error }) =>
error ? (
<ErrorWrapper>
<Typography error variant="subtitle" bold condensed>
{error}
</Typography>
</ErrorWrapper>
) : null;

export default ErrorText;
145 changes: 145 additions & 0 deletions react/src/components/Search/GeneCombinedSearch.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
import React, { useState } from 'react';
import { FaCaretDown } from 'react-icons/fa';
import styled from 'styled-components/macro';
import { useClickAway } from '../../hooks';
import { AssemblyId } from '../../types';
import { Flex } from '../Layout';
import SelectableList, { SelectableListItem, SelectableListWrapper } from '../SelectableList';
import GeneNameSearch, { GeneSelectionValue } from './GeneNameSearch';
import GenePositionSearch from './GenePositionSearch';

const SearchWrapper = styled(Flex)`
position: relative
min-height: 40px;
flex-wrap: nowrap;
flex-grow: 1;
position: relative;
width: 100%;
`;

const DropdownWrapper = styled(Flex)`
position: relative;
min-height: 38px;
flex-grow: 0;
`;

const DropdownHeader = styled(Flex)`
background-color: ${props => props.theme.background.main};
border: ${props => props.theme.borders.thin};
border-color: ${props => props.theme.colors.muted};
border-radius: ${props => props.theme.radii.base};
box-shadow: ${props => props.theme.boxShadow};
color: ${props => props.theme.colors.muted};
padding: 0 ${props => props.theme.space[4]};
flex-wrap: nowrap;
text-wrap: nowrap;
overflow: hidden;
white-space: nowrap;
min-height: 40px;
align-items: center;
justify-content: space-between;
cursor: pointer;
`;

const DropdownHeaderText = styled.div`
color: ${props => props.theme.colors.text};
cursor: pointer;
font-size: 14px;
`;

interface DropdownProps {
options: SelectableListItem<string>[];
value: string;
onSelect: (option: string) => void;
}

/**
* Dropdown component for selecting search type.
*/
const Dropdown: React.FC<DropdownProps> = props => {
// ComboBox styling is too deep, so we need our own dropdown

const [open, setOpen] = useState<Boolean>(false);

const ignoreRef = React.useRef() as React.MutableRefObject<HTMLDivElement>;
const ref = React.useRef() as React.MutableRefObject<HTMLUListElement>;

useClickAway(ref, () => setOpen(false), ignoreRef);

return (
<DropdownWrapper ref={ignoreRef}>
<DropdownHeader tabIndex={0} role="button" onClick={() => setOpen(true)}>
<DropdownHeaderText>{props.value}</DropdownHeaderText>
<FaCaretDown
style={{
marginLeft: '8px',
}}
/>
</DropdownHeader>
<SelectableListWrapper>
{open && (
<SelectableList
ref={ref}
options={props.options}
onSelect={item => {
props.onSelect(item as string);
setOpen(false);
}}
/>
)}
</SelectableListWrapper>
</DropdownWrapper>
);
};

interface GeneCombinedSearchProps {
assembly: AssemblyId;
geneName: string;
onNameChange: (geneName: string) => void;
onNameSelect: (gene: GeneSelectionValue) => void;
genePosition: string;
onPositionChange: (genePosition: string) => void;
onError?: (errorText: string | undefined) => void;
}

const OPTIONS = ['Gene Name', 'Position'];

/**
* Combined search component for searching by gene name or by position.
* Contains a dropdown integrated into the search bar where the user can
* switch between search modes.
*/
const GeneCombinedSearch: React.FC<GeneCombinedSearchProps> = props => {
const [searchMode, setSearchMode] = useState<string>(OPTIONS[0]);

return (
<SearchWrapper>
<Dropdown
options={OPTIONS.map((a, id) => ({
id,
value: a,
label: a,
}))}
onSelect={option => setSearchMode(option)}
value={searchMode}
/>
{searchMode === 'Gene Name' && (
<GeneNameSearch
assembly={props.assembly}
geneName={props.geneName}
onChange={props.onNameChange}
onSelect={props.onNameSelect}
/>
)}
{searchMode === 'Position' && (
<GenePositionSearch
position={props.genePosition}
onChange={props.onPositionChange}
onError={props.onError}
/>
)}
</SearchWrapper>
);
};

export default GeneCombinedSearch;
Loading

0 comments on commit e4c0ca2

Please sign in to comment.