From 8ba0497fd7e3d006e1424e2e752b76674f22df94 Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Mon, 18 Sep 2023 09:47:10 -0400 Subject: [PATCH 01/17] KPMP-3583: Try to fix non-loading table --- src/components/Summary/CellTypeSummary.js | 2 +- src/components/Summary/GeneSummary.js | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/Summary/CellTypeSummary.js b/src/components/Summary/CellTypeSummary.js index f4c53a59..aeb75e53 100644 --- a/src/components/Summary/CellTypeSummary.js +++ b/src/components/Summary/CellTypeSummary.js @@ -20,7 +20,7 @@ class CellTypeSummary extends Component { }; }; - async componentDidMount() { + async componentDidMount() { await this.fetchClusterHierarchy(); } diff --git a/src/components/Summary/GeneSummary.js b/src/components/Summary/GeneSummary.js index b0c1caac..ed37734d 100644 --- a/src/components/Summary/GeneSummary.js +++ b/src/components/Summary/GeneSummary.js @@ -13,7 +13,6 @@ class GeneSummary extends Component { this.getColumns = this.getColumns.bind(this); this.state = { - columns: this.getColumns(), geneSummary: [], dataTypeOptions: [], isLoading: true, @@ -34,7 +33,7 @@ class GeneSummary extends Component { await this.fetchGeneDatasetSummary(this.props.gene.symbol); getDataTypeOptions(this.props.gene.symbol, "").then( (options) => { - this.setState({ dataTypeOptions: options }) + this.setState({ dataTypeOptions: options, isLoading: false }) }, (error) => { this.setState({ dataTypeOptions: [] }); @@ -209,12 +208,12 @@ class GeneSummary extends Component { {this.state.isLoading ?
- + Loading...
:
- + From d3db3a720295b7b9dcf5ef468f4d2ebdaea774aa Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Mon, 18 Sep 2023 09:56:50 -0400 Subject: [PATCH 02/17] KPMP-3583: What is going on? --- src/components/Summary/GeneSummary.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/Summary/GeneSummary.js b/src/components/Summary/GeneSummary.js index ed37734d..4020e2fb 100644 --- a/src/components/Summary/GeneSummary.js +++ b/src/components/Summary/GeneSummary.js @@ -29,9 +29,9 @@ class GeneSummary extends Component { } } - async fetchPageData() { + fetchPageData = async() => { await this.fetchGeneDatasetSummary(this.props.gene.symbol); - getDataTypeOptions(this.props.gene.symbol, "").then( + await getDataTypeOptions(this.props.gene.symbol, "").then( (options) => { this.setState({ dataTypeOptions: options, isLoading: false }) }, @@ -43,6 +43,7 @@ class GeneSummary extends Component { } formatGeneDataset(geneSummary) { + console.log(geneSummary) for (const [dataType] of geneSummary.entries()) { let dataTypeIsClickable = this.dataTypeIsClickable(geneSummary[dataType]["dataTypeShort"]) if (geneSummary[dataType]["hrtCount"] === '0' || !dataTypeIsClickable) { @@ -62,7 +63,6 @@ class GeneSummary extends Component { } fetchGeneDatasetSummary = async (geneSymbol) => { - this.setState({ isLoading: true }); await fetchGeneDatasetSummary(geneSymbol).then( (geneSummary) => { if (geneSummary) { @@ -207,9 +207,7 @@ class GeneSummary extends Component { {this.state.isLoading ? -
- Loading... -
+ :
From 65b8a11c625572369a7e6dd18a7d7090c2795e47 Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Mon, 18 Sep 2023 10:03:57 -0400 Subject: [PATCH 03/17] KPMP-3583: What is going on? --- src/components/Summary/GeneSummary.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Summary/GeneSummary.js b/src/components/Summary/GeneSummary.js index 4020e2fb..66d5205f 100644 --- a/src/components/Summary/GeneSummary.js +++ b/src/components/Summary/GeneSummary.js @@ -66,8 +66,9 @@ class GeneSummary extends Component { await fetchGeneDatasetSummary(geneSymbol).then( (geneSummary) => { if (geneSummary) { - geneSummary = this.formatGeneDataset(geneSummary) - this.setState({ geneSummary, isLoading: false }); + console.log(geneSummary) + formattedGeneSummary = this.formatGeneDataset(geneSummary) + this.setState({ geneSummary: formattedGeneSummary, isLoading: false }); } }, (error) => { From 88f26a087c51a136118f6582e94abb4c806fef2b Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Mon, 18 Sep 2023 10:05:55 -0400 Subject: [PATCH 04/17] KPMP-3583: What is going on? --- src/components/Summary/GeneSummary.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Summary/GeneSummary.js b/src/components/Summary/GeneSummary.js index 66d5205f..17d61ba8 100644 --- a/src/components/Summary/GeneSummary.js +++ b/src/components/Summary/GeneSummary.js @@ -67,7 +67,7 @@ class GeneSummary extends Component { (geneSummary) => { if (geneSummary) { console.log(geneSummary) - formattedGeneSummary = this.formatGeneDataset(geneSummary) + let formattedGeneSummary = this.formatGeneDataset(geneSummary) this.setState({ geneSummary: formattedGeneSummary, isLoading: false }); } }, From e28087b4c35b1ce17aeca6824cda65824bb315d4 Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Mon, 18 Sep 2023 10:18:31 -0400 Subject: [PATCH 05/17] KPMP-3583: What is going on? --- src/components/Summary/GeneSummary.js | 6 ++---- src/helpers/ApolloClient.js | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Summary/GeneSummary.js b/src/components/Summary/GeneSummary.js index 17d61ba8..865ddc95 100644 --- a/src/components/Summary/GeneSummary.js +++ b/src/components/Summary/GeneSummary.js @@ -30,7 +30,7 @@ class GeneSummary extends Component { } fetchPageData = async() => { - await this.fetchGeneDatasetSummary(this.props.gene.symbol); + await this.fetchGeneDatasetSummaryLocal(this.props.gene.symbol); await getDataTypeOptions(this.props.gene.symbol, "").then( (options) => { this.setState({ dataTypeOptions: options, isLoading: false }) @@ -43,7 +43,6 @@ class GeneSummary extends Component { } formatGeneDataset(geneSummary) { - console.log(geneSummary) for (const [dataType] of geneSummary.entries()) { let dataTypeIsClickable = this.dataTypeIsClickable(geneSummary[dataType]["dataTypeShort"]) if (geneSummary[dataType]["hrtCount"] === '0' || !dataTypeIsClickable) { @@ -62,11 +61,10 @@ class GeneSummary extends Component { return geneSummary } - fetchGeneDatasetSummary = async (geneSymbol) => { + fetchGeneDatasetSummaryLocal = async (geneSymbol) => { await fetchGeneDatasetSummary(geneSymbol).then( (geneSummary) => { if (geneSummary) { - console.log(geneSummary) let formattedGeneSummary = this.formatGeneDataset(geneSummary) this.setState({ geneSummary: formattedGeneSummary, isLoading: false }); } diff --git a/src/helpers/ApolloClient.js b/src/helpers/ApolloClient.js index 30efa447..50bd4b3c 100644 --- a/src/helpers/ApolloClient.js +++ b/src/helpers/ApolloClient.js @@ -155,6 +155,8 @@ export const fetchGeneDatasetSummary = async (geneSymbol, fetchPolicy = 'no-cach fetchPolicy: fetchPolicy }); if (response.data && response.data.getGeneDatasetInformation) { + console.log("getting dataset summary information") + console.log(response.data.getGeneDatasetInformation) return response.data.getGeneDatasetInformation; } else { console.log('response.error',response.error) From 05d175bde2a6b5f29ba77c0279539232a456e667 Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Mon, 18 Sep 2023 10:22:46 -0400 Subject: [PATCH 06/17] KPMP-3583: What is going on? --- src/helpers/ApolloClient.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/ApolloClient.js b/src/helpers/ApolloClient.js index 50bd4b3c..37d59555 100644 --- a/src/helpers/ApolloClient.js +++ b/src/helpers/ApolloClient.js @@ -156,7 +156,7 @@ export const fetchGeneDatasetSummary = async (geneSymbol, fetchPolicy = 'no-cach }); if (response.data && response.data.getGeneDatasetInformation) { console.log("getting dataset summary information") - console.log(response.data.getGeneDatasetInformation) + console.log(response.data) return response.data.getGeneDatasetInformation; } else { console.log('response.error',response.error) From 46003c53b01a20a1b5e6806656f8142d80368324 Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Mon, 18 Sep 2023 10:33:33 -0400 Subject: [PATCH 07/17] KPMP-3583: What is going on? --- src/helpers/ApolloClient.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/helpers/ApolloClient.js b/src/helpers/ApolloClient.js index 37d59555..2e8b5700 100644 --- a/src/helpers/ApolloClient.js +++ b/src/helpers/ApolloClient.js @@ -154,6 +154,7 @@ export const fetchGeneDatasetSummary = async (geneSymbol, fetchPolicy = 'no-cach }`, fetchPolicy: fetchPolicy }); + console.log(response) if (response.data && response.data.getGeneDatasetInformation) { console.log("getting dataset summary information") console.log(response.data) From 4a3a1ed5441e60ab7993e55539c070f896aacb42 Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Mon, 18 Sep 2023 10:57:16 -0400 Subject: [PATCH 08/17] KPMP-3583: What is going on? --- src/components/Summary/GeneSummary.js | 8 ++++---- src/helpers/ApolloClient.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Summary/GeneSummary.js b/src/components/Summary/GeneSummary.js index 865ddc95..2ec4af15 100644 --- a/src/components/Summary/GeneSummary.js +++ b/src/components/Summary/GeneSummary.js @@ -46,16 +46,16 @@ class GeneSummary extends Component { for (const [dataType] of geneSummary.entries()) { let dataTypeIsClickable = this.dataTypeIsClickable(geneSummary[dataType]["dataTypeShort"]) if (geneSummary[dataType]["hrtCount"] === '0' || !dataTypeIsClickable) { - geneSummary[dataType]["hrtCount"] = '-'; + geneSummary[dataType]["hrtCount"] = 'X'; } if (geneSummary[dataType]["akiCount"] === '0' || !dataTypeIsClickable) { - geneSummary[dataType]["akiCount"] = '-'; + geneSummary[dataType]["akiCount"] = 'X'; } if (geneSummary[dataType]["ckdCount"] === '0' || !dataTypeIsClickable) { - geneSummary[dataType]["ckdCount"] = '-'; + geneSummary[dataType]["ckdCount"] = 'X'; } if (geneSummary[dataType]["dmrCount"] === '0' || !dataTypeIsClickable) { - geneSummary[dataType]["dmrCount"] = '-'; + geneSummary[dataType]["dmrCount"] = 'X'; } } return geneSummary diff --git a/src/helpers/ApolloClient.js b/src/helpers/ApolloClient.js index 2e8b5700..250ff06e 100644 --- a/src/helpers/ApolloClient.js +++ b/src/helpers/ApolloClient.js @@ -136,7 +136,7 @@ export const fetchClusterHierarchy = async (cellType) => { } } -export const fetchGeneDatasetSummary = async (geneSymbol, fetchPolicy = 'no-cache') => { +export const fetchGeneDatasetSummary = async (geneSymbol) => { const response = await apolloClient.query({ query: gql` query { @@ -152,7 +152,7 @@ export const fetchGeneDatasetSummary = async (geneSymbol, fetchPolicy = 'no-cach participantCount } }`, - fetchPolicy: fetchPolicy + fetchPolicy: 'no-cache' }); console.log(response) if (response.data && response.data.getGeneDatasetInformation) { From d06d3fee2b050c6063609ab5f6915aa9e5274abb Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Mon, 18 Sep 2023 11:02:30 -0400 Subject: [PATCH 09/17] KPMP-3583: What is going on? --- src/helpers/ApolloClient.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/helpers/ApolloClient.js b/src/helpers/ApolloClient.js index 250ff06e..7b1efe2d 100644 --- a/src/helpers/ApolloClient.js +++ b/src/helpers/ApolloClient.js @@ -151,8 +151,7 @@ export const fetchGeneDatasetSummary = async (geneSymbol) => { dmrCount participantCount } - }`, - fetchPolicy: 'no-cache' + }` }); console.log(response) if (response.data && response.data.getGeneDatasetInformation) { From 164686bf628bd731af9a15bfd0c97d35757315d2 Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Mon, 18 Sep 2023 11:04:35 -0400 Subject: [PATCH 10/17] KPMP-3583: What is going on? --- src/components/Summary/GeneSummary.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Summary/GeneSummary.js b/src/components/Summary/GeneSummary.js index 2ec4af15..d696a995 100644 --- a/src/components/Summary/GeneSummary.js +++ b/src/components/Summary/GeneSummary.js @@ -65,7 +65,7 @@ class GeneSummary extends Component { await fetchGeneDatasetSummary(geneSymbol).then( (geneSummary) => { if (geneSummary) { - let formattedGeneSummary = this.formatGeneDataset(geneSummary) + // let formattedGeneSummary = this.formatGeneDataset(geneSummary) this.setState({ geneSummary: formattedGeneSummary, isLoading: false }); } }, From 2cc69f7f59c05d64deda2ec67384b22d4dc62160 Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Mon, 18 Sep 2023 11:06:27 -0400 Subject: [PATCH 11/17] KPMP-3583: What is going on? --- src/components/Summary/GeneSummary.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Summary/GeneSummary.js b/src/components/Summary/GeneSummary.js index d696a995..a1d2b981 100644 --- a/src/components/Summary/GeneSummary.js +++ b/src/components/Summary/GeneSummary.js @@ -66,7 +66,7 @@ class GeneSummary extends Component { (geneSummary) => { if (geneSummary) { // let formattedGeneSummary = this.formatGeneDataset(geneSummary) - this.setState({ geneSummary: formattedGeneSummary, isLoading: false }); + this.setState({ geneSummary: geneSummary, isLoading: false }); } }, (error) => { From 4f69383745eaf409bbc1d4da5df403dc9360205a Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Mon, 18 Sep 2023 11:17:33 -0400 Subject: [PATCH 12/17] KPMP-3583: What is going on? --- src/components/Summary/GeneSummary.js | 19 ++++++++++++++----- src/helpers/ApolloClient.js | 8 +++----- src/helpers/Utils.js | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/components/Summary/GeneSummary.js b/src/components/Summary/GeneSummary.js index a1d2b981..98332b1e 100644 --- a/src/components/Summary/GeneSummary.js +++ b/src/components/Summary/GeneSummary.js @@ -46,21 +46,29 @@ class GeneSummary extends Component { for (const [dataType] of geneSummary.entries()) { let dataTypeIsClickable = this.dataTypeIsClickable(geneSummary[dataType]["dataTypeShort"]) if (geneSummary[dataType]["hrtCount"] === '0' || !dataTypeIsClickable) { - geneSummary[dataType]["hrtCount"] = 'X'; + geneSummary[dataType]["hrtCount"] = '-'; } if (geneSummary[dataType]["akiCount"] === '0' || !dataTypeIsClickable) { - geneSummary[dataType]["akiCount"] = 'X'; + geneSummary[dataType]["akiCount"] = '-'; } if (geneSummary[dataType]["ckdCount"] === '0' || !dataTypeIsClickable) { - geneSummary[dataType]["ckdCount"] = 'X'; + geneSummary[dataType]["ckdCount"] = '-'; } if (geneSummary[dataType]["dmrCount"] === '0' || !dataTypeIsClickable) { - geneSummary[dataType]["dmrCount"] = 'X'; + geneSummary[dataType]["dmrCount"] = '-'; } } return geneSummary } + formatCountRow = (row, type) => { + let dataTypeIsClickable = this.dataTypeIsClickable(row[type]["dataTypeShort"]) + if (row[type] === '0' || !dataTypeIsClickable) { + return '-' + } + console.log(row) + } + fetchGeneDatasetSummaryLocal = async (geneSymbol) => { await fetchGeneDatasetSummary(geneSymbol).then( (geneSummary) => { @@ -122,6 +130,7 @@ class GeneSummary extends Component { { title: "HEALTHY REFERENCE TISSUE", name: 'hrtCount', + getCellValue: row => this.formatCountRow(row, 'hrtCount') }, { title: "AKI TISSUE", @@ -140,7 +149,7 @@ class GeneSummary extends Component { }; dataTypeHasData(row) { - if (row.hrtCount !== '-' || row.akiCount !== '-' || row.ckdCount !== '-' || row.dmrCount !== '-') { + if (row.hrtCount !== '0' || row.akiCount !== '0' || row.ckdCount !== '0' || row.dmrCount !== '0') { return true; } return false; diff --git a/src/helpers/ApolloClient.js b/src/helpers/ApolloClient.js index 7b1efe2d..30efa447 100644 --- a/src/helpers/ApolloClient.js +++ b/src/helpers/ApolloClient.js @@ -136,7 +136,7 @@ export const fetchClusterHierarchy = async (cellType) => { } } -export const fetchGeneDatasetSummary = async (geneSymbol) => { +export const fetchGeneDatasetSummary = async (geneSymbol, fetchPolicy = 'no-cache') => { const response = await apolloClient.query({ query: gql` query { @@ -151,12 +151,10 @@ export const fetchGeneDatasetSummary = async (geneSymbol) => { dmrCount participantCount } - }` + }`, + fetchPolicy: fetchPolicy }); - console.log(response) if (response.data && response.data.getGeneDatasetInformation) { - console.log("getting dataset summary information") - console.log(response.data) return response.data.getGeneDatasetInformation; } else { console.log('response.error',response.error) diff --git a/src/helpers/Utils.js b/src/helpers/Utils.js index a3c07579..2207764c 100644 --- a/src/helpers/Utils.js +++ b/src/helpers/Utils.js @@ -112,7 +112,7 @@ export const getAllDataTypeOptions = () => { }; export const getDataTypeOptions = async (geneSymbol, cluster) => { - let options = fetchDataTypesForConcept(geneSymbol, cluster).then((result) => { + let options = await fetchDataTypesForConcept(geneSymbol, cluster).then((result) => { let dataTypes = result.dataTypesForConcept; const options = [ { From 3526c13377859436508880ebeae45f41108ca348 Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Mon, 18 Sep 2023 11:19:56 -0400 Subject: [PATCH 13/17] KPMP-3583: What is going on? --- src/components/Summary/GeneSummary.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Summary/GeneSummary.js b/src/components/Summary/GeneSummary.js index 98332b1e..a08edd44 100644 --- a/src/components/Summary/GeneSummary.js +++ b/src/components/Summary/GeneSummary.js @@ -62,11 +62,12 @@ class GeneSummary extends Component { } formatCountRow = (row, type) => { + console.log(row) let dataTypeIsClickable = this.dataTypeIsClickable(row[type]["dataTypeShort"]) if (row[type] === '0' || !dataTypeIsClickable) { return '-' } - console.log(row) + } fetchGeneDatasetSummaryLocal = async (geneSymbol) => { From 68646b0428ba952ed3077fd0467d5df31e82cc76 Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Mon, 18 Sep 2023 11:24:16 -0400 Subject: [PATCH 14/17] KPMP-3583: What is going on? --- src/components/Summary/GeneSummary.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Summary/GeneSummary.js b/src/components/Summary/GeneSummary.js index a08edd44..986baaf6 100644 --- a/src/components/Summary/GeneSummary.js +++ b/src/components/Summary/GeneSummary.js @@ -63,8 +63,8 @@ class GeneSummary extends Component { formatCountRow = (row, type) => { console.log(row) - let dataTypeIsClickable = this.dataTypeIsClickable(row[type]["dataTypeShort"]) - if (row[type] === '0' || !dataTypeIsClickable) { + let dataTypeIsClickable = this.dataTypeIsClickable(row["dataTypeShort"]) + if (row[type] === 0 || !dataTypeIsClickable) { return '-' } From 47806cefb4053984d598b1f7e8d05689d45d27ca Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Mon, 18 Sep 2023 11:26:59 -0400 Subject: [PATCH 15/17] KPMP-3583: What is going on? --- src/components/Summary/GeneSummary.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Summary/GeneSummary.js b/src/components/Summary/GeneSummary.js index 986baaf6..df036c80 100644 --- a/src/components/Summary/GeneSummary.js +++ b/src/components/Summary/GeneSummary.js @@ -66,7 +66,8 @@ class GeneSummary extends Component { let dataTypeIsClickable = this.dataTypeIsClickable(row["dataTypeShort"]) if (row[type] === 0 || !dataTypeIsClickable) { return '-' - } + } + return row[type] } From e84d7e44b3ff5630924f2701cac6e04fba251e7c Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Mon, 18 Sep 2023 11:30:13 -0400 Subject: [PATCH 16/17] KPMP-3583: What is going on? --- src/components/Summary/GeneSummary.js | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/src/components/Summary/GeneSummary.js b/src/components/Summary/GeneSummary.js index df036c80..a8744cb4 100644 --- a/src/components/Summary/GeneSummary.js +++ b/src/components/Summary/GeneSummary.js @@ -42,27 +42,7 @@ class GeneSummary extends Component { ); } - formatGeneDataset(geneSummary) { - for (const [dataType] of geneSummary.entries()) { - let dataTypeIsClickable = this.dataTypeIsClickable(geneSummary[dataType]["dataTypeShort"]) - if (geneSummary[dataType]["hrtCount"] === '0' || !dataTypeIsClickable) { - geneSummary[dataType]["hrtCount"] = '-'; - } - if (geneSummary[dataType]["akiCount"] === '0' || !dataTypeIsClickable) { - geneSummary[dataType]["akiCount"] = '-'; - } - if (geneSummary[dataType]["ckdCount"] === '0' || !dataTypeIsClickable) { - geneSummary[dataType]["ckdCount"] = '-'; - } - if (geneSummary[dataType]["dmrCount"] === '0' || !dataTypeIsClickable) { - geneSummary[dataType]["dmrCount"] = '-'; - } - } - return geneSummary - } - formatCountRow = (row, type) => { - console.log(row) let dataTypeIsClickable = this.dataTypeIsClickable(row["dataTypeShort"]) if (row[type] === 0 || !dataTypeIsClickable) { return '-' @@ -75,7 +55,6 @@ class GeneSummary extends Component { await fetchGeneDatasetSummary(geneSymbol).then( (geneSummary) => { if (geneSummary) { - // let formattedGeneSummary = this.formatGeneDataset(geneSummary) this.setState({ geneSummary: geneSummary, isLoading: false }); } }, @@ -137,21 +116,24 @@ class GeneSummary extends Component { { title: "AKI TISSUE", name: 'akiCount', + getCellValue: row => this.formatCountRow(row, 'akiCount') }, { title: "CKD TISSUE", name: 'ckdCount', + getCellValue: row => this.formatCountRow(row, 'ckdCount') }, { title: "DM-R TISSUE", name: 'dmrCount', + getCellValue: row => this.formatCountRow(row, 'dmrCount') }, ] }; dataTypeHasData(row) { - if (row.hrtCount !== '0' || row.akiCount !== '0' || row.ckdCount !== '0' || row.dmrCount !== '0') { + if (row.hrtCount !== 0 || row.akiCount !== 0 || row.ckdCount !== 0 || row.dmrCount !== 0) { return true; } return false; From fa02b204fcec71f1bda0f115a70f92722e1fb92c Mon Sep 17 00:00:00 2001 From: Becky Reamy Date: Mon, 18 Sep 2023 11:37:20 -0400 Subject: [PATCH 17/17] KPMP-3583: What is going on? --- src/components/Summary/GeneSummary.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Summary/GeneSummary.js b/src/components/Summary/GeneSummary.js index a8744cb4..5d2c409e 100644 --- a/src/components/Summary/GeneSummary.js +++ b/src/components/Summary/GeneSummary.js @@ -43,8 +43,9 @@ class GeneSummary extends Component { } formatCountRow = (row, type) => { + let hasData = this.dataTypeHasData(row) let dataTypeIsClickable = this.dataTypeIsClickable(row["dataTypeShort"]) - if (row[type] === 0 || !dataTypeIsClickable) { + if (!hasData || !dataTypeIsClickable) { return '-' } return row[type]