@openneuro/app 4.4.10 → 4.6.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 (288) hide show
  1. package/package.json +5 -5
  2. package/src/scripts/app.tsx +1 -1
  3. package/src/scripts/{refactor_2021/authentication → authentication}/__tests__/profile.spec.js +0 -0
  4. package/src/scripts/{refactor_2021/authentication → authentication}/admin-user.jsx +0 -0
  5. package/src/scripts/{refactor_2021/authentication → authentication}/logged-in.jsx +0 -0
  6. package/src/scripts/{refactor_2021/authentication → authentication}/logged-out.jsx +0 -0
  7. package/src/scripts/{refactor_2021/authentication → authentication}/loginCheck.js +0 -0
  8. package/src/scripts/{refactor_2021/authentication → authentication}/loginUrls.ts +1 -1
  9. package/src/scripts/{refactor_2021/authentication → authentication}/profile.js +0 -0
  10. package/src/scripts/{refactor_2021/authentication → authentication}/signOut.ts +0 -0
  11. package/src/scripts/{refactor_2021/authentication → authentication}/withProfile.jsx +0 -0
  12. package/src/scripts/{refactor_2021/common → common}/block-navigation.jsx +0 -0
  13. package/src/scripts/{refactor_2021 → common}/containers/footer.tsx +0 -0
  14. package/src/scripts/{refactor_2021 → common}/containers/header.tsx +17 -15
  15. package/src/scripts/{datalad/fragments → common/partials}/freshdesk-widget.jsx +1 -1
  16. package/src/scripts/datalad/dataset/dataset-query-fragments.js +2 -0
  17. package/src/scripts/{refactor_2021/dataset → dataset}/comments/__tests__/__snapshots__/comment.spec.jsx.snap +0 -0
  18. package/src/scripts/{refactor_2021/dataset → dataset}/comments/__tests__/__snapshots__/comments.spec.jsx.snap +0 -0
  19. package/src/scripts/{refactor_2021/dataset → dataset}/comments/__tests__/comment.spec.jsx +0 -0
  20. package/src/scripts/{refactor_2021/dataset → dataset}/comments/__tests__/comments.spec.jsx +0 -0
  21. package/src/scripts/{refactor_2021/dataset → dataset}/comments/block-style-controls.jsx +0 -0
  22. package/src/scripts/{refactor_2021/dataset → dataset}/comments/comment-editor.jsx +0 -0
  23. package/src/scripts/{refactor_2021/dataset → dataset}/comments/comment.jsx +0 -0
  24. package/src/scripts/{refactor_2021/dataset → dataset}/comments/comments.jsx +1 -1
  25. package/src/scripts/{refactor_2021/dataset → dataset}/comments/inline-style-controls.jsx +0 -0
  26. package/src/scripts/{refactor_2021/dataset → dataset}/comments/style-button.jsx +0 -0
  27. package/src/scripts/{refactor_2021/dataset → dataset}/dataset-query-context.js +0 -0
  28. package/src/scripts/{refactor_2021/dataset → dataset}/dataset-query.jsx +15 -15
  29. package/src/scripts/dataset/dataset-routes.jsx +39 -0
  30. package/src/scripts/{refactor_2021/dataset → dataset}/download/__tests__/__snapshots__/download-command-line.spec.jsx.snap +0 -0
  31. package/src/scripts/{refactor_2021/dataset → dataset}/download/__tests__/__snapshots__/download-link.spec.jsx.snap +0 -0
  32. package/src/scripts/{refactor_2021/dataset → dataset}/download/__tests__/__snapshots__/shell-example.spec.jsx.snap +0 -0
  33. package/src/scripts/{refactor_2021/dataset → dataset}/download/__tests__/download-command-line.spec.jsx +0 -0
  34. package/src/scripts/{refactor_2021/dataset → dataset}/download/__tests__/download-link.spec.jsx +0 -0
  35. package/src/scripts/{refactor_2021/dataset → dataset}/download/__tests__/download-native.spec.js +0 -0
  36. package/src/scripts/{refactor_2021/dataset → dataset}/download/__tests__/shell-example.spec.jsx +0 -0
  37. package/src/scripts/{refactor_2021/dataset → dataset}/download/download-command-line.jsx +0 -0
  38. package/src/scripts/{refactor_2021/dataset → dataset}/download/download-datalad.jsx +1 -1
  39. package/src/scripts/{refactor_2021/dataset → dataset}/download/download-link.jsx +0 -0
  40. package/src/scripts/{refactor_2021/dataset → dataset}/download/download-native.js +1 -1
  41. package/src/scripts/{refactor_2021/dataset → dataset}/download/download-query.js +0 -0
  42. package/src/scripts/{refactor_2021/dataset → dataset}/download/download-s3.jsx +1 -1
  43. package/src/scripts/{refactor_2021/dataset → dataset}/download/native-file-toast.jsx +0 -0
  44. package/src/scripts/{refactor_2021/dataset → dataset}/download/shell-example.jsx +0 -0
  45. package/src/scripts/{refactor_2021/dataset → dataset}/download/track-download.js +0 -0
  46. package/src/scripts/dataset/draft-container.tsx +382 -0
  47. package/src/scripts/{refactor_2021/dataset → dataset}/draft-snapshot-routes.tsx +0 -0
  48. package/src/scripts/{refactor_2021/dataset → dataset}/files/__tests__/__snapshots__/file-tree.spec.jsx.snap +0 -0
  49. package/src/scripts/{refactor_2021/dataset → dataset}/files/__tests__/__snapshots__/file.spec.jsx.snap +2 -2
  50. package/src/scripts/{refactor_2021/dataset → dataset}/files/__tests__/file-tree-loading.spec.jsx +0 -0
  51. package/src/scripts/{refactor_2021/dataset → dataset}/files/__tests__/file-tree-unloaded-directory.spec.jsx +1 -1
  52. package/src/scripts/{refactor_2021/dataset → dataset}/files/__tests__/file-tree.spec.jsx +0 -0
  53. package/src/scripts/{refactor_2021/dataset → dataset}/files/__tests__/file-viewer-type.spec.jsx +0 -0
  54. package/src/scripts/{refactor_2021/dataset → dataset}/files/__tests__/file.spec.jsx +11 -4
  55. package/src/scripts/{refactor_2021/dataset → dataset}/files/__tests__/flat-to-tree.spec.js +0 -0
  56. package/src/scripts/{refactor_2021/dataset → dataset}/files/file-display.jsx +2 -2
  57. package/src/scripts/{refactor_2021/dataset → dataset}/files/file-tree-loading.jsx +0 -0
  58. package/src/scripts/{refactor_2021/dataset → dataset}/files/file-tree-unloaded-directory.jsx +1 -1
  59. package/src/scripts/{refactor_2021/dataset → dataset}/files/file-tree.jsx +3 -2
  60. package/src/scripts/{refactor_2021/dataset → dataset}/files/file-view.jsx +1 -1
  61. package/src/scripts/{refactor_2021/dataset → dataset}/files/file-viewer-type.jsx +0 -0
  62. package/src/scripts/{refactor_2021/dataset/files/file.jsx → dataset/files/file.tsx} +30 -13
  63. package/src/scripts/{refactor_2021/dataset → dataset}/files/files.jsx +1 -1
  64. package/src/scripts/{refactor_2021/dataset → dataset}/files/flat-to-tree.js +0 -0
  65. package/src/scripts/{refactor_2021/dataset → dataset}/files/index.tsx +0 -0
  66. package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/__tests__/__snapshots__/file-viewer-json.spec.jsx.snap +0 -0
  67. package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/__tests__/file-viewer-json.spec.jsx +0 -0
  68. package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/__tests__/parse-tabular.spec.js +0 -0
  69. package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/file-viewer-csv.jsx +0 -0
  70. package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/file-viewer-html.jsx +0 -0
  71. package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/file-viewer-json.jsx +0 -0
  72. package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/file-viewer-nifti.jsx +1 -1
  73. package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/file-viewer-table.jsx +0 -0
  74. package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/file-viewer-text.jsx +0 -0
  75. package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/file-viewer-tsv.jsx +0 -0
  76. package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/parse-tabular.js +0 -0
  77. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/__snapshots__/cancel-button.spec.tsx.snap +0 -0
  78. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/__snapshots__/edit-button.spec.tsx.snap +0 -0
  79. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/__snapshots__/edit-list.spec.jsx.snap +0 -0
  80. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/__snapshots__/save-button.spec.tsx.snap +0 -0
  81. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/__snapshots__/select-input.spec.tsx.snap +0 -0
  82. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/cancel-button.spec.tsx +0 -0
  83. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/dataset-alert-draft.spec.tsx +0 -0
  84. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/dataset-citation.spec.jsx +0 -0
  85. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/doi-link.spec.tsx +38 -8
  86. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/edit-button.spec.tsx +0 -0
  87. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/edit-list.spec.jsx +0 -0
  88. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/save-button.spec.tsx +0 -0
  89. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/select-input.spec.tsx +0 -0
  90. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/cancel-button.tsx +0 -0
  91. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/comments-fragments.js +0 -0
  92. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/copyable-tooltip.jsx +0 -0
  93. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/dataset-alert-draft.tsx +0 -0
  94. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/dataset-alert-version.tsx +0 -0
  95. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/dataset-citation.jsx +2 -4
  96. package/src/scripts/dataset/fragments/dataset-history.jsx +99 -0
  97. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/dataset-reviewers.ts +1 -1
  98. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/doi-link.tsx +9 -6
  99. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/edit-button.tsx +0 -0
  100. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/edit-description-field.jsx +0 -0
  101. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/edit-description-list.jsx +0 -0
  102. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/edit-list.jsx +0 -0
  103. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/number-input.tsx +0 -0
  104. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/save-button.tsx +0 -0
  105. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/select-input.tsx +0 -0
  106. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/text-array-input.tsx +0 -0
  107. package/src/scripts/{refactor_2021/dataset → dataset}/fragments/text-input.tsx +0 -0
  108. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/__snapshots__/delete.spec.jsx.snap +0 -0
  109. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/__snapshots__/deprecate-snapshot.spec.tsx.snap +0 -0
  110. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/__snapshots__/deprecate-version.spec.tsx.snap +0 -0
  111. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/__snapshots__/description.spec.jsx.snap +0 -0
  112. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/__snapshots__/update-permissions.spec.jsx.snap +0 -0
  113. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/cache-id.spec.js +0 -0
  114. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/delete.spec.jsx +0 -0
  115. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/deprecate-snapshot.spec.tsx +0 -0
  116. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/deprecate-version.spec.tsx +0 -0
  117. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/description.spec.jsx +0 -0
  118. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/remove-permissions.spec.tsx +0 -0
  119. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/update-permissions.spec.jsx +0 -0
  120. package/src/scripts/dataset/mutations/admin-exports.jsx +70 -0
  121. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/cache-clear.jsx +0 -0
  122. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/cache-id.js +0 -0
  123. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/comment.jsx +0 -0
  124. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/create-anonymous-reviewer.tsx +0 -3
  125. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/dataset-relations.tsx +6 -18
  126. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/delete-anonymous-reviewer.tsx +0 -0
  127. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/delete-comment.jsx +2 -4
  128. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/delete-dataset-form.jsx +0 -0
  129. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/delete-dir.jsx +0 -0
  130. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/delete-file.jsx +0 -0
  131. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/delete.jsx +0 -0
  132. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/deprecate-version.tsx +0 -0
  133. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/description.jsx +1 -1
  134. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/flag-annex-object.jsx +1 -2
  135. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/follow.tsx +2 -2
  136. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/import-dataset.tsx +0 -0
  137. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/metadata-form.jsx +1 -1
  138. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/publish.jsx +0 -0
  139. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/readme.jsx +1 -1
  140. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/remove-annex-object.jsx +0 -1
  141. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/remove-permissions.tsx +0 -0
  142. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/revalidate.jsx +0 -0
  143. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/snapshot.tsx +17 -3
  144. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/star.tsx +2 -2
  145. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/submit-metadata.jsx +1 -1
  146. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/undo-deprecate-version.tsx +0 -0
  147. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/update-file.jsx +0 -0
  148. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/update-permissions.tsx +0 -0
  149. package/src/scripts/{refactor_2021/dataset → dataset}/mutations/update-ref.jsx +0 -0
  150. package/src/scripts/{refactor_2021/dataset → dataset}/routes/__tests__/__snapshots__/publish.spec.jsx.snap +0 -0
  151. package/src/scripts/{refactor_2021/dataset → dataset}/routes/__tests__/publish.spec.jsx +0 -0
  152. package/src/scripts/{refactor_2021/dataset → dataset}/routes/add-metadata.jsx +21 -25
  153. package/src/scripts/dataset/routes/admin-datalad.jsx +40 -0
  154. package/src/scripts/dataset/routes/dataset-default.tsx +54 -0
  155. package/src/scripts/{refactor_2021/dataset → dataset}/routes/delete-page.tsx +5 -9
  156. package/src/scripts/{refactor_2021/dataset → dataset}/routes/deprecate-snapshot-page.tsx +6 -7
  157. package/src/scripts/dataset/routes/download-dataset.tsx +53 -0
  158. package/src/scripts/{refactor_2021/dataset → dataset}/routes/manage-anonymous-reviewers.tsx +9 -3
  159. package/src/scripts/{refactor_2021/dataset → dataset}/routes/manage-permissions.jsx +7 -10
  160. package/src/scripts/{refactor_2021/dataset → dataset}/routes/publish.jsx +10 -12
  161. package/src/scripts/dataset/routes/snapshot-default.tsx +44 -0
  162. package/src/scripts/dataset/routes/snapshot.jsx +148 -0
  163. package/src/scripts/dataset/routes/styles/dataset-page-border.tsx +8 -0
  164. package/src/scripts/dataset/routes/styles/dataset-page-tab-container.tsx +8 -0
  165. package/src/scripts/dataset/routes/styles/draft-background.tsx +7 -0
  166. package/src/scripts/dataset/routes/styles/header-row.tsx +12 -0
  167. package/src/scripts/dataset/routes/tab-routes-draft.tsx +88 -0
  168. package/src/scripts/dataset/routes/tab-routes-snapshot.tsx +57 -0
  169. package/src/scripts/{refactor_2021/dataset → dataset}/snapshot-container.tsx +75 -122
  170. package/src/scripts/{refactor_2021 → errors}/freshdesk-widget.jsx +1 -1
  171. package/src/scripts/errors/freshdeskInterface.jsx +1 -1
  172. package/src/scripts/index.tsx +6 -6
  173. package/src/scripts/{refactor_2021 → pages}/admin/admin.jsx +1 -1
  174. package/src/scripts/{refactor_2021 → pages}/admin/flagged-files.jsx +0 -0
  175. package/src/scripts/{refactor_2021 → pages}/admin/user-fragment.ts +0 -0
  176. package/src/scripts/{refactor_2021 → pages}/admin/user-tools.tsx +1 -1
  177. package/src/scripts/{refactor_2021 → pages}/admin/users.jsx +0 -0
  178. package/src/scripts/{refactor_2021/user → pages}/api.jsx +2 -2
  179. package/src/scripts/pages/citation-page.tsx +1 -1
  180. package/src/scripts/{faq → pages/faq}/__tests__/__snapshots__/faq.spec.jsx.snap +1 -1
  181. package/src/scripts/{faq → pages/faq}/__tests__/faq.spec.jsx +0 -0
  182. package/src/scripts/{faq → pages/faq}/faq-content.js +3 -5
  183. package/src/scripts/{faq → pages/faq}/faq.jsx +1 -1
  184. package/src/scripts/{refactor_2021 → pages/front-page}/aggregate-queries/aggregate-counts-container.tsx +0 -0
  185. package/src/scripts/{refactor_2021 → pages/front-page}/aggregate-queries/use-participant-count.ts +0 -0
  186. package/src/scripts/{refactor_2021 → pages/front-page}/aggregate-queries/use-publicDatasets-count.ts +0 -0
  187. package/src/scripts/{front-page → pages/front-page}/front-page-content.ts +10 -10
  188. package/src/scripts/{refactor_2021/containers/front-page-container.tsx → pages/front-page/front-page.tsx} +53 -32
  189. package/src/scripts/pages/front-page-comp.tsx +57 -0
  190. package/src/scripts/pages/import-dataset.tsx +5 -5
  191. package/src/scripts/{pet/redirect.tsx → pages/pet-redirect.tsx} +0 -0
  192. package/src/scripts/{refactor_2021/routes.tsx → routes.tsx} +8 -8
  193. package/src/scripts/{refactor_2021/search → search}/__tests__/search-container.spec.tsx +0 -0
  194. package/src/scripts/{refactor_2021/search → search}/__tests__/search-params-ctx.spec.tsx +0 -0
  195. package/src/scripts/{refactor_2021/search → search}/es-query-builders.ts +0 -0
  196. package/src/scripts/{refactor_2021/search → search}/filters-block-container.tsx +0 -0
  197. package/src/scripts/{refactor_2021/search → search}/initial-search-params.tsx +0 -0
  198. package/src/scripts/{refactor_2021/search → search}/inputs/__tests__/sort-by-select.spec.tsx +0 -0
  199. package/src/scripts/{refactor_2021/search → search}/inputs/admin-allDatasets-toggle.tsx +0 -0
  200. package/src/scripts/{refactor_2021/search → search}/inputs/age-range-input.tsx +0 -0
  201. package/src/scripts/{refactor_2021/search → search}/inputs/author-input.tsx +0 -0
  202. package/src/scripts/{refactor_2021/search → search}/inputs/date-radios.tsx +0 -0
  203. package/src/scripts/{refactor_2021/search → search}/inputs/diagnosis-select.tsx +0 -0
  204. package/src/scripts/{refactor_2021/search → search}/inputs/index.ts +0 -0
  205. package/src/scripts/{refactor_2021/search → search}/inputs/keyword-input.tsx +0 -0
  206. package/src/scripts/{refactor_2021/search → search}/inputs/modality-select.tsx +0 -0
  207. package/src/scripts/{refactor_2021/search → search}/inputs/pet/bodyParts_input.tsx +0 -0
  208. package/src/scripts/{refactor_2021/search → search}/inputs/pet/scannerManufacturersModelNames_input.tsx +0 -0
  209. package/src/scripts/{refactor_2021/search → search}/inputs/pet/scannerManufacturers_input.tsx +0 -0
  210. package/src/scripts/{refactor_2021/search → search}/inputs/pet/tracerNames_input.tsx +0 -0
  211. package/src/scripts/{refactor_2021/search → search}/inputs/pet/tracerRadionuclides_input.tsx +0 -0
  212. package/src/scripts/{refactor_2021/search → search}/inputs/section-select.tsx +0 -0
  213. package/src/scripts/{refactor_2021/search → search}/inputs/sex-radios.tsx +0 -0
  214. package/src/scripts/{refactor_2021/search → search}/inputs/show-datasets-radios.tsx +2 -4
  215. package/src/scripts/{refactor_2021/search → search}/inputs/sort-by-select.tsx +0 -0
  216. package/src/scripts/{refactor_2021/search → search}/inputs/species-select.tsx +0 -0
  217. package/src/scripts/{refactor_2021/search → search}/inputs/study-domain-input.tsx +0 -0
  218. package/src/scripts/{refactor_2021/search → search}/inputs/subject-count-range-input.tsx +0 -0
  219. package/src/scripts/{refactor_2021/search → search}/inputs/task-input.tsx +0 -0
  220. package/src/scripts/{refactor_2021/search → search}/search-container.tsx +1 -1
  221. package/src/scripts/{refactor_2021/search → search}/search-params-ctx.tsx +0 -0
  222. package/src/scripts/{refactor_2021/search → search}/search-routes.tsx +0 -0
  223. package/src/scripts/{refactor_2021/search → search}/use-search-results.tsx +1 -0
  224. package/src/scripts/test-utils.js +1 -1
  225. package/src/scripts/{refactor_2021/uploader → uploader}/add-path-to-files.js +0 -0
  226. package/src/scripts/{refactor_2021/uploader → uploader}/file-select.tsx +0 -0
  227. package/src/scripts/{refactor_2021/uploader → uploader}/file-upload.js +1 -1
  228. package/src/scripts/{refactor_2021/uploader → uploader}/input.jsx +0 -0
  229. package/src/scripts/{refactor_2021/uploader → uploader}/upload-button.jsx +0 -0
  230. package/src/scripts/{refactor_2021/uploader → uploader}/upload-disclaimer-input.tsx +0 -0
  231. package/src/scripts/{refactor_2021/uploader → uploader}/upload-disclaimer.jsx +0 -0
  232. package/src/scripts/{refactor_2021/uploader → uploader}/upload-file-status.jsx +0 -0
  233. package/src/scripts/{refactor_2021/uploader → uploader}/upload-issues.jsx +1 -1
  234. package/src/scripts/{refactor_2021/uploader → uploader}/upload-metadata.jsx +0 -0
  235. package/src/scripts/{refactor_2021/uploader → uploader}/upload-mutation.js +0 -0
  236. package/src/scripts/{refactor_2021/uploader → uploader}/upload-progress-button.jsx +0 -0
  237. package/src/scripts/{refactor_2021/uploader → uploader}/upload-progress-class.js +0 -0
  238. package/src/scripts/{refactor_2021/uploader → uploader}/upload-progress.jsx +0 -0
  239. package/src/scripts/{refactor_2021/uploader → uploader}/upload-rename.jsx +0 -0
  240. package/src/scripts/{refactor_2021/uploader → uploader}/upload-resume.jsx +0 -0
  241. package/src/scripts/{refactor_2021/uploader → uploader}/upload-select.jsx +0 -0
  242. package/src/scripts/{refactor_2021/uploader → uploader}/upload-status.jsx +0 -0
  243. package/src/scripts/{refactor_2021/uploader → uploader}/upload-step.jsx +0 -0
  244. package/src/scripts/{refactor_2021/uploader → uploader}/uploader-context.js +0 -0
  245. package/src/scripts/{refactor_2021/uploader → uploader}/uploader-location.js +0 -0
  246. package/src/scripts/{refactor_2021/uploader → uploader}/uploader-modal.jsx +0 -0
  247. package/src/scripts/{refactor_2021/uploader → uploader}/uploader-setup-routes.jsx +0 -0
  248. package/src/scripts/{refactor_2021/uploader → uploader}/uploader-status-routes.jsx +0 -0
  249. package/src/scripts/{refactor_2021/uploader → uploader}/uploader-view.jsx +1 -1
  250. package/src/scripts/{refactor_2021/uploader → uploader}/uploader.jsx +1 -1
  251. package/src/scripts/{refactor_2021/utils → utils}/cookies.js +0 -0
  252. package/src/scripts/{refactor_2021 → utils}/user-login-modal-ctx.tsx +1 -2
  253. package/src/scripts/{refactor_2021/validation → validation}/validation-panel.jsx +0 -0
  254. package/src/scripts/{refactor_2021/validation → validation}/validation-results.issues.issue.jsx +0 -0
  255. package/src/scripts/{refactor_2021/validation → validation}/validation-results.issues.jsx +0 -0
  256. package/src/scripts/{refactor_2021/validation → validation}/validation-results.jsx +0 -0
  257. package/src/scripts/{refactor_2021/validation → validation}/validation-status.jsx +0 -0
  258. package/src/scripts/{refactor_2021/validation → validation}/validation.jsx +1 -1
  259. package/src/scripts/front-page/assets/get_data_browse.png +0 -0
  260. package/src/scripts/front-page/assets/get_data_download.png +0 -0
  261. package/src/scripts/front-page/assets/ljaf.png +0 -0
  262. package/src/scripts/front-page/assets/logo_app.png +0 -0
  263. package/src/scripts/front-page/assets/logo_cube.png +0 -0
  264. package/src/scripts/front-page/assets/logo_data.png +0 -0
  265. package/src/scripts/front-page/assets/logo_users.png +0 -0
  266. package/src/scripts/front-page/assets/nih.png +0 -0
  267. package/src/scripts/front-page/assets/nsf.png +0 -0
  268. package/src/scripts/front-page/assets/share_data_collaborate.png +0 -0
  269. package/src/scripts/front-page/assets/share_data_publish.png +0 -0
  270. package/src/scripts/front-page/assets/share_data_validate.png +0 -0
  271. package/src/scripts/front-page/assets/squishymedia.png +0 -0
  272. package/src/scripts/front-page/assets/stanford.png +0 -0
  273. package/src/scripts/front-page/assets/tab-get_data.png +0 -0
  274. package/src/scripts/front-page/assets/tab-share_data.png +0 -0
  275. package/src/scripts/front-page/assets/tab-use_data.png +0 -0
  276. package/src/scripts/front-page/assets/use_data_analyze.png +0 -0
  277. package/src/scripts/front-page/assets/use_data_snapshot.png +0 -0
  278. package/src/scripts/mobile/collapsible-wrapper.tsx +0 -93
  279. package/src/scripts/refactor_2021/common/partials/toast-content.jsx +0 -18
  280. package/src/scripts/refactor_2021/dataset/dataset-routes.jsx +0 -163
  281. package/src/scripts/refactor_2021/dataset/draft-container.tsx +0 -435
  282. package/src/scripts/refactor_2021/dataset/fragments/dataset-history.jsx +0 -103
  283. package/src/scripts/refactor_2021/dataset/routes/admin-datalad.jsx +0 -47
  284. package/src/scripts/refactor_2021/dataset/routes/admin-exports.jsx +0 -132
  285. package/src/scripts/refactor_2021/dataset/routes/download-dataset.tsx +0 -76
  286. package/src/scripts/refactor_2021/dataset/routes/snapshot.jsx +0 -139
  287. package/src/scripts/refactor_2021/utils/datalad.js +0 -13
  288. package/src/scripts/refactor_2021/utils/gtag.js +0 -22
@@ -5,9 +5,12 @@ import { MemoryRouter } from 'react-router-dom'
5
5
 
6
6
  describe('DoiLink component', () => {
7
7
  it('Renders usable link with raw DOI value', () => {
8
- render(<DOILink DOI="10.18112/openneuro.ds000001.v1.0.0" />, {
9
- wrapper: MemoryRouter,
10
- })
8
+ render(
9
+ <DOILink DOI="10.18112/openneuro.ds000001.v1.0.0" datasetId="ds000001" />,
10
+ {
11
+ wrapper: MemoryRouter,
12
+ },
13
+ )
11
14
  expect(screen.getByRole('link')).toHaveTextContent(
12
15
  'doi:10.18112/openneuro.ds000001.v1.0.0',
13
16
  )
@@ -17,26 +20,53 @@ describe('DoiLink component', () => {
17
20
  )
18
21
  })
19
22
  it('Renders usable link with URI DOI value', () => {
20
- render(<DOILink DOI="doi:10.18112/openneuro.ds000001.v1.0.0" />, {
21
- wrapper: MemoryRouter,
22
- })
23
+ render(
24
+ <DOILink
25
+ DOI="doi:10.18112/openneuro.ds000001.v1.0.0"
26
+ datasetId="ds000001"
27
+ />,
28
+ {
29
+ wrapper: MemoryRouter,
30
+ },
31
+ )
23
32
  expect(screen.getByRole('link')).toHaveTextContent(
24
33
  'doi:10.18112/openneuro.ds000001.v1.0.0',
25
34
  )
26
35
  })
27
36
  it('Renders usage link with URL DOI value', () => {
28
37
  render(
29
- <DOILink DOI="https://doi.org/10.18112/openneuro.ds000001.v1.0.0" />,
38
+ <DOILink
39
+ DOI="https://doi.org/10.18112/openneuro.ds000001.v1.0.0"
40
+ datasetId="ds000001"
41
+ />,
30
42
  { wrapper: MemoryRouter },
31
43
  )
32
44
  expect(screen.getByRole('link')).toHaveTextContent(
33
45
  'doi:10.18112/openneuro.ds000001.v1.0.0',
34
46
  )
35
47
  })
48
+ it('Renders fallback link with invalid DOI value', () => {
49
+ render(<DOILink DOI="doi:x" datasetId="ds000001" />, {
50
+ wrapper: MemoryRouter,
51
+ })
52
+ expect(screen.getByRole('link')).toHaveTextContent(
53
+ 'Create a new snapshot to obtain a DOI for the snapshot.',
54
+ )
55
+ expect(screen.getByRole('link')).toHaveAttribute(
56
+ 'href',
57
+ '/datasets/ds000001/snapshot',
58
+ )
59
+ })
36
60
  it('Renders fallback text if no valid DOI string is found', () => {
37
- render(<DOILink DOI={null} />, { wrapper: MemoryRouter })
61
+ render(<DOILink DOI={null} datasetId="ds000001" />, {
62
+ wrapper: MemoryRouter,
63
+ })
38
64
  expect(screen.getByRole('link')).toHaveTextContent(
39
65
  'Create a new snapshot to obtain a DOI for the snapshot.',
40
66
  )
67
+ expect(screen.getByRole('link')).toHaveAttribute(
68
+ 'href',
69
+ '/datasets/ds000001/snapshot',
70
+ )
41
71
  })
42
72
  })
@@ -61,13 +61,11 @@ const DatasetCitation = ({ snapshot }) => {
61
61
  />
62
62
  <Tooltip
63
63
  tooltip={'Copy ' + style + ' to clipboard'}
64
- className="tooltip"
65
- >
64
+ className="tooltip">
66
65
  <CopyToClipboard
67
66
  text={citation}
68
67
  onCopy={() => copiedTimeout()}
69
- className="on-button on-button--small on-button--nobg "
70
- >
68
+ className="on-button on-button--small on-button--nobg ">
71
69
  <span className="copy-key">
72
70
  <i className="fa fa-link" aria-hidden="true" />{' '}
73
71
  {copied ? <span>Copied to clipboard</span> : <span>Copy</span>}
@@ -0,0 +1,99 @@
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import styled from '@emotion/styled'
4
+ import { gql, useQuery } from '@apollo/client'
5
+
6
+ import Revalidate from '../mutations/revalidate.jsx'
7
+ import UpdateRef from '../mutations/update-ref.jsx'
8
+
9
+ const GET_HISTORY = gql`
10
+ query getHistory($datasetId: ID!) {
11
+ dataset(id: $datasetId) {
12
+ id
13
+ history {
14
+ id
15
+ authorName
16
+ authorEmail
17
+ date
18
+ references
19
+ message
20
+ }
21
+ worker
22
+ }
23
+ }
24
+ `
25
+
26
+ const DatasetHistoryTable = styled.div`
27
+ .row {
28
+ line-height: 1.2em;
29
+ }
30
+ .row:nth-of-type(2n) {
31
+ padding-top: 1em;
32
+ }
33
+ .row:nth-of-type(2n + 1) {
34
+ padding-bottom: 1em;
35
+ }
36
+ .row:nth-of-type(4n),
37
+ .row:nth-of-type(4n + 1) {
38
+ background: #f4f4f4;
39
+ }
40
+ `
41
+
42
+ const DatasetHistory = ({ datasetId }) => {
43
+ const { loading, data } = useQuery(GET_HISTORY, {
44
+ variables: { datasetId },
45
+ errorPolicy: 'all',
46
+ })
47
+ if (loading) {
48
+ return <div className="dataset-history">Loading...</div>
49
+ } else {
50
+ return (
51
+ <div className="dataset-history">
52
+ <h4>Worker Assignment</h4> {data.dataset.worker}
53
+ <h4>Git History</h4>
54
+ <DatasetHistoryTable>
55
+ <div className="grid faux-table-header">
56
+ <h4 className="col-lg col col-2">Commit</h4>
57
+ <h4 className="col-lg col col-3">Date</h4>
58
+ <h4 className="col-lg col col-3">Author</h4>
59
+ <h4 className="col-lg col col-2">References</h4>
60
+ <h4 className="col-lg col col-2 text--right">Action</h4>
61
+ </div>
62
+ {data.dataset.history.map(commit => (
63
+ <React.Fragment key={commit.id}>
64
+ <div className="grid faux-table">
65
+ <div className="commit col-lg col col-2">
66
+ <label>Commit: </label>
67
+ {commit.id.slice(0, 8)}
68
+ </div>
69
+ <div className="col-lg col col-3">
70
+ <label>Date: </label>
71
+ {commit.date}
72
+ </div>
73
+ <div className="col-lg col col-3">
74
+ <label>Author: </label>
75
+ {commit.authorName} &lt;{commit.authorEmail}&gt;
76
+ </div>
77
+ <div className="col-lg col col-2">
78
+ <label>References: </label>
79
+ {commit.references}
80
+ </div>
81
+ <div className="col-lg col col-2 grid actions">
82
+ <Revalidate datasetId={datasetId} revision={commit.id} />
83
+ <UpdateRef datasetId={datasetId} revision={commit.id} />
84
+ </div>
85
+ <div className="col-lg col col-12">{commit.message}</div>
86
+ </div>
87
+ </React.Fragment>
88
+ ))}
89
+ </DatasetHistoryTable>
90
+ </div>
91
+ )
92
+ }
93
+ }
94
+
95
+ DatasetHistory.propTypes = {
96
+ datasetId: PropTypes.string,
97
+ }
98
+
99
+ export default DatasetHistory
@@ -8,4 +8,4 @@ export const DATASET_REVIEWERS = gql`
8
8
  id
9
9
  }
10
10
  }
11
- `
11
+ `
@@ -4,7 +4,13 @@ import { Link } from 'react-router-dom'
4
4
  // See https://www.crossref.org/blog/dois-and-matching-regular-expressions/
5
5
  export const DOIPattern = /^10.\d{4,9}\/[-._;()/:A-Z0-9]+$/i
6
6
 
7
- export const DOILink = ({ DOI }) => {
7
+ export const DOILinkFallback = ({ datasetId }) => (
8
+ <Link to={`/datasets/${datasetId}/snapshot`}>
9
+ Create a new snapshot to obtain a DOI for the snapshot.
10
+ </Link>
11
+ )
12
+
13
+ export const DOILink = ({ DOI, datasetId }) => {
8
14
  if (
9
15
  DOI &&
10
16
  (DOI.match(DOIPattern) ||
@@ -20,11 +26,8 @@ export const DOILink = ({ DOI }) => {
20
26
  if (DOI.startsWith('https://doi.org/')) {
21
27
  return <a href={DOI}>{`doi:${DOI.slice(16)}`}</a>
22
28
  }
29
+ return <DOILinkFallback datasetId={datasetId} />
23
30
  } else {
24
- return (
25
- <Link to="snapshot">
26
- Create a new snapshot to obtain a DOI for the snapshot.
27
- </Link>
28
- )
31
+ return <DOILinkFallback datasetId={datasetId} />
29
32
  }
30
33
  }
@@ -0,0 +1,70 @@
1
+ import React from 'react'
2
+ import { gql, useMutation } from '@apollo/client'
3
+ import PropTypes from 'prop-types'
4
+ import { reexporterLogsURL } from '../../resources/kibana'
5
+ import { Button } from '@openneuro/components/button'
6
+ import styled from '@emotion/styled'
7
+
8
+ const ButtonRow = styled.div`
9
+ display: grid;
10
+ grid-template-columns: auto minmax(0, 1fr);
11
+ grid-gap: 1.3em;
12
+ place-items: start;
13
+ `
14
+
15
+ const SuccessMessage = styled.p({
16
+ color: 'rgb(92, 184, 92)',
17
+ })
18
+ const InProgressMessage = styled.p({
19
+ color: 'orange',
20
+ })
21
+ const ErrorMessage = styled.p({
22
+ color: 'red',
23
+ })
24
+
25
+ const REEXPORT_REMOTES = gql`
26
+ mutation reexportRemotes($datasetId: ID!) {
27
+ reexportRemotes(datasetId: $datasetId)
28
+ }
29
+ `
30
+
31
+ const AdminExports = ({ dataset }) => {
32
+ const [reexportRemotes, { data, loading, error }] =
33
+ useMutation(REEXPORT_REMOTES)
34
+ const success = data && data.reexportRemotes
35
+ return (
36
+ <div className="dataset-form">
37
+ {loading && (
38
+ <InProgressMessage>Your export is starting.</InProgressMessage>
39
+ )}
40
+ {error && <ErrorMessage>An error has occurred.</ErrorMessage>}
41
+ {success && <SuccessMessage>Your export has begun.</SuccessMessage>}
42
+ <ButtonRow>
43
+ <Button
44
+ icon="fa fa-rocket"
45
+ label="Run Export"
46
+ primary={true}
47
+ size="small"
48
+ onClick={() => {
49
+ reexportRemotes({ variables: { datasetId: dataset.id } })
50
+ }}
51
+ />
52
+ <Button
53
+ icon="fa fa-file-text"
54
+ label="View Export Logs"
55
+ secondary={true}
56
+ size="small"
57
+ onClick={() => {
58
+ window.open(reexporterLogsURL, '_blank')
59
+ }}
60
+ />
61
+ </ButtonRow>
62
+ </div>
63
+ )
64
+ }
65
+
66
+ AdminExports.propTypes = {
67
+ dataset: PropTypes.object,
68
+ }
69
+
70
+ export default AdminExports
@@ -61,9 +61,6 @@ export const CreateReviewLink: FC<CreateReviewLinkProps> = ({ datasetId }) => {
61
61
  size="small"
62
62
  onClick={() => CreateReviewLink({ variables: { datasetId } })}
63
63
  />
64
- <Link className="return-link" to={`/datasets/${datasetId}`}>
65
- Return to Dataset
66
- </Link>
67
64
  </div>
68
65
  </>
69
66
  )
@@ -50,20 +50,9 @@ const deleteDatasetRelation = gql`
50
50
  }
51
51
  `
52
52
 
53
- const RightColumn = styled.div({
54
- maxWidth: '700px',
55
- float: 'right',
56
- })
57
-
58
- const InfoText = styled.p({
59
- fontWeight: 100,
60
- textAlign: 'right',
61
- })
62
-
63
53
  const TableContainer = styled.div({
64
54
  display: 'grid',
65
55
  gridTemplateColumns: '2fr 3fr 1fr',
66
- textAlign: 'right',
67
56
  })
68
57
 
69
58
  const GridItem = styled.div({
@@ -96,7 +85,7 @@ export const DatasetRelations = ({ datasetId, hasEdit }) => {
96
85
  return (
97
86
  <React.Fragment key={obj.id}>
98
87
  <GridItem>
99
- <DOILink DOI={obj.id} />
88
+ <DOILink DOI={obj.id} datasetId={datasetId} />
100
89
  </GridItem>
101
90
  <GridItem>{obj.description}</GridItem>
102
91
  <GridItem>
@@ -107,8 +96,7 @@ export const DatasetRelations = ({ datasetId, hasEdit }) => {
107
96
  variables: { datasetId, doi: obj.id },
108
97
  })
109
98
  await refetch()
110
- }}
111
- >
99
+ }}>
112
100
  Delete
113
101
  </button>
114
102
  </GridItem>
@@ -121,15 +109,15 @@ export const DatasetRelations = ({ datasetId, hasEdit }) => {
121
109
  loadedData = <p>No related DOIs have been added.</p>
122
110
  }
123
111
  return (
124
- <RightColumn>
125
- <InfoText>
112
+ <>
113
+ <p>
126
114
  Add a related DOI such as other repositories where this dataset can be
127
115
  found. DOI values should be formatted according to the{' '}
128
116
  <a href="https://bids-specification.readthedocs.io/en/stable/02-common-principles.html#uniform-resource-indicator">
129
117
  BIDS recommended URI format
130
118
  </a>
131
119
  .
132
- </InfoText>
120
+ </p>
133
121
  {loadedData}
134
122
  {hasEdit && (
135
123
  <div>
@@ -196,7 +184,7 @@ export const DatasetRelations = ({ datasetId, hasEdit }) => {
196
184
  />
197
185
  </div>
198
186
  )}
199
- </RightColumn>
187
+ </>
200
188
  )
201
189
  } else {
202
190
  return null
@@ -49,8 +49,7 @@ const DeleteComment = ({ datasetId, commentId }) => {
49
49
  comments: nextCommentsState,
50
50
  },
51
51
  })
52
- }}
53
- >
52
+ }}>
54
53
  {deleteComment => (
55
54
  <div className="col col-fixed">
56
55
  <a
@@ -62,8 +61,7 @@ const DeleteComment = ({ datasetId, commentId }) => {
62
61
  deleteChildren: true,
63
62
  },
64
63
  })
65
- }}
66
- >
64
+ }}>
67
65
  <Icon icon="fa fa-trash" label="Delete" />
68
66
  </a>
69
67
  </div>
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
3
3
  import { gql } from '@apollo/client'
4
4
  import { Mutation } from '@apollo/client/react/components'
5
5
  import { SaveButton } from '../fragments/save-button'
6
- import { DRAFT_FRAGMENT } from '../../../datalad/dataset/dataset-query-fragments'
6
+ import { DRAFT_FRAGMENT } from '../../datalad/dataset/dataset-query-fragments'
7
7
  import { datasetCacheId } from './cache-id.js'
8
8
 
9
9
  export const UPDATE_DESCRIPTION = gql`
@@ -27,8 +27,7 @@ const FlagAnnexObject = ({ datasetId, snapshot, filepath, annexKey }) => (
27
27
  // fa-exclamation-triangle might be better
28
28
  <Tooltip
29
29
  className="flag-annex-object"
30
- tooltip="Flag: use this to alert site admins if this file has been found to contain subject sensitive data."
31
- >
30
+ tooltip="Flag: use this to alert site admins if this file has been found to contain subject sensitive data.">
32
31
  <WarnButton
33
32
  message=""
34
33
  icon="fa-exclamation-triangle"
@@ -1,9 +1,9 @@
1
1
  import React, { FC, useContext } from 'react'
2
2
  import { gql } from '@apollo/client'
3
3
  import { Mutation } from '@apollo/client/react/components'
4
- import { datasetCacheId } from '../../../datalad/mutations/cache-id.js'
4
+ import { datasetCacheId } from '../../datalad/mutations/cache-id.js'
5
5
  import { CountToggle } from '@openneuro/components/count-toggle'
6
- import { UserModalOpenCtx } from '../../user-login-modal-ctx'
6
+ import { UserModalOpenCtx } from '../../utils/user-login-modal-ctx'
7
7
 
8
8
  const FOLLOW_DATASET = gql`
9
9
  mutation followDataset($datasetId: ID!) {
@@ -321,7 +321,7 @@ const MetadataForm = ({
321
321
  hasEdit,
322
322
  validationErrors = [],
323
323
  }) => (
324
- <Form id="metadata-form" className="col col-6">
324
+ <Form id="metadata-form">
325
325
  <InfoText>
326
326
  Incomplete fields in this form will make it more difficult for users to
327
327
  search for your dataset.
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
3
3
  import { gql } from '@apollo/client'
4
4
  import { Mutation } from '@apollo/client/react/components'
5
5
  import { SaveButton } from '../fragments/save-button'
6
- import { DRAFT_FRAGMENT } from '../../../datalad/dataset/dataset-query-fragments'
6
+ import { DRAFT_FRAGMENT } from '../../datalad/dataset/dataset-query-fragments'
7
7
  import { datasetCacheId } from './cache-id.js'
8
8
 
9
9
  const UPDATE_README = gql`
@@ -41,7 +41,6 @@ const RemoveAnnexObject = ({
41
41
  iconOnly={true}
42
42
  icon="fa-frown-o"
43
43
  className="edit-file"
44
- tooltip={'Delete ' + name}
45
44
  onConfirmedClick={() => {
46
45
  removeAnnexObject({
47
46
  variables: {
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import { gql, useMutation } from '@apollo/client'
4
4
  import { useHistory } from 'react-router-dom'
5
- import ErrorBoundary from '../../../errors/errorBoundary.jsx'
5
+ import ErrorBoundary from '../../errors/errorBoundary.jsx'
6
6
  import { Button } from '@openneuro/components/button'
7
7
 
8
8
  const CREATE_SNAPSHOT = gql`
@@ -18,12 +18,14 @@ interface CreateSnapshotMutationProps {
18
18
  datasetId: string
19
19
  tag: string
20
20
  changes: Array<string>
21
+ disabled: boolean
21
22
  }
22
23
 
23
24
  const CreateSnapshotMutation = ({
24
25
  datasetId,
25
26
  tag,
26
27
  changes,
28
+ disabled,
27
29
  }: CreateSnapshotMutationProps) => {
28
30
  const history = useHistory()
29
31
  const [snapshotDataset, { loading, error }] = useMutation(CREATE_SNAPSHOT)
@@ -42,6 +44,7 @@ const CreateSnapshotMutation = ({
42
44
  variables: { datasetId, tag, changes },
43
45
  }).then(() => history.push(`/datasets/${datasetId}/versions/${tag}`))
44
46
  }}
47
+ disabled={disabled}
45
48
  label="Create Version"
46
49
  />
47
50
  )
@@ -52,11 +55,22 @@ interface SnapshotDatasetProps {
52
55
  datasetId: string
53
56
  tag: string
54
57
  changes: Array<string>
58
+ disabled: boolean
55
59
  }
56
60
 
57
- const SnapshotDataset = ({ datasetId, tag, changes }: SnapshotDatasetProps) => (
61
+ const SnapshotDataset = ({
62
+ datasetId,
63
+ tag,
64
+ changes,
65
+ disabled,
66
+ }: SnapshotDatasetProps) => (
58
67
  <ErrorBoundary subject="error creating version">
59
- <CreateSnapshotMutation datasetId={datasetId} tag={tag} changes={changes} />
68
+ <CreateSnapshotMutation
69
+ datasetId={datasetId}
70
+ tag={tag}
71
+ changes={changes}
72
+ disabled={disabled}
73
+ />
60
74
  </ErrorBoundary>
61
75
  )
62
76
 
@@ -1,9 +1,9 @@
1
1
  import React, { FC, useContext } from 'react'
2
2
  import { gql } from '@apollo/client'
3
3
  import { Mutation } from '@apollo/client/react/components'
4
- import { datasetCacheId } from '../../../datalad/mutations/cache-id.js'
4
+ import { datasetCacheId } from '../../datalad/mutations/cache-id.js'
5
5
  import { CountToggle } from '@openneuro/components/count-toggle'
6
- import { UserModalOpenCtx } from '../../user-login-modal-ctx'
6
+ import { UserModalOpenCtx } from '../../utils/user-login-modal-ctx'
7
7
 
8
8
  const STAR_DATASET = gql`
9
9
  mutation starDataset($datasetId: ID!) {