Skip to content

Commit dbe1c0d

Browse files
authored
Feat 1072 update identification phase (#1162)
* feat: initial implementation of new identification ui * fix: row selection * fix: failing test cases * fix: add card * fix: update button styling
1 parent 5dc754f commit dbe1c0d

20 files changed

+742
-139
lines changed

compose/neurosynth-frontend/cypress/e2e/workflows/Curation/CurationAIInterface.cy.tsx

Lines changed: 187 additions & 29 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('ImportStudiesDialog', () => {
1515
cy.login('mocked').visit('/projects/abc123/curation').wait('@projectFixture').wait('@studysetFixture');
1616
});
1717

18-
it('should open the import studies dialog', () => {
18+
it('should open the import studies page', () => {
1919
cy.login('mocked').visit('/projects/abc123/curation').wait('@projectFixture').wait('@studysetFixture');
2020
cy.contains('button', 'import studies').click();
2121
cy.get('.MuiFormControl-root').should('be.visible');
@@ -255,34 +255,6 @@ describe('ImportStudiesDialog', () => {
255255
// it('should import studies via a file', () => {})
256256
});
257257

258-
describe('PROJECT DUPLICATES', () => {
259-
beforeEach(() => {
260-
cy.intercept('GET', `**/api/projects/*`, {
261-
fixture: 'projects/projectWithStub',
262-
}).as('projectFixture');
263-
// not a very good mocked update, but we need to provide a fixture so that it doesnt send a real request to the BE
264-
cy.intercept('PUT', '**/api/projects/**', { fixture: 'projects/projectWithStub' }).as(
265-
'updateProjectFixture'
266-
);
267-
cy.login('mocked').visit('/projects/abc123/curation').wait('@projectFixture').wait('@studysetFixture');
268-
cy.contains('button', 'import studies').click();
269-
cy.contains('Import via File Format').click();
270-
cy.contains('button', 'next').click();
271-
272-
cy.get('input[role="combobox"').click();
273-
cy.contains('li', 'Scopus').click();
274-
});
275-
276-
it('should show the resolve duplicates popup', () => {
277-
cy.get('label[role="button"]').selectFile('cypress/fixtures/standardFiles/onenoteStudies.txt');
278-
279-
cy.contains('button', 'next').click();
280-
cy.get('input').type('my new import{enter}');
281-
cy.contains('button', 'next').click();
282-
cy.contains(/Some duplicates were detected/).should('be.visible');
283-
});
284-
});
285-
286258
describe('Other features', () => {
287259
beforeEach(() => {
288260
cy.intercept('GET', '**/api/base-studies/**', {
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
{
2+
"created_at": "2025-05-30T23:14:42.972395+00:00",
3+
"description": "",
4+
"draft": true,
5+
"id": "aubYH6Hdvoe3",
6+
"meta_analyses": [],
7+
"name": "Untitled",
8+
"neurostore_study": {
9+
"created_at": "2025-05-30T23:14:42.984037+00:00",
10+
"exception": null,
11+
"neurostore_id": "YVqGsqRLSned",
12+
"status": "PENDING",
13+
"traceback": null,
14+
"updated_at": "2025-05-30T23:14:42.990766+00:00"
15+
},
16+
"neurostore_url": "https://neurostore.org/api/studies/YVqGsqRLSned",
17+
"provenance": {
18+
"curationMetadata": {
19+
"columns": [
20+
{
21+
"id": "bf2f83c7-0a3b-48d4-b30c-5860f6bb29b9",
22+
"name": "Identification",
23+
"stubStudies": [
24+
{
25+
"abstractText": "",
26+
"articleLink": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2886908/",
27+
"articleYear": "2010",
28+
"authors": "Nelson, Steven M, Dosenbach, Nico UF, Cohen, Alexander L, Wheeler, Mark E, Schlaggar, Bradley L, Petersen, Steven E",
29+
"doi": "https://doi.org/10.1007%2Fs00429-010-0260-2",
30+
"exclusionTag": null,
31+
"id": "15799890-70d5-4f90-aa5f-92fba8ea165b",
32+
"identificationSource": {
33+
"id": "neurosynth_neurostore_id_source",
34+
"label": "Neurostore"
35+
},
36+
"importId": "75d6c47e-627f-4965-b51e-c06912b67dde",
37+
"journal": "Brain structure and function",
38+
"keywords": "",
39+
"neurostoreId": "3haTSe2ojmt6",
40+
"pmid": "25461707",
41+
"searchTerm": "?genericSearchStr=emotional+damage&dataType=all&source=all&sortBy=relevance&descOrder=true",
42+
"tags": [
43+
{
44+
"id": "d337f434-c6db-4e86-8809-ed7e5d6769b2",
45+
"isAssignable": true,
46+
"isExclusionTag": false,
47+
"label": "?genericSearchStr=emotional+damage&dataType=all&source=all&sortBy=relevance&descOrder=true"
48+
}
49+
],
50+
"title": "Role of the anterior insula in task-level control and focal attention"
51+
}
52+
]
53+
},
54+
{
55+
"id": "a2e51654-d54c-47e2-80f6-ca3776e55939",
56+
"name": "Screening",
57+
"stubStudies": []
58+
},
59+
{
60+
"id": "bc39eaf3-3162-4604-ab7f-af6ea811edcf",
61+
"name": "Eligibility",
62+
"stubStudies": []
63+
},
64+
{
65+
"id": "9cbac36b-a3a0-4bcd-9e7c-58aac9fc8e07",
66+
"name": "Included",
67+
"stubStudies": []
68+
}
69+
],
70+
"exclusionTags": [
71+
{
72+
"id": "neurosynth_exclude_exclusion",
73+
"isAssignable": true,
74+
"isExclusionTag": true,
75+
"label": "Exclude"
76+
},
77+
{
78+
"id": "neurosynth_duplicate_exclusion",
79+
"isAssignable": true,
80+
"isExclusionTag": true,
81+
"label": "Duplicate"
82+
}
83+
],
84+
"identificationSources": [
85+
{
86+
"id": "neurosynth_neurostore_id_source",
87+
"label": "Neurostore"
88+
},
89+
{
90+
"id": "neurosynth_pubmed_id_source",
91+
"label": "PubMed"
92+
},
93+
{
94+
"id": "neurosynth_scopus_id_source",
95+
"label": "Scopus"
96+
},
97+
{
98+
"id": "neurosynth_web_of_science_id_source",
99+
"label": "Web of Science"
100+
},
101+
{
102+
"id": "neurosynth_psycinfo_id_source",
103+
"label": "PsycInfo"
104+
},
105+
{
106+
"id": "neurosynth_sleuth_id_source",
107+
"label": "Sleuth"
108+
}
109+
],
110+
"imports": [
111+
{
112+
"date": "2025-05-31T22:27:37.191Z",
113+
"id": "75d6c47e-627f-4965-b51e-c06912b67dde",
114+
"importModeUsed": "NEUROSTORE_IMPORT",
115+
"name": "marijuana",
116+
"neurostoreSearchParams": "genericSearchStr=marijuana&sortBy=relevance&pageOfResults=1&descOrder=true&pageSize=10&source=all&dataType=all&level=group&flat=true&info=true",
117+
"numImported": 29
118+
}
119+
],
120+
"infoTags": [
121+
{
122+
"id": "neurosynth_untagged_tag",
123+
"isAssignable": false,
124+
"isExclusionTag": false,
125+
"label": "Untagged studies"
126+
},
127+
{
128+
"id": "neurosynth_uncategorized_tag",
129+
"isAssignable": false,
130+
"isExclusionTag": false,
131+
"label": "Uncategorized Studies"
132+
},
133+
{
134+
"id": "neurosynth_needs_review_tag",
135+
"isAssignable": false,
136+
"isExclusionTag": false,
137+
"label": "Needs Review"
138+
}
139+
],
140+
"prismaConfig": {
141+
"eligibility": {
142+
"exclusionTags": [
143+
{
144+
"id": "neurosynth_reports_not_retrieved_exclusion",
145+
"isAssignable": true,
146+
"isExclusionTag": true,
147+
"label": "Reports not retrieved"
148+
},
149+
{
150+
"id": "neurosynth_insufficient_detail_exclusion",
151+
"isAssignable": true,
152+
"isExclusionTag": true,
153+
"label": "Insufficient Details"
154+
},
155+
{
156+
"id": "neurosynth_limited_rigor",
157+
"isAssignable": true,
158+
"isExclusionTag": true,
159+
"label": "Limited Rigor"
160+
},
161+
{
162+
"id": "neurosynth_out_of_scope_exclusion",
163+
"isAssignable": true,
164+
"isExclusionTag": true,
165+
"label": "Out of scope"
166+
}
167+
]
168+
},
169+
"identification": {
170+
"exclusionTags": [
171+
{
172+
"id": "neurosynth_duplicate_exclusion",
173+
"isAssignable": true,
174+
"isExclusionTag": true,
175+
"label": "Duplicate"
176+
}
177+
]
178+
},
179+
"isPrisma": true,
180+
"screening": {
181+
"exclusionTags": [
182+
{
183+
"id": "neurosynth_irrelevant_exclusion",
184+
"isAssignable": true,
185+
"isExclusionTag": true,
186+
"label": "Irrelevant"
187+
}
188+
]
189+
}
190+
}
191+
},
192+
"extractionMetadata": {
193+
"studyStatusList": []
194+
},
195+
"metaAnalysisMetadata": {
196+
"canEditMetaAnalyses": false
197+
}
198+
},
199+
"public": true,
200+
"updated_at": "2025-06-09T21:26:11.191969+00:00",
201+
"user": "github|26612023",
202+
"username": "Nicholas Lee"
203+
}
204+

compose/neurosynth-frontend/cypress/fixtures/projects/projectWithStub.json renamed to compose/neurosynth-frontend/cypress/fixtures/projects/projectWithStubSimple.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"id": "neurosynth_neurostore_id_source",
3535
"label": "Neurostore"
3636
},
37+
"importId": "75d6c47e-627f-4965-b51e-c06912b67dde",
3738
"journal": "Brain structure and function",
3839
"keywords": "",
3940
"neurostoreId": "3haTSe2ojmt6",
@@ -93,6 +94,16 @@
9394
"label": "PsycInfo"
9495
}
9596
],
97+
"imports": [
98+
{
99+
"date": "2025-05-31T22:27:37.191Z",
100+
"id": "75d6c47e-627f-4965-b51e-c06912b67dde",
101+
"importModeUsed": "NEUROSTORE_IMPORT",
102+
"name": "marijuana",
103+
"neurostoreSearchParams": "genericSearchStr=marijuana&sortBy=relevance&pageOfResults=1&descOrder=true&pageSize=10&source=all&dataType=all&level=group&flat=true&info=true",
104+
"numImported": 29
105+
}
106+
],
96107
"infoTags": [
97108
{
98109
"id": "neurosynth_untagged_tag",

compose/neurosynth-frontend/src/pages/Curation/components/CurationBoardAIGroupsListItem.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { KeyboardArrowRight } from '@mui/icons-material';
2-
import { ListItem, ListItemButton, ListItemIcon, ListItemText, Chip, Collapse, Box, Tooltip } from '@mui/material';
2+
import { Box, Chip, Collapse, ListItem, ListItemButton, ListItemIcon, ListItemText, Tooltip } from '@mui/material';
3+
import React, { useState } from 'react';
34
import CurationBoardAIGroupsStyles from './CurationBoardAIGroups.styles';
45
import { IGroupListItem } from './CurationBoardAIGroupsList';
5-
import { useState } from 'react';
6-
import React from 'react';
76

87
const CurationBoardAIGroupsListItem: React.FC<{
98
selectedGroupId: string | undefined;
@@ -61,7 +60,9 @@ const CurationBoardAIGroupsListItem: React.FC<{
6160
primary={group.label}
6261
secondary={group.secondaryLabel}
6362
/>
64-
{!expanded && <Chip label={group.count} sx={{ fontSize: '12px', height: '20px' }} />}
63+
{!expanded && group.count !== null && (
64+
<Chip label={group.count} sx={{ fontSize: '12px', height: '20px' }} />
65+
)}
6566
</ListItemButton>
6667
</ListItem>
6768
</Tooltip>

0 commit comments

Comments
 (0)