@openneuro/app 4.29.8 → 4.30.0-alpha.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.
Files changed (36) hide show
  1. package/.scss-lint.yml +11 -11
  2. package/maintenance.html +26 -20
  3. package/package.json +3 -3
  4. package/src/@types/custom.d.ts +6 -0
  5. package/src/index.html +14 -10
  6. package/src/scripts/datalad/routes/dataset-redirect.tsx +2 -0
  7. package/src/scripts/dataset/mutations/__tests__/update-permissions.spec.jsx +2 -1
  8. package/src/scripts/dataset/mutations/update-permissions.tsx +1 -9
  9. package/src/scripts/routes.tsx +17 -0
  10. package/src/scripts/users/__tests__/user-account-view.spec.tsx +152 -0
  11. package/src/scripts/users/__tests__/user-card.spec.tsx +110 -0
  12. package/src/scripts/users/__tests__/user-query.spec.tsx +65 -0
  13. package/src/scripts/users/__tests__/user-routes.spec.tsx +102 -0
  14. package/src/scripts/users/__tests__/user-tabs.spec.tsx +84 -0
  15. package/src/scripts/users/components/close-button.tsx +20 -0
  16. package/src/scripts/users/components/edit-button.tsx +20 -0
  17. package/src/scripts/users/components/edit-list.tsx +103 -0
  18. package/src/scripts/users/components/edit-string.tsx +90 -0
  19. package/src/scripts/users/components/editable-content.tsx +98 -0
  20. package/src/scripts/users/scss/editable-content.scss +15 -0
  21. package/src/scripts/users/scss/user-meta-blocks.scss +14 -0
  22. package/src/scripts/users/scss/useraccountview.module.scss +20 -0
  23. package/src/scripts/users/scss/usercard.module.scss +24 -0
  24. package/src/scripts/users/scss/usercontainer.module.scss +38 -0
  25. package/src/scripts/users/scss/usertabs.module.scss +63 -0
  26. package/src/scripts/users/user-account-view.tsx +142 -0
  27. package/src/scripts/users/user-card.tsx +86 -0
  28. package/src/scripts/users/user-container.tsx +49 -0
  29. package/src/scripts/users/user-datasets-view.tsx +53 -0
  30. package/src/scripts/users/user-notifications-view.tsx +11 -0
  31. package/src/scripts/users/user-query.tsx +76 -0
  32. package/src/scripts/users/user-routes.tsx +52 -0
  33. package/src/scripts/users/user-tabs.tsx +74 -0
  34. package/src/scripts/utils/__tests__/markdown.spec.tsx +1 -2
  35. package/src/scripts/utils/validationUtils.ts +8 -0
  36. package/src/scripts/validation/validation.tsx +11 -8
@@ -31,12 +31,12 @@ const warningHeader = (count) => (
31
31
  </div>
32
32
  )
33
33
 
34
- const errorHeader = (count) => (
34
+ const errorHeader = (errorCount) => (
35
35
  <div>
36
36
  <h3 className="metaheader">BIDS Validation</h3>
37
37
 
38
38
  <span className="label text-warning pull-right">
39
- {count} {pluralize("Error", count)}
39
+ {errorCount} {pluralize("Error", errorCount)}
40
40
  </span>
41
41
  <span className="dataset-status ds-danger">
42
42
  <i className="fa fa-exclamation-circle" /> Invalid
@@ -53,10 +53,11 @@ const Valid = () => (
53
53
  )
54
54
 
55
55
  interface WarningsProps {
56
+ issues: DatasetIssues
56
57
  warnings: DatasetIssues
57
58
  }
58
59
 
59
- const Warnings = ({ warnings }: WarningsProps) => (
60
+ const Warnings = ({ issues, warnings }: WarningsProps) => (
60
61
  <ValidationPanel heading={warningHeader(warnings.size)}>
61
62
  <div>
62
63
  <span className="message error fade-in">
@@ -69,15 +70,17 @@ const Warnings = ({ warnings }: WarningsProps) => (
69
70
  </span>
70
71
  </div>
71
72
  <br />
72
- <Results issues={warnings} />
73
+ <Results issues={issues} />
73
74
  </ValidationPanel>
74
75
  )
75
76
 
76
77
  interface ErrorsProps {
78
+ issues: DatasetIssues
77
79
  errors: DatasetIssues
80
+ warnings: DatasetIssues
78
81
  }
79
82
 
80
- const Errors = ({ errors }: ErrorsProps) => (
83
+ const Errors = ({ issues, errors }: ErrorsProps) => (
81
84
  <ValidationPanel heading={errorHeader(errors.size)}>
82
85
  <span className="message error fade-in">
83
86
  Your dataset is no longer valid. You must fix the{" "}
@@ -86,7 +89,7 @@ const Errors = ({ errors }: ErrorsProps) => (
86
89
  to use all of the site features.
87
90
  </span>
88
91
  <br />
89
- <Results issues={errors} />
92
+ <Results issues={issues} />
90
93
  </ValidationPanel>
91
94
  )
92
95
 
@@ -100,9 +103,9 @@ export const Validation = ({ issues }: ValidationProps) => {
100
103
  const warnings = grouped.get("warning")
101
104
  const errors = grouped.get("error")
102
105
  if (errors?.size) {
103
- return <Errors errors={issues} />
106
+ return <Errors issues={issues} errors={errors} warnings={warnings} />
104
107
  } else if (warnings?.size) {
105
- return <Warnings warnings={issues} />
108
+ return <Warnings issues={issues} warnings={warnings} />
106
109
  } else {
107
110
  return <Valid />
108
111
  }