Skip to content

Commit 2b3ed14

Browse files
authored
Merge pull request #3258 from OpenNeuroOrg/user-resolver-find-by-orcid
update resolver to query user by orcid or id
2 parents 042ce9c + becde43 commit 2b3ed14

29 files changed

+714
-642
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ GOOGLE_CLIENT_SECRET=
3333

3434
[podman-compose](https://github.com/containers/podman-compose) is used to run a local copy of all required services together.
3535

36-
#### macOS Development Setup
36+
#### macOS Development Setup
37+
3738
If you're working on macOS and encounter issues with file watching in Vite, use the following environment variables (in config.env):
3839

3940
```

deno.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"dist",
1111
"packages/**/dist",
1212
"services/datalad/tests/.pytest_cache",
13-
"**/__pycache/**"
13+
"**/__pycache/**",
14+
"**/*.scss"
1415
]
1516
}
1617
}
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
scss_files: 'src/sass/**/*.scss'
1+
scss_files: "src/sass/**/*.scss"
22

33
exclude:
4-
- 'src/sass/animate/**'
5-
- 'src/sass/bootstrap/**'
6-
- 'src/sass/font-awesome/**'
7-
- 'src/sass/fonts/**'
8-
- 'src/sass/_bootstrap-compass.scss'
9-
- 'src/sass/_bootstrap-mincer.scss'
10-
- 'src/sass/_bootstrap-sprockets.scss'
11-
- 'src/sass/_bootstrap.scss'
12-
- 'src/sass/react-select.scss'
4+
- "src/sass/animate/**"
5+
- "src/sass/bootstrap/**"
6+
- "src/sass/font-awesome/**"
7+
- "src/sass/fonts/**"
8+
- "src/sass/_bootstrap-compass.scss"
9+
- "src/sass/_bootstrap-mincer.scss"
10+
- "src/sass/_bootstrap-sprockets.scss"
11+
- "src/sass/_bootstrap.scss"
12+
- "src/sass/react-select.scss"
1313

1414
linters:
1515
BorderZero:
@@ -26,4 +26,4 @@ linters:
2626
enabled: false
2727

2828
NestingDepth:
29-
enabled: false
29+
enabled: false

packages/openneuro-app/maintenance.html

Lines changed: 28 additions & 20 deletions
Large diffs are not rendered by default.

packages/openneuro-app/src/@types/custom.d.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ declare module "*.svg" {
1111
export = value
1212
}
1313

14-
15-
1614
// Allow custom scss modules
1715
declare module "*.module.scss" {
18-
const classes: { [key: string]: string };
19-
export default classes;
16+
const classes: { [key: string]: string }
17+
export default classes
2018
}
2119

2220
// Allow .scss imports
Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
<!DOCTYPE html>
22
<html>
3-
4-
<head>
3+
<head>
54
<script src="/crn/config.js" type="module"></script>
65
<script async src="https://www.googletagmanager.com/gtag/js"></script>
7-
<script src="https://kit.fontawesome.com/fa7ae96ba1.js" crossorigin="anonymous"></script>
6+
<script
7+
src="https://kit.fontawesome.com/fa7ae96ba1.js"
8+
crossorigin="anonymous"
9+
></script>
810
<meta http-equiv="expires" content="0" />
911
<meta charset="utf-8" />
1012
<meta name="viewport" content="width=device-width, initial-scale=1" />
1113
<title>OpenNeuro</title>
1214
<link id="favicon" rel="icon" type="image/png" href="/favicon.ico" />
13-
<link rel="preconnect" href="https://fonts.googleapis.com">
14-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
15-
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap" rel="stylesheet">
16-
</head>
15+
<link rel="preconnect" href="https://fonts.googleapis.com" />
16+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
17+
<link
18+
href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap"
19+
rel="stylesheet"
20+
/>
21+
</head>
1722

18-
<body>
23+
<body>
1924
<div id="main"></div>
2025
<script src="/client.jsx" type="module"></script>
21-
</body>
22-
26+
</body>
2327
</html>

packages/openneuro-app/src/scripts/dataset/mutations/__tests__/update-permissions.spec.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
UpdateDatasetPermissions,
88
} from "../update-permissions"
99

10-
import { isValidOrcid } from "../../../utils/validationUtils.ts";
10+
import { isValidOrcid } from "../../../utils/validationUtils.ts"
1111

1212
function permissionMocksFactory(
1313
updatePermissionsCalled,

packages/openneuro-app/src/scripts/dataset/mutations/update-permissions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import ToastContent from "../../common/partials/toast-content"
77
import { validate as isValidEmail } from "email-validator"
88
import { Button } from "@openneuro/components/button"
99

10-
import { isValidOrcid } from "../../utils/validationUtils";
10+
import { isValidOrcid } from "../../utils/validationUtils"
1111

1212
export const UPDATE_PERMISSIONS = gql`
1313
mutation updatePermissions(

packages/openneuro-app/src/scripts/routes.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import { Navigate, Route, Routes } from "react-router-dom"
55
import DatasetQuery from "./dataset/dataset-query"
66
//import PreRefactorDatasetProps from './dataset/dataset-pre-refactor-container'
77

8-
9-
108
import FaqPage from "./pages/faq/faq"
119
import FrontPageContainer from "./pages/front-page/front-page"
1210
import Admin from "./pages/admin/admin"
Lines changed: 65 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,78 @@
1-
import React from 'react';
2-
import { render, screen, fireEvent, within, waitFor} from '@testing-library/react';
3-
import { UserAccountView } from '../user-account-view';
1+
import React from "react"
2+
import {
3+
fireEvent,
4+
render,
5+
screen,
6+
waitFor,
7+
within,
8+
} from "@testing-library/react"
9+
import { UserAccountView } from "../user-account-view"
410

511
const baseUser = {
6-
name: "John Doe",
7-
8-
orcid: "0000-0001-2345-6789",
9-
location: "San Francisco, CA",
10-
institution: "University of California",
11-
links: ["https://example.com", "https://example.org"],
12-
github: "johndoe",
13-
};
12+
name: "John Doe",
13+
14+
orcid: "0000-0001-2345-6789",
15+
location: "San Francisco, CA",
16+
institution: "University of California",
17+
links: ["https://example.com", "https://example.org"],
18+
github: "johndoe",
19+
}
1420

15-
describe('<UserAccountView />', () => {
16-
it('should render the user details correctly', () => {
17-
render(<UserAccountView user={baseUser} />);
21+
describe("<UserAccountView />", () => {
22+
it("should render the user details correctly", () => {
23+
render(<UserAccountView user={baseUser} />)
1824

1925
// Check if user details are rendered
20-
expect(screen.getByText('Name:')).toBeInTheDocument();
21-
expect(screen.getByText('John Doe')).toBeInTheDocument();
22-
expect(screen.getByText('Email:')).toBeInTheDocument();
23-
expect(screen.getByText('[email protected]')).toBeInTheDocument();
24-
expect(screen.getByText('ORCID:')).toBeInTheDocument();
25-
expect(screen.getByText('0000-0001-2345-6789')).toBeInTheDocument();
26-
expect(screen.getByText('johndoe')).toBeInTheDocument();
27-
});
26+
expect(screen.getByText("Name:")).toBeInTheDocument()
27+
expect(screen.getByText("John Doe")).toBeInTheDocument()
28+
expect(screen.getByText("Email:")).toBeInTheDocument()
29+
expect(screen.getByText("[email protected]")).toBeInTheDocument()
30+
expect(screen.getByText("ORCID:")).toBeInTheDocument()
31+
expect(screen.getByText("0000-0001-2345-6789")).toBeInTheDocument()
32+
expect(screen.getByText("johndoe")).toBeInTheDocument()
33+
})
2834

29-
it('should render links with EditableContent', async () => {
30-
render(<UserAccountView user={baseUser} />);
31-
const institutionSection = within(screen.getByText('Institution').closest('.user-meta-block'));
32-
expect(screen.getByText('Institution')).toBeInTheDocument();
33-
const editButton = institutionSection.getByText('Edit');
34-
fireEvent.click(editButton);
35-
const textbox = institutionSection.getByRole('textbox');
36-
fireEvent.change(textbox, { target: { value: 'New University' } });
37-
const saveButton = institutionSection.getByText('Save');
38-
const closeButton = institutionSection.getByText('Close');
39-
fireEvent.click(saveButton);
40-
fireEvent.click(closeButton);
35+
it("should render links with EditableContent", async () => {
36+
render(<UserAccountView user={baseUser} />)
37+
const institutionSection = within(
38+
screen.getByText("Institution").closest(".user-meta-block"),
39+
)
40+
expect(screen.getByText("Institution")).toBeInTheDocument()
41+
const editButton = institutionSection.getByText("Edit")
42+
fireEvent.click(editButton)
43+
const textbox = institutionSection.getByRole("textbox")
44+
fireEvent.change(textbox, { target: { value: "New University" } })
45+
const saveButton = institutionSection.getByText("Save")
46+
const closeButton = institutionSection.getByText("Close")
47+
fireEvent.click(saveButton)
48+
fireEvent.click(closeButton)
4149
// Add debug step
42-
await waitFor(() => screen.debug());
50+
await waitFor(() => screen.debug())
4351
// Use a flexible matcher to check for text
4452
await waitFor(() =>
45-
expect(institutionSection.getByText('New University')).toBeInTheDocument()
46-
);
47-
});
48-
53+
expect(institutionSection.getByText("New University")).toBeInTheDocument()
54+
)
55+
})
4956

50-
it('should render location with EditableContent', async () => {
51-
render(<UserAccountView user={baseUser} />);
52-
const locationSection = within(screen.getByText('Location').closest('.user-meta-block'));
53-
expect(screen.getByText('Location')).toBeInTheDocument();
54-
const editButton = locationSection.getByText('Edit');
55-
fireEvent.click(editButton);
56-
const textbox = locationSection.getByRole('textbox');
57-
fireEvent.change(textbox, { target: { value: 'Marin, CA' } });
58-
const saveButton = locationSection.getByText('Save');
59-
const closeButton = locationSection.getByText('Close');
60-
fireEvent.click(saveButton);
61-
fireEvent.click(closeButton);
57+
it("should render location with EditableContent", async () => {
58+
render(<UserAccountView user={baseUser} />)
59+
const locationSection = within(
60+
screen.getByText("Location").closest(".user-meta-block"),
61+
)
62+
expect(screen.getByText("Location")).toBeInTheDocument()
63+
const editButton = locationSection.getByText("Edit")
64+
fireEvent.click(editButton)
65+
const textbox = locationSection.getByRole("textbox")
66+
fireEvent.change(textbox, { target: { value: "Marin, CA" } })
67+
const saveButton = locationSection.getByText("Save")
68+
const closeButton = locationSection.getByText("Close")
69+
fireEvent.click(saveButton)
70+
fireEvent.click(closeButton)
6271
// Add debug step
63-
await waitFor(() => screen.debug());
72+
await waitFor(() => screen.debug())
6473
// Use a flexible matcher to check for text
6574
await waitFor(() =>
66-
expect(locationSection.getByText('Marin, CA')).toBeInTheDocument()
67-
);
68-
});
69-
});
75+
expect(locationSection.getByText("Marin, CA")).toBeInTheDocument()
76+
)
77+
})
78+
})

0 commit comments

Comments
 (0)