Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scxa-cell-type-wheel-experiment-heatmap/bugfix/encode-slash-for-cell-type #175

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import speciesResponse from '../fixtures/speciesResponse.json'
import cellTypeWheelData from '../fixtures/CellTypeDataForWheelResponse.json'
import heatMapTCellResponse from '../fixtures/heatMapRegulatoryTCellResponse.json'
import URI from 'urijs'
import { encode as base64Encode } from 'base-64';

function firstWordMatcherOf(str) {
return new RegExp(`.${str.split(` `)[0]}*`)
Expand Down Expand Up @@ -47,7 +48,7 @@ describe(`CellTypeWheelExperimentHeatmap`, () => {
const cellType = `regulatory T cell`
cy.intercept(`GET`, `/gxa/sc/json/suggestions/species`,
speciesResponse)
cy.intercept(`GET`, `/gxa/sc/json/cell-type-marker-genes/${URI(encodeURIComponent(cellType))}?experiment-accessions=E-ENAD-15`,
cy.intercept(`GET`, `/gxa/sc/json/cell-type-marker-genes/${URI(base64Encode(cellType))}?experiment-accessions=E-ENAD-15`,
heatMapTCellResponse)
cy.viewport(800, 1000)
cy.mount(<CellTypeWheelExperimentHeatmap
Expand All @@ -62,7 +63,7 @@ describe(`CellTypeWheelExperimentHeatmap`, () => {
const cellType = `regulatory T cell`
cy.intercept(`GET`, `/gxa/sc/json/suggestions/species`,
speciesResponse)
cy.intercept(`GET`, `/gxa/sc/json/cell-type-marker-genes/${URI(encodeURIComponent(cellType))}?experiment-accessions=E-ENAD-15`,
cy.intercept(`GET`, `/gxa/sc/json/cell-type-marker-genes/${URI(base64Encode(cellType))}?experiment-accessions=E-ENAD-15`,
heatMapTCellResponse)
cy.viewport(800, 1000)
cy.mount(<CellTypeWheelExperimentHeatmap
Expand All @@ -79,7 +80,7 @@ describe(`CellTypeWheelExperimentHeatmap`, () => {
const cellTypeWithSlash = `mucosal invariant / T cell`
cy.intercept(`GET`, `/gxa/sc/json/suggestions/species`,
speciesResponse)
cy.intercept(`GET`, `/gxa/sc/json/cell-type-marker-genes/${URI(encodeURIComponent(cellTypeWithSlash))}?experiment-accessions=E-MTAB-7704`,
cy.intercept(`GET`, `/gxa/sc/json/cell-type-marker-genes/${URI(base64Encode(cellTypeWithSlash))}?experiment-accessions=E-MTAB-7704`,
heatMapTCellResponse)
cy.viewport(800, 1000)
cy.mount(<CellTypeWheelExperimentHeatmap
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ebi-gene-expression-group/scxa-cell-type-wheel-heatmap",
"version": "1.4.12",
"version": "1.4.14",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -29,6 +29,7 @@
"@ebi-gene-expression-group/scxa-cell-type-wheel": "^1.1.10",
"@ebi-gene-expression-group/scxa-gene-search-form": "^2.1.0",
"@ebi-gene-expression-group/scxa-marker-gene-heatmap": "^2.6.0",
"base-64": "^1.0.0",
"highcharts": "^11.4.6",
"highcharts-react-official": "^3.2.1",
"lodash": "^4.17.21",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { withFetchLoader } from '@ebi-gene-expression-group/atlas-react-fetch-lo
import CellTypeWheel from '@ebi-gene-expression-group/scxa-cell-type-wheel'
import MarkerGeneHeatmap from '@ebi-gene-expression-group/scxa-marker-gene-heatmap/lib/MarkerGeneHeatmap'
import GeneSearchForm from '@ebi-gene-expression-group/scxa-gene-search-form'
import { encode as base64Encode } from 'base-64'

const CellTypeWheelFetchLoader = withFetchLoader(CellTypeWheel)
const MarkerGeneHeatmapFetchLoader = withFetchLoader(MarkerGeneHeatmap)
Expand Down Expand Up @@ -103,7 +104,8 @@ function CellTypeWheelExperimentHeatmap(props) {
{heatmapSelection.cellType ?
<MarkerGeneHeatmapFetchLoader
host={props.host}
resource={URI(encodeURIComponent(heatmapSelection.cellType), props.heatmapResource).toString()}
resource={URI(props.heatmapResource)
.segmentCoded(base64Encode(heatmapSelection.cellType)).toString()}
fulfilledPayloadProvider={heatmapFulfilledPayloadProvider}
query={{ [`experiment-accessions`]: heatmapSelection.experimentAccessions }}
cellType={heatmapSelection.cellType}
Expand Down