Skip to content

Commit

Permalink
567 make studies swappable (#608)
Browse files Browse the repository at this point in the history
* fix: out of sync snackbar, error importing studies message, search url, curation import review styling, better move to extraction handling, handsontable responsiveness for study view

* feat: add support for bulk upload and switching studies

* feat: add test hot annotation

* feat: added annotation store

* feat: minor refactors

* feat: more updates

* chore: add typescript sdk

* chore: add sdk updates

* feat: creating new annotation study table with store

* feat: added annotation study table

* feat: performance improvements

* feat: finished refactor of annotation table making it robust to rerenders

* feat: finished implementing clone on save

* feat: fixed bug with cloning and annotations, added swap button

* feat: added swap study button feature

* feat: added rounded bottom corners

* fix: resolved some visual and logical bugs, fixed test case

* chore: remove unused variable
  • Loading branch information
nicoalee authored Nov 2, 2023
1 parent e424b75 commit cd943a0
Show file tree
Hide file tree
Showing 115 changed files with 23,340 additions and 17,319 deletions.
16 changes: 13 additions & 3 deletions compose/neurosynth-frontend/cypress/e2e/pages/EditStudyPage.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,31 @@

export {};

const PATH = '/projects/abc123/extraction/studies/mock-study-id/edit';
const PATH = '/projects/abc123/extraction/studies/mock-study-id';
const PAGE_NAME = 'EditStudyPage';

describe(PAGE_NAME, () => {
beforeEach(() => {
cy.clearLocalStorage().clearSessionStorage();
cy.intercept('GET', 'https://api.appzi.io/**', { fixture: 'appzi' }).as('appziFixture');
cy.intercept('GET', `https://api.semanticscholar.org/**`, {
fixture: 'semanticScholar',
}).as('semanticScholarFixture');
});

it('should load', () => {
cy.intercept('GET', `**/api/projects/*`, { fixture: 'project' }).as('projectFixture');
cy.intercept('GET', `**/api/studies/mock-study-id*`, { fixture: 'study' }).as(
'studyFixture'
);
cy.visit(PATH).wait('@projectFixture').wait('@studyFixture');
cy.intercept('GET', `**/api/projects/*`, { fixture: 'project' }).as('projectFixture');
cy.intercept('GET', `**/api/annotations/*`, { fixture: 'annotation' }).as(
'annotationFixture'
);
cy.visit(PATH)
.wait('@studyFixture')
.wait('@projectFixture')
.wait('@annotationFixture')
.wait('@semanticScholarFixture');
// cy.login('mocked').wait('@realProjectsRequest').visit(PATH).wait('@studyFixture');
});

Expand Down
44 changes: 44 additions & 0 deletions compose/neurosynth-frontend/cypress/fixtures/annotation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"created_at": "2023-11-02T19:05:58.374860+00:00",
"description": "",
"id": "5LSBDTGqA6RF",
"metadata": null,
"name": "Annotation for studyset 73HRs8HaJbR8",
"note_keys": {
"included": "boolean"
},
"notes": [
{
"analysis": "5KyvcoE3eE8f",
"analysis_name": "Analysis 1",
"authors": "Noonan SK, Haist F, Muller RA",
"note": {
"included": false
},
"publication": "Brain research",
"study": "mock-study-id",
"study_name": "Aberrant functional connectivity in autism: evidence from low-frequency BOLD signal fluctuations.",
"study_year": 2009
},
{
"analysis": "B7GDVjuVThso",
"analysis_name": "Analysis 2",
"authors": "Noonan SK, Haist F, Muller RA",
"note": {
"included": true
},
"publication": "Brain research",
"study": "mock-study-id",
"study_name": "Aberrant functional connectivity in autism: evidence from low-frequency BOLD signal fluctuations.",
"study_year": 2009
}
],
"source": null,
"source_id": null,
"source_updated_at": null,
"studyset": "73HRs8HaJbR8",
"updated_at": null,
"user": "github|26612023",
"username": "Nicholas Lee"
}

159 changes: 116 additions & 43 deletions compose/neurosynth-frontend/cypress/fixtures/project.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,120 @@
{
"created_at": "2023-09-14T18:04:28.079423+00:00",
"description": "",
"id": "4HxF4g4WC5zj",
"meta_analyses": [],
"name": "My project name",
"neurostore_study": {
"created_at": "2023-09-14T18:04:28.090521+00:00",
"exception": null,
"neurostore_id": "4PG9x8gYaoWd",
"status": "PENDING",
"traceback": null,
"updated_at": "2023-09-14T18:04:28.111166+00:00"
},
"neurostore_url": "https://neurostore.org/api/studies/4PG9x8gYaoWd",
"provenance": {
"curationMetadata": {
"columns": [],
"exclusionTags": [],
"identificationSources": [],
"infoTags": [],
"prismaConfig": {
"eligibility": {
"exclusionTags": []
},
"identification": {
"exclusionTags": []
},
"isPrisma": false,
"screening": {
"exclusionTags": []
}
"created_at": "2023-11-02T15:48:04.630172+00:00",
"description": "this is a bulk import test",
"id": "3YK4ZD7aeyQU",
"meta_analyses": [
"3xHJJQWFURob"
],
"name": "Bulk import test",
"neurostore_study": {
"created_at": "2023-11-02T15:48:04.640598+00:00",
"exception": null,
"neurostore_id": "7BrAuwJ2tjPW",
"status": "PENDING",
"traceback": null,
"updated_at": "2023-11-02T15:48:04.653465+00:00"
},
"neurostore_url": "https://neurostore.org/api/studies/7BrAuwJ2tjPW",
"provenance": {
"curationMetadata": {
"columns": [
{
"id": "370ba40c-91e8-47e7-9b4d-926bc8f31d10",
"name": "not included",
"stubStudies": []
},
{
"id": "1f15d9a7-968e-44a6-8574-caa3794e050e",
"name": "included",
"stubStudies": []
}
],
"exclusionTags": [
{
"id": "neurosynth_exclude_exclusion",
"isAssignable": true,
"isExclusionTag": true,
"label": "Exclude"
},
{
"id": "neurosynth_duplicate_exclusion",
"isAssignable": true,
"isExclusionTag": true,
"label": "Duplicate"
}
],
"identificationSources": [
{
"id": "neurosynth_neurostore_id_source",
"label": "Neurostore"
},
{
"id": "neurosynth_pubmed_id_source",
"label": "PubMed"
},
{
"id": "neurosynth_scopus_id_source",
"label": "Scopus"
},
{
"id": "neurosynth_web_of_science_id_source",
"label": "Web of Science"
},
{
"id": "neurosynth_psycinfo_id_source",
"label": "PsycInfo"
}
],
"infoTags": [
{
"id": "neurosynth_untagged_tag",
"isAssignable": false,
"isExclusionTag": false,
"label": "Untagged studies"
},
{
"id": "neurosynth_uncategorized_tag",
"isAssignable": false,
"isExclusionTag": false,
"label": "Uncategorized Studies"
},
{
"id": "neurosynth_needs_review_tag",
"isAssignable": false,
"isExclusionTag": false,
"label": "Needs Review"
},
{
"id": "6f299c47-766c-48bd-a56b-9c77019ea9de",
"isAssignable": true,
"isExclusionTag": false,
"label": "marijuana"
}
],
"prismaConfig": {
"eligibility": {
"exclusionTags": []
},
"identification": {
"exclusionTags": []
},
"isPrisma": false,
"screening": {
"exclusionTags": []
}
},
"extractionMetadata": {
"studyStatusList": []
},
"metaAnalysisMetadata": {
"canEditMetaAnalyses": false
}
},
"public": false,
"updated_at": "2023-09-14T18:04:34.184976+00:00",
"user": "github|12387943",
"username": "Nicholas Lee"
}

"extractionMetadata": {
"annotationId": "5LSBDTGqA6RF",
"studyStatusList": [],
"studysetId": "73HRs8HaJbR8"
},
"metaAnalysisMetadata": {
"canEditMetaAnalyses": true
}
},
"public": false,
"updated_at": "2023-11-02T19:42:04.265234+00:00",
"user": "github|26612023",
"username": "Nicholas Lee"
}
Loading

0 comments on commit cd943a0

Please sign in to comment.