Skip to content

Commit d18defd

Browse files
nicoaleejdkent
andauthored
457 redo curation phase (#906)
* feat: updated meta analysis page view * feat: added niivue visualizer and updated meta analysis page * feat: visualizer changes * fix: albany vite config * feat: added results and dynamic image display * maint: remove banner * feat: added nimare file parsing * feat: added ordering of maps * feat: added download and snapshot * chore: added tests for ordering * feat: added threshold textfields * fix: remove unused code * fix: order * fix: prevented mutation of array * fix: order * feat: initial page created for new curation * wip: query features * feat: update curation and add imports * wip: search based on metadata * wip: separate return and filters of features * wip: restructure from feedback * run black * feat: added import support * feat: remove duplicates resolve ui and create editable display links * feat: table updates * feat: added select rows feature * feat: minor improvements * wip: refactor query feature * fix query building and testing * test the or functionality * fix jsonpath string generation * fix tests for most the schemas * fix tests * formatting * formatting * feat: added curation table state to session storage * feat: updated auto positioning * feat: add initial extract data http call * feat: added extraction data and updated imports with better naming, increased page size for curation * feat: inital implementation of pipeline-study-results API * feat: integrated pipeline study results into curator table columns * feat: added filter fn for columns * feat: adding virtualization with innner and outer override * feat: added virtualization * feat: added exclusion as a collapsible menu item * feat: minor style changes * feat: added support for UI switching and PRISMA workflow * fix: dont show prisma button when not prisma * feat: address feedback * feat: addressed feedback and fixed bug with initial prisma creation * chore: integrations tests * fix: failing test due to case sensitivity for files systems in linux * fix: removed only block preventing tests from running --------- Co-authored-by: James Kent <[email protected]>
1 parent 13c9d90 commit d18defd

File tree

142 files changed

+11154
-4063
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+11154
-4063
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
{}

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

Lines changed: 882 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 25 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,11 @@ describe('ImportStudiesDialog', () => {
1111
});
1212

1313
it('should load the page', () => {
14-
cy.login('mocked')
15-
.visit('/projects/abc123/curation')
16-
.wait('@projectFixture')
17-
.wait('@studysetFixture');
14+
cy.login('mocked').visit('/projects/abc123/curation').wait('@projectFixture').wait('@studysetFixture');
1815
});
1916

2017
it('should open the import studies dialog', () => {
21-
cy.login('mocked')
22-
.visit('/projects/abc123/curation')
23-
.wait('@projectFixture')
24-
.wait('@studysetFixture');
18+
cy.login('mocked').visit('/projects/abc123/curation').wait('@projectFixture').wait('@studysetFixture');
2519
cy.contains('button', 'import studies').click();
2620
cy.get('.MuiFormControl-root').should('be.visible');
2721
cy.url().should('include', '/projects/abc123/curation/import');
@@ -49,32 +43,27 @@ describe('ImportStudiesDialog', () => {
4943
cy.contains(
5044
'button',
5145
`Import ${baseStudiesResponse.response?.body?.results?.length} studies from neurostore`
52-
).click();
46+
).should('be.disabled');
5347
});
54-
cy.contains('button', 'next').should('be.disabled');
5548
});
5649

5750
it('should import studies', () => {
51+
cy.get('input[type="text"]').type('neuron');
52+
cy.get('button').contains('Search').click();
5853
cy.wait('@baseStudiesFixture').then((baseStudiesResponse) => {
5954
cy.contains(
6055
'button',
6156
`Import ${baseStudiesResponse.response?.body?.results?.length} studies from neurostore`
6257
).click();
6358
});
6459
cy.get('input').type('my new import{enter}');
65-
cy.contains('button', 'next')
66-
.click()
67-
.url()
68-
.should('include', '/projects/abc123/curation');
60+
cy.contains('button', 'next').click().url().should('include', '/projects/abc123/curation');
6961
});
7062
});
7163

7264
describe('Import via Pubmed IDs', () => {
7365
beforeEach(() => {
74-
cy.login('mocked')
75-
.visit('/projects/abc123/curation')
76-
.wait('@projectFixture')
77-
.wait('@studysetFixture');
66+
cy.login('mocked').visit('/projects/abc123/curation').wait('@projectFixture').wait('@studysetFixture');
7867
cy.intercept('PUT', '**/api/projects/abc123').as('updateProjectFixture');
7968
// not going to mock this for now as cypress does not seem to support XML fixtures
8069
// cy.intercept('POST', 'https://eutils.ncbi.nlm.nih.gov/**', {
@@ -86,9 +75,7 @@ describe('ImportStudiesDialog', () => {
8675
});
8776

8877
it('should show the pmid input page', () => {
89-
cy.get(
90-
'textarea[placeholder="Enter list of pubmed IDs separated by a newline"]'
91-
).should('be.visible');
78+
cy.get('textarea[placeholder="Enter list of pubmed IDs separated by a newline"]').should('be.visible');
9279
});
9380

9481
it('should be disabled initially', () => {
@@ -116,10 +103,7 @@ describe('ImportStudiesDialog', () => {
116103
.type('123{enter}456{enter}789');
117104
cy.contains('button', 'next').click();
118105
cy.get('input').type('my new import{enter}');
119-
cy.contains('button', 'next')
120-
.click()
121-
.url()
122-
.should('include', '/projects/abc123/curation');
106+
cy.contains('button', 'next').click().url().should('include', '/projects/abc123/curation');
123107
});
124108

125109
it('should import studies via a file', () => {
@@ -130,10 +114,7 @@ describe('ImportStudiesDialog', () => {
130114

131115
describe('Manually create a new study', () => {
132116
beforeEach(() => {
133-
cy.login('mocked')
134-
.visit('/projects/abc123/curation')
135-
.wait('@projectFixture')
136-
.wait('@studysetFixture');
117+
cy.login('mocked').visit('/projects/abc123/curation').wait('@projectFixture').wait('@studysetFixture');
137118
cy.intercept('PUT', '**/api/projects/abc123').as('updateProjectFixture');
138119
cy.contains('button', 'import studies').click();
139120
cy.contains('Manually create a new study').click();
@@ -170,19 +151,13 @@ describe('ImportStudiesDialog', () => {
170151
cy.contains('li', 'Neurostore').click();
171152
cy.contains('button', 'next').click();
172153
cy.get('input').type('my new import{enter}');
173-
cy.contains('button', 'next')
174-
.click()
175-
.url()
176-
.should('include', '/projects/abc123/curation');
154+
cy.contains('button', 'next').click().url().should('include', '/projects/abc123/curation');
177155
});
178156
});
179157

180158
describe('Import via File Format', () => {
181159
beforeEach(() => {
182-
cy.login('mocked')
183-
.visit('/projects/abc123/curation')
184-
.wait('@projectFixture')
185-
.wait('@studysetFixture');
160+
cy.login('mocked').visit('/projects/abc123/curation').wait('@projectFixture').wait('@studysetFixture');
186161
cy.intercept('PUT', '**/api/projects/abc123').as('updateProjectFixture');
187162
cy.contains('button', 'import studies').click();
188163
cy.contains('Import via File Format').click();
@@ -222,9 +197,7 @@ describe('ImportStudiesDialog', () => {
222197
it('should show an error message', () => {
223198
cy.get('input[role="combobox"]').click();
224199
cy.contains('li', 'Scopus').click();
225-
cy.get('textarea[placeholder="paste in valid endnote, bibtex, or RIS syntax"]').type(
226-
'INVALID FORMAT'
227-
);
200+
cy.get('textarea[placeholder="paste in valid endnote, bibtex, or RIS syntax"]').type('INVALID FORMAT');
228201
cy.contains(/Format is incorrect/).should('be.visible');
229202
});
230203

@@ -242,18 +215,13 @@ describe('ImportStudiesDialog', () => {
242215

243216
cy.contains('button', 'next').click();
244217
cy.get('input').type('my new import{enter}');
245-
cy.contains('button', 'next')
246-
.click()
247-
.url()
248-
.should('include', '/projects/abc123/curation');
218+
cy.contains('button', 'next').click().url().should('include', '/projects/abc123/curation');
249219
});
250220

251221
it('should upload a onenote (ENW) file', () => {
252222
cy.get('input[role="combobox"]').click();
253223
cy.contains('li', 'Scopus').click();
254-
cy.get('label[role="button"]').selectFile(
255-
'cypress/fixtures/standardFiles/onenoteStudies.txt'
256-
);
224+
cy.get('label[role="button"]').selectFile('cypress/fixtures/standardFiles/onenoteStudies.txt');
257225
cy.contains('button', 'next').should('be.visible');
258226
});
259227

@@ -264,49 +232,6 @@ describe('ImportStudiesDialog', () => {
264232
// it('should import studies via a file', () => {})
265233
});
266234

267-
describe('IMPORT DUPLICATES', () => {
268-
beforeEach(() => {
269-
cy.login('mocked')
270-
.visit('/projects/abc123/curation')
271-
.wait('@projectFixture')
272-
.wait('@studysetFixture');
273-
cy.intercept('PUT', '**/api/projects/abc123').as('updateProjectFixture');
274-
cy.contains('button', 'import studies').click();
275-
cy.contains('Import via File Format').click();
276-
cy.contains('button', 'next').click();
277-
278-
cy.get('input[role="combobox"').click();
279-
cy.contains('li', 'Scopus').click();
280-
});
281-
282-
it('should show the resolve duplicates page', () => {
283-
cy.get('label[role="button"]').selectFile(
284-
'cypress/fixtures/standardFiles/onenoteStudiesDuplicates.txt'
285-
);
286-
cy.contains('button', 'next').click();
287-
cy.contains('Duplicates were found in your import file').should('be.visible');
288-
cy.contains('button', 'next').should('be.disabled');
289-
});
290-
291-
it('should resolve all cases', () => {
292-
cy.get('label[role="button"]').selectFile(
293-
'cypress/fixtures/standardFiles/onenoteStudiesDuplicates.txt'
294-
);
295-
cy.contains('button', 'next').click();
296-
cy.contains('button', 'Keep this study').first().click();
297-
cy.contains('button', 'next').should('not.be.disabled');
298-
});
299-
300-
it('should mark one case as duplicate', () => {
301-
cy.get('label[role="button"]').selectFile(
302-
'cypress/fixtures/standardFiles/onenoteStudiesDuplicates.txt'
303-
);
304-
cy.contains('button', 'next').click();
305-
cy.contains('button', 'This is a duplicate').first().click();
306-
cy.contains('button', 'next').should('be.disabled');
307-
});
308-
});
309-
310235
describe('PROJECT DUPLICATES', () => {
311236
beforeEach(() => {
312237
cy.intercept('GET', `**/api/projects/*`, {
@@ -316,10 +241,7 @@ describe('ImportStudiesDialog', () => {
316241
cy.intercept('PUT', '**/api/projects/**', { fixture: 'projects/projectWithStub' }).as(
317242
'updateProjectFixture'
318243
);
319-
cy.login('mocked')
320-
.visit('/projects/abc123/curation')
321-
.wait('@projectFixture')
322-
.wait('@studysetFixture');
244+
cy.login('mocked').visit('/projects/abc123/curation').wait('@projectFixture').wait('@studysetFixture');
323245
cy.contains('button', 'import studies').click();
324246
cy.contains('Import via File Format').click();
325247
cy.contains('button', 'next').click();
@@ -328,28 +250,13 @@ describe('ImportStudiesDialog', () => {
328250
cy.contains('li', 'Scopus').click();
329251
});
330252

331-
it('should show the resolve duplicates page if there are duplicates IN THE PROJECT', () => {
332-
cy.get('label[role="button"]').selectFile(
333-
'cypress/fixtures/standardFiles/onenoteStudies.txt'
334-
);
335-
336-
cy.contains('button', 'next').click();
337-
cy.get('input').type('my new import{enter}');
338-
cy.contains('button', 'next').click();
339-
cy.contains(/duplicates that already exist within the project/).should('be.visible');
340-
cy.contains('button', 'next').should('be.disabled');
341-
});
342-
343-
it('should resolve all cases', () => {
344-
cy.get('label[role="button"]').selectFile(
345-
'cypress/fixtures/standardFiles/onenoteStudies.txt'
346-
);
253+
it('should show the resolve duplicates popup', () => {
254+
cy.get('label[role="button"]').selectFile('cypress/fixtures/standardFiles/onenoteStudies.txt');
347255

348256
cy.contains('button', 'next').click();
349257
cy.get('input').type('my new import{enter}');
350258
cy.contains('button', 'next').click();
351-
cy.contains('button', 'Keep this study').first().click();
352-
cy.contains('button', 'next').should('be.enabled');
259+
cy.contains(/Some duplicates were detected/).should('be.visible');
353260
});
354261
});
355262

@@ -359,34 +266,22 @@ describe('ImportStudiesDialog', () => {
359266
fixture: 'baseStudies/baseStudiesWithResults',
360267
}).as('baseStudiesFixture');
361268
cy.intercept('PUT', '**/api/projects/abc123').as('updateProjectFixture');
362-
cy.login('mocked')
363-
.visit('/projects/abc123/curation')
364-
.wait('@projectFixture')
365-
.wait('@studysetFixture');
269+
cy.login('mocked').visit('/projects/abc123/curation').wait('@projectFixture').wait('@studysetFixture');
366270
cy.contains('button', 'import studies').click();
367271
cy.contains('button', 'next').click();
368272
});
369273

370-
it('should select the import by clicking the option', () => {
274+
it('should enter the import name based on the search and typed text', () => {
275+
cy.get('input[type="text"]').type('neuron');
276+
cy.get('button').contains('Search').click();
371277
cy.wait('@baseStudiesFixture').then((baseStudiesResponse) => {
372278
cy.contains(
373279
'button',
374280
`Import ${baseStudiesResponse.response?.body?.results?.length} studies from neurostore`
375281
).click();
376282
});
377-
cy.get('input').type('my new import');
378-
cy.contains('Set name as "my new import"').click();
379-
cy.contains('button', 'next').should('not.be.disabled');
380-
});
381-
382-
it('should select the import by pressing enter', () => {
383-
cy.wait('@baseStudiesFixture').then((baseStudiesResponse) => {
384-
cy.contains(
385-
'button',
386-
`Import ${baseStudiesResponse.response?.body?.results?.length} studies from neurostore`
387-
).click();
388-
});
389-
cy.get('input').type('my new import{enter}');
283+
cy.get('input[type="text"]').type(' (my import)');
284+
cy.should('have.value', 'neuron (my import)').click();
390285
cy.contains('button', 'next').should('not.be.disabled');
391286
});
392287
});

0 commit comments

Comments
 (0)