Skip to content

Commit 48c6517

Browse files
authored
enh: text changes and popup behavior change (#1099)
1 parent 1e3ef6c commit 48c6517

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('ImportStudiesDialog', () => {
2222
cy.url().should('include', '/projects/abc123/curation/import');
2323
});
2424

25-
describe('Import via Neurostore', () => {
25+
describe('Search Neurostore', () => {
2626
beforeEach(() => {
2727
cy.login('mocked').visit('/projects/abc123/curation');
2828
cy.intercept('GET', '**/api/base-studies/**', {

compose/neurosynth-frontend/src/components/InfoPopup.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,27 @@ import { Box, Button, Checkbox, FormControlLabel, Link, Typography } from '@mui/
33
import { useState } from 'react';
44
import BaseDialog from './Dialogs/BaseDialog';
55

6+
// We are saving this as a global variable so that the state is reset every time the page is reloaded
7+
let userHasSeenPopupThisSession = false;
8+
69
const InfoPopup: React.FC = () => {
710
const { user } = useAuth0();
811
const localStorageKey = `${user?.sub || ''}-hide-info-popup`;
9-
const shouldHide = !!localStorage.getItem(localStorageKey);
12+
const shouldHide = !!localStorage.getItem(localStorageKey) || userHasSeenPopupThisSession;
1013
const [hide, setShouldHide] = useState(shouldHide);
1114

1215
const [checked, setIsChecked] = useState(false);
1316

1417
const handleCloseDialog = () => {
18+
userHasSeenPopupThisSession = true;
19+
setShouldHide(true);
20+
};
21+
22+
const handleClose = () => {
1523
if (checked) {
1624
window.localStorage.setItem(localStorageKey, 'true');
1725
}
18-
setShouldHide(true);
26+
handleCloseDialog();
1927
};
2028

2129
return (
@@ -63,7 +71,7 @@ const InfoPopup: React.FC = () => {
6371
/>
6472
</Box>
6573
<Box sx={{ display: 'flex', justifyContent: 'space-between' }}>
66-
<Button fullWidth onClick={handleCloseDialog} variant="contained" color="primary" disableElevation>
74+
<Button fullWidth onClick={handleClose} variant="contained" color="primary" disableElevation>
6775
Continue
6876
</Button>
6977
</Box>

compose/neurosynth-frontend/src/pages/CurationImport/components/CurationImportSelectMethod.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ const CurationImportSelectMethod: React.FC<{
2929
value={EImportMode.NEUROSTORE_IMPORT}
3030
label={
3131
<>
32-
<Typography variant="h6">Import via Neurostore</Typography>
32+
<Typography variant="h6">Search Neurostore</Typography>
3333
<Typography variant="body1" sx={{ color: 'muted.main' }}>
34-
Use our database full of automatically extracted coordinates
34+
Search our database of over 30,000 neuroimaging studies with automatically extracted
35+
coordinates
3536
</Typography>
3637
</>
3738
}

0 commit comments

Comments
 (0)