@openneuro/app 4.30.2 → 4.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/assets/activity-icon.png +0 -0
- package/src/assets/icon-archived.png +0 -0
- package/src/assets/icon-saved.png +0 -0
- package/src/assets/icon-unread.png +0 -0
- package/src/client.jsx +1 -1
- package/src/scripts/datalad/dataset/dataset-query-fragments.js +4 -14
- package/src/scripts/dataset/__tests__/__snapshots__/snapshot-container.spec.tsx.snap +4 -304
- package/src/scripts/dataset/components/ValidationBlock.tsx +13 -15
- package/src/scripts/dataset/components/__tests__/ValidationBlock.spec.tsx +2 -0
- package/src/scripts/dataset/draft-container.tsx +2 -1
- package/src/scripts/dataset/files/__tests__/__snapshots__/file-tree.spec.jsx.snap +1 -9
- package/src/scripts/dataset/fragments/__tests__/{dataset-alert-draft.spec.tsx → dataset-alert.spec.tsx} +33 -1
- package/src/scripts/dataset/fragments/{dataset-alert-draft.tsx → dataset-alert.tsx} +30 -18
- package/src/scripts/dataset/routes/delete-page.tsx +72 -39
- package/src/scripts/dataset/routes/snapshot.tsx +23 -17
- package/src/scripts/dataset/routes/tab-routes-draft.tsx +5 -2
- package/src/scripts/dataset/snapshot-container.tsx +11 -0
- package/src/scripts/search/__tests__/search-params-ctx.spec.tsx +3 -0
- package/src/scripts/search/initial-search-params.tsx +2 -0
- package/src/scripts/search/inputs/__tests__/nihselect.spec.tsx +36 -0
- package/src/scripts/search/inputs/index.ts +2 -0
- package/src/scripts/search/inputs/nih-select.tsx +63 -0
- package/src/scripts/search/search-container.tsx +20 -12
- package/src/scripts/search/search-params-ctx.tsx +2 -0
- package/src/scripts/search/search-routes.tsx +14 -6
- package/src/scripts/search/use-search-results.tsx +15 -0
- package/src/scripts/types/user-types.ts +72 -0
- package/src/scripts/uploader/upload-issues.tsx +2 -2
- package/src/scripts/users/__tests__/datasest-card.spec.tsx +201 -0
- package/src/scripts/users/__tests__/user-card.spec.tsx +30 -3
- package/src/scripts/users/__tests__/user-query.spec.tsx +6 -0
- package/src/scripts/users/__tests__/user-routes.spec.tsx +42 -18
- package/src/scripts/users/components/user-dataset-filters.tsx +157 -0
- package/src/scripts/users/dataset-card.tsx +121 -0
- package/src/scripts/users/fragments/query.js +42 -0
- package/src/scripts/users/scss/datasetcard.module.scss +153 -0
- package/src/scripts/users/scss/usernotifications.module.scss +159 -0
- package/src/scripts/users/user-account-view.tsx +1 -12
- package/src/scripts/users/user-card.tsx +1 -14
- package/src/scripts/users/user-container.tsx +1 -17
- package/src/scripts/users/user-datasets-view.tsx +58 -43
- package/src/scripts/users/user-notification-accordion.tsx +160 -0
- package/src/scripts/users/user-notification-list.tsx +27 -0
- package/src/scripts/users/user-notifications-tab-content.tsx +85 -0
- package/src/scripts/users/user-notifications-view.tsx +102 -4
- package/src/scripts/users/user-query.tsx +6 -14
- package/src/scripts/users/user-routes.tsx +18 -19
- package/src/scripts/utils/__tests__/user-datasets.spec.tsx +86 -0
- package/src/scripts/utils/gtag.js +3 -2
- package/src/scripts/utils/user-datasets.tsx +60 -0
- package/src/scripts/validation/__tests__/__snapshots__/validation-issues.spec.tsx.snap +1 -122
- package/src/scripts/validation/validation-results-query.ts +44 -0
- package/src/scripts/validation/validation-results.tsx +31 -7
- package/src/scripts/validation/validation.tsx +58 -49
- package/src/scripts/workers/schema.worker.ts +2 -7
- package/tsconfig.json +1 -2
- package/vite.config.js +1 -0
|
@@ -2,8 +2,10 @@ import React from "react"
|
|
|
2
2
|
import { AccordionTab, AccordionWrap } from "@openneuro/components/accordion"
|
|
3
3
|
import { Issues } from "./validation-issues"
|
|
4
4
|
import { RadioGroup } from "@openneuro/components/radio"
|
|
5
|
-
import
|
|
5
|
+
import { Loading } from "@openneuro/components/loading"
|
|
6
6
|
import styled from "@emotion/styled"
|
|
7
|
+
import type { DatasetIssues } from "@bids/validator/issues"
|
|
8
|
+
import { useValidationResults } from "./validation-results-query"
|
|
7
9
|
|
|
8
10
|
const RadioSpan = styled.span`
|
|
9
11
|
display: flex;
|
|
@@ -18,16 +20,18 @@ const RadioSpan = styled.span`
|
|
|
18
20
|
`
|
|
19
21
|
|
|
20
22
|
interface ValidationResultsProps {
|
|
21
|
-
|
|
23
|
+
datasetId: string
|
|
24
|
+
version: string
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
type ValidationGroupBy = "code" | "location"
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
interface ValidationResultsDisplayProps {
|
|
30
|
+
issues: DatasetIssues
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function ValidationResultsDisplay(
|
|
34
|
+
{ issues }: ValidationResultsDisplayProps,
|
|
31
35
|
) {
|
|
32
36
|
const [groupBy, setGroupBy] = React.useState<ValidationGroupBy>("code")
|
|
33
37
|
const groupedIssues = issues.groupBy("severity")
|
|
@@ -93,4 +97,24 @@ export function ValidationResults(
|
|
|
93
97
|
)
|
|
94
98
|
}
|
|
95
99
|
|
|
100
|
+
/**
|
|
101
|
+
* Display ValidationResults with collapsing panels
|
|
102
|
+
*/
|
|
103
|
+
export function ValidationResults(
|
|
104
|
+
{ datasetId, version }: ValidationResultsProps,
|
|
105
|
+
) {
|
|
106
|
+
const { issues, loading } = useValidationResults(datasetId, version)
|
|
107
|
+
|
|
108
|
+
if (loading) {
|
|
109
|
+
return (
|
|
110
|
+
<>
|
|
111
|
+
<Loading />
|
|
112
|
+
<span className="message">Loading validation results...</span>
|
|
113
|
+
</>
|
|
114
|
+
)
|
|
115
|
+
} else {
|
|
116
|
+
return <ValidationResultsDisplay issues={issues} />
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
96
120
|
export default ValidationResults
|
|
@@ -2,12 +2,6 @@ import React from "react"
|
|
|
2
2
|
import pluralize from "pluralize"
|
|
3
3
|
import { ValidationPanel } from "./validation-panel"
|
|
4
4
|
import Results from "./validation-results"
|
|
5
|
-
import type { DatasetIssues } from "@bids/validator/issues"
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* These can't be React components due to legacy react-bootstrap
|
|
9
|
-
* validHeader, warningHeader, errorHeader
|
|
10
|
-
*/
|
|
11
5
|
|
|
12
6
|
const validHeader = () => (
|
|
13
7
|
<div className="super-valid">
|
|
@@ -53,79 +47,94 @@ const Valid = () => (
|
|
|
53
47
|
)
|
|
54
48
|
|
|
55
49
|
interface WarningsProps {
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
datasetId: string
|
|
51
|
+
version: string
|
|
52
|
+
warnings: number
|
|
58
53
|
}
|
|
59
54
|
|
|
60
|
-
const Warnings = ({
|
|
61
|
-
<ValidationPanel heading={warningHeader(warnings
|
|
55
|
+
const Warnings = ({ datasetId, version, warnings }: WarningsProps) => (
|
|
56
|
+
<ValidationPanel heading={warningHeader(warnings)}>
|
|
62
57
|
<div>
|
|
63
58
|
<span className="message error fade-in">
|
|
64
59
|
We found{" "}
|
|
65
60
|
<strong>
|
|
66
|
-
{warnings
|
|
61
|
+
{warnings + " " + pluralize("warning", warnings)}
|
|
67
62
|
</strong>{" "}
|
|
68
63
|
in your dataset. You are not required to fix warnings, but doing so will
|
|
69
64
|
make your dataset more BIDS compliant.
|
|
70
65
|
</span>
|
|
71
66
|
</div>
|
|
72
67
|
<br />
|
|
73
|
-
<Results
|
|
68
|
+
<Results datasetId={datasetId} version={version} />
|
|
74
69
|
</ValidationPanel>
|
|
75
70
|
)
|
|
76
71
|
|
|
77
72
|
interface ErrorsProps {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
73
|
+
datasetId: string
|
|
74
|
+
version: string
|
|
75
|
+
errors: number
|
|
76
|
+
warnings: number
|
|
81
77
|
}
|
|
82
78
|
|
|
83
|
-
const Errors = ({
|
|
84
|
-
<ValidationPanel heading={errorHeader(errors
|
|
79
|
+
const Errors = ({ datasetId, version, errors }: ErrorsProps) => (
|
|
80
|
+
<ValidationPanel heading={errorHeader(errors)}>
|
|
85
81
|
<span className="message error fade-in">
|
|
86
82
|
Your dataset is no longer valid. You must fix the{" "}
|
|
87
|
-
<strong>{errors
|
|
88
|
-
{" "}
|
|
83
|
+
<strong>{errors + " " + pluralize("error", errors)}</strong>{" "}
|
|
89
84
|
to use all of the site features.
|
|
90
85
|
</span>
|
|
91
86
|
<br />
|
|
92
|
-
<Results
|
|
87
|
+
<Results datasetId={datasetId} version={version} />
|
|
93
88
|
</ValidationPanel>
|
|
94
89
|
)
|
|
95
90
|
|
|
96
91
|
interface ValidationProps {
|
|
97
|
-
|
|
92
|
+
datasetId: string
|
|
93
|
+
version?: string
|
|
94
|
+
errors: number
|
|
95
|
+
warnings: number
|
|
98
96
|
}
|
|
99
97
|
|
|
100
|
-
export const Validation = (
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
} else {
|
|
98
|
+
export const Validation = (
|
|
99
|
+
{ datasetId, version, errors, warnings }: ValidationProps,
|
|
100
|
+
) => {
|
|
101
|
+
if (errors > 0) {
|
|
102
|
+
return (
|
|
103
|
+
<Errors
|
|
104
|
+
datasetId={datasetId}
|
|
105
|
+
version={version}
|
|
106
|
+
errors={errors}
|
|
107
|
+
warnings={warnings}
|
|
108
|
+
/>
|
|
109
|
+
)
|
|
110
|
+
} else if (warnings > 0) {
|
|
113
111
|
return (
|
|
114
|
-
<
|
|
115
|
-
heading={
|
|
116
|
-
<div>
|
|
117
|
-
<span className="dataset-status ds-warning ds-validation-pending">
|
|
118
|
-
<i className="fa fa-circle-o-notch fa-spin" />
|
|
119
|
-
Validation Pending
|
|
120
|
-
</span>
|
|
121
|
-
</div>
|
|
122
|
-
}
|
|
123
|
-
>
|
|
124
|
-
<br />
|
|
125
|
-
<p className="ds-validation-pending-message">
|
|
126
|
-
The BIDS validator is running. This may take several minutes.
|
|
127
|
-
</p>
|
|
128
|
-
</ValidationPanel>
|
|
112
|
+
<Warnings datasetId={datasetId} version={version} warnings={warnings} />
|
|
129
113
|
)
|
|
114
|
+
} else {
|
|
115
|
+
return <Valid />
|
|
130
116
|
}
|
|
131
117
|
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Display validation as pending
|
|
121
|
+
*/
|
|
122
|
+
export function ValidationPending() {
|
|
123
|
+
return (
|
|
124
|
+
<ValidationPanel
|
|
125
|
+
heading={
|
|
126
|
+
<div>
|
|
127
|
+
<span className="dataset-status ds-warning ds-validation-pending">
|
|
128
|
+
<i className="fa fa-circle-o-notch fa-spin" />
|
|
129
|
+
Validation Pending
|
|
130
|
+
</span>
|
|
131
|
+
</div>
|
|
132
|
+
}
|
|
133
|
+
>
|
|
134
|
+
<br />
|
|
135
|
+
<p className="ds-validation-pending-message">
|
|
136
|
+
The BIDS validator is running. This may take several minutes.
|
|
137
|
+
</p>
|
|
138
|
+
</ValidationPanel>
|
|
139
|
+
)
|
|
140
|
+
}
|
|
@@ -2,14 +2,9 @@
|
|
|
2
2
|
import { fileListToTree, validate } from "@bids/validator/main"
|
|
3
3
|
import type { ValidationResult } from "@bids/validator/main"
|
|
4
4
|
import type { Config, ValidatorOptions } from "@bids/validator/options"
|
|
5
|
+
import validatorConfig from "./validator-config.json"
|
|
5
6
|
|
|
6
|
-
const config: Config =
|
|
7
|
-
error: [
|
|
8
|
-
{ code: "NO_AUTHORS" },
|
|
9
|
-
{ code: "SUBJECT_FOLDERS" }, // bids-standard/bids-specification#1928 downgrades to warning
|
|
10
|
-
{ code: "EMPTY_DATASET_NAME" },
|
|
11
|
-
],
|
|
12
|
-
}
|
|
7
|
+
const config: Config = validatorConfig
|
|
13
8
|
|
|
14
9
|
const options: ValidatorOptions = {
|
|
15
10
|
datasetPath: "browser",
|
package/tsconfig.json
CHANGED
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
"tsBuildInfoFile": "../../.build-cache/app.tsbuildinfo"
|
|
7
7
|
},
|
|
8
8
|
"include": ["./src"],
|
|
9
|
-
"files": ["./src/lerna.json"],
|
|
9
|
+
"files": ["./src/lerna.json", "./src/scripts/workers/validator-config.json"],
|
|
10
10
|
"references": [
|
|
11
|
-
{ "path": "../openneuro-client" },
|
|
12
11
|
{ "path": "../openneuro-components" }
|
|
13
12
|
]
|
|
14
13
|
}
|