Skip to content

Commit 097139f

Browse files
authored
Merge pull request #985 from include-dcc/fix/sjip-1502-studyentity
fix: SJIP-1502 change logic for view in exploration
2 parents f0f7382 + 3da5494 commit 097139f

File tree

9 files changed

+14
-10
lines changed

9 files changed

+14
-10
lines changed

cypress/e2e/Consultation/PageStudy_2.cy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ describe('Page d\'une étude - Vérifier les informations affichées', () => {
122122
cy.get('[class*="StudyEntity_datasetTitle"] [class*="StudyEntity_datasetInfo"]').should('exist');
123123
cy.get('[id="HTP-RNAseq-WholeBlood-2020"] [class="ant-collapse-header"]').contains('HTP Whole Blood RNAseq (2020)').should('exist');
124124
cy.get('[id="HTP-RNAseq-WholeBlood-2020"] [class="ant-collapse-header"] [class*="ant-tag-green"]').contains('Harmonized').should('exist');
125-
cy.get('[id="HTP-RNAseq-WholeBlood-2020"] [class="ant-collapse-header"]').contains('View in exploration').should('exist');
126-
cy.get('[id="HTP-RNAseq-WholeBlood-2020"] [class="ant-collapse-header"]').contains('Manifest').should('exist');
127-
cy.get('[id="HTP-RNAseq-WholeBlood-2020"] [class="ant-collapse-header"]').contains('Analysis').should('exist');
125+
cy.get('[id="HTP-RNAseq-WholeBlood-2020"] [class="ant-collapse-extra"]').contains('View in exploration').should('exist');
126+
cy.get('[id="HTP-RNAseq-WholeBlood-2020"] [class="ant-collapse-extra"]').contains('Manifest').should('exist');
127+
cy.get('[id="HTP-RNAseq-WholeBlood-2020"] [class="ant-collapse-extra"]').contains('Analysis').should('exist');
128128
cy.get('[id="HTP-RNAseq-WholeBlood-2020"] [class="ant-descriptions-item-label"]').eq(0).contains('Dataset ID').should('exist');
129129
cy.get('[id="HTP-RNAseq-WholeBlood-2020"] [class="ant-descriptions-item-content"]').eq(0).contains('HTP-RNAseq-WholeBlood-2020').should('exist');
130130
cy.get('[id="HTP-RNAseq-WholeBlood-2020"] [class="ant-descriptions-item-label"]').eq(1).contains('Description').should('exist');

cypress/e2e/Consultation/PageStudy_3.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe('Page d\'une étude - Valider les liens disponibles', () => {
5757
});
5858

5959
it('Lien DataExploration du panneau HTP Whole Blood RNAseq (2020)', () => {
60-
cy.get('[id="HTP-RNAseq-WholeBlood-2020"] [class="ant-collapse-header"] button').eq(0).clickAndWait({force: true});
60+
cy.get('[id="HTP-RNAseq-WholeBlood-2020"] [class="ant-collapse-extra"] button').eq(0).clickAndWait({force: true});
6161
cy.get('[class*="DataFiles_dataFilesTabWrapper"]').should('exist'); // data-cy="ProTable_Participants"
6262
cy.get('[class*="QueryBar_selected"] [class*="QueryPill_field"]').contains('Dataset').should('exist');
6363
cy.get('[class*="QueryBar_selected"] [class*="QueryValues_value"]').contains('HTP Whole Blood RNAseq (2020)').should('exist');

cypress/e2e/ManifestButton/Dataset_1.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ beforeEach(() => {
1313
req.alias = 'postStats';
1414
req.reply(mockResponseBody);
1515
});
16-
cy.get('[id="HTP-WGS-2021-X01"] [class="ant-collapse-header"] button[class*="ant-btn-default "]').eq(1).click({force: true});
16+
cy.get('[id="HTP-WGS-2021-X01"] [class="ant-collapse-extra"] button[class*="ant-btn-default "]').eq(1).click({force: true});
1717
cy.wait('@postStats');
1818
});
1919
});

cypress/e2e/ManifestButton/Dataset_3.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ beforeEach(() => {
1515
req.alias = 'postStats';
1616
req.reply(mockResponseBody);
1717
});
18-
cy.get('[id="HTP-WGS-2021-X01"] [class="ant-collapse-header"] button[class*="ant-btn-default "]').eq(1).click({force: true});
18+
cy.get('[id="HTP-WGS-2021-X01"] [class="ant-collapse-extra"] button[class*="ant-btn-default "]').eq(1).click({force: true});
1919
cy.wait('@postStats');
2020
});
2121

cypress/fixtures/ResponseBody/StudyEntity.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@
417417
"experimental_platform": "Illumina",
418418
"experimental_strategy": "WGS",
419419
"external_dataset_id": "HTP-WGS-2021-X01",
420+
"has_participant_docs": true,
420421
"is_harmonized": true,
421422
"publications": [],
422423
"publications_details": "publications_details"
@@ -505,6 +506,7 @@
505506
"experimental_platform": "Illumina NovaSeq 6000",
506507
"experimental_strategy": "Bulk RNA-Seq",
507508
"external_dataset_id": "HTP-RNAseq-WholeBlood-2020",
509+
"has_participant_docs": true,
508510
"is_harmonized": true,
509511
"publications": [
510512
"https://pubmed.ncbi.nlm.nih.gov/37379383|https://pubmed.ncbi.nlm.nih.gov/39737640"

src/graphql/studies/models.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export interface IStudyDataset {
2828
is_harmonized?: boolean;
2929
publications?: string[];
3030
publications_details?: ArrangerResultsTree<IPublicationDetails>;
31+
has_participant_docs?: boolean;
3132
}
3233

3334
export interface IAuthor {

src/graphql/studies/queries.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ export const GET_STUDY = gql`
192192
experimental_platform
193193
experimental_strategy
194194
external_dataset_id
195+
has_participant_docs
195196
is_harmonized
196197
publications
197198
publications_details {

src/views/PublicStudyEntity/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ const PublicStudyEntity = () => {
336336
</Title>
337337
{studyData?.datasets?.map((dataset, index: number) => {
338338
const titleExtra = [];
339-
340-
if (dataset.dataset_name && dataset.is_harmonized) {
339+
const hasDocsInExploration = dataset.has_participant_docs;
340+
if (hasDocsInExploration) {
341341
titleExtra.push(
342342
<Button
343343
className={style.datasetBtn}

src/views/StudyEntity/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,8 @@ const StudyEntity = () => {
580580
</Title>
581581
{study?.datasets?.hits.edges.map(({ node: dataset }, index: number) => {
582582
const titleExtra = [];
583-
584-
if (dataset.dataset_name && dataset.is_harmonized) {
583+
const hasDocsInExploration = dataset.has_participant_docs;
584+
if (hasDocsInExploration) {
585585
titleExtra.push(
586586
<Button
587587
className={style.datasetBtn}

0 commit comments

Comments
 (0)