@openneuro/app 4.4.8 → 4.5.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 (42) hide show
  1. package/package.json +5 -5
  2. package/src/scripts/app.tsx +1 -1
  3. package/src/scripts/common/partials/papaya.jsx +1 -0
  4. package/src/scripts/index.tsx +1 -1
  5. package/src/scripts/{refactor_2021 → pages}/admin/admin.jsx +1 -1
  6. package/src/scripts/{refactor_2021 → pages}/admin/flagged-files.jsx +0 -0
  7. package/src/scripts/{refactor_2021 → pages}/admin/user-fragment.ts +0 -0
  8. package/src/scripts/{refactor_2021 → pages}/admin/user-tools.tsx +1 -1
  9. package/src/scripts/{refactor_2021 → pages}/admin/users.jsx +0 -0
  10. package/src/scripts/pages/citation-page.tsx +1 -1
  11. package/src/scripts/{front-page → pages/front-page}/front-page-content.ts +10 -10
  12. package/src/scripts/{refactor_2021/containers/front-page-container.tsx → pages/front-page/front-page.tsx} +53 -32
  13. package/src/scripts/pages/front-page-comp.tsx +57 -0
  14. package/src/scripts/{pet/redirect.tsx → pages/pet-redirect.tsx} +0 -0
  15. package/src/scripts/refactor_2021/dataset/draft-container.tsx +303 -318
  16. package/src/scripts/refactor_2021/dataset/files/file-viewer-type.jsx +2 -0
  17. package/src/scripts/refactor_2021/dataset/fragments/__tests__/doi-link.spec.tsx +38 -8
  18. package/src/scripts/refactor_2021/dataset/fragments/doi-link.tsx +9 -6
  19. package/src/scripts/refactor_2021/dataset/mutations/dataset-relations.tsx +2 -3
  20. package/src/scripts/refactor_2021/dataset/snapshot-container.tsx +98 -112
  21. package/src/scripts/refactor_2021/uploader/upload-issues.jsx +1 -0
  22. package/src/scripts/{refactor_2021/routes.tsx → routes.tsx} +10 -10
  23. package/src/scripts/front-page/assets/get_data_browse.png +0 -0
  24. package/src/scripts/front-page/assets/get_data_download.png +0 -0
  25. package/src/scripts/front-page/assets/ljaf.png +0 -0
  26. package/src/scripts/front-page/assets/logo_app.png +0 -0
  27. package/src/scripts/front-page/assets/logo_cube.png +0 -0
  28. package/src/scripts/front-page/assets/logo_data.png +0 -0
  29. package/src/scripts/front-page/assets/logo_users.png +0 -0
  30. package/src/scripts/front-page/assets/nih.png +0 -0
  31. package/src/scripts/front-page/assets/nsf.png +0 -0
  32. package/src/scripts/front-page/assets/share_data_collaborate.png +0 -0
  33. package/src/scripts/front-page/assets/share_data_publish.png +0 -0
  34. package/src/scripts/front-page/assets/share_data_validate.png +0 -0
  35. package/src/scripts/front-page/assets/squishymedia.png +0 -0
  36. package/src/scripts/front-page/assets/stanford.png +0 -0
  37. package/src/scripts/front-page/assets/tab-get_data.png +0 -0
  38. package/src/scripts/front-page/assets/tab-share_data.png +0 -0
  39. package/src/scripts/front-page/assets/tab-use_data.png +0 -0
  40. package/src/scripts/front-page/assets/use_data_analyze.png +0 -0
  41. package/src/scripts/front-page/assets/use_data_snapshot.png +0 -0
  42. package/src/scripts/mobile/collapsible-wrapper.tsx +0 -93
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openneuro/app",
3
- "version": "4.4.8",
3
+ "version": "4.5.0",
4
4
  "description": "React JS web frontend for the OpenNeuro platform.",
5
5
  "license": "MIT",
6
6
  "main": "public/client.js",
@@ -19,10 +19,10 @@
19
19
  "@elastic/apm-rum": "5.9.1",
20
20
  "@emotion/react": "11.6.0",
21
21
  "@emotion/styled": "11.6.0",
22
- "@openneuro/client": "^4.4.8",
23
- "@openneuro/components": "^4.4.8",
22
+ "@openneuro/client": "^4.5.0",
23
+ "@openneuro/components": "^4.5.0",
24
24
  "babel-runtime": "^6.26.0",
25
- "bids-validator": "1.8.8",
25
+ "bids-validator": "1.9.2",
26
26
  "bytes": "^3.0.0",
27
27
  "comlink": "^4.0.5",
28
28
  "core-js": "^3.3.2",
@@ -116,5 +116,5 @@
116
116
  "publishConfig": {
117
117
  "access": "public"
118
118
  },
119
- "gitHead": "b8a034d3dc02824a74f92dbf4917a3da8f8defae"
119
+ "gitHead": "8771d59f40e642de9313468e8764f91fb0d811b2"
120
120
  }
@@ -1,6 +1,6 @@
1
1
  import React, { FC, ReactNode } from 'react'
2
2
  import Helmet from 'react-helmet'
3
- import { frontPage } from './front-page/front-page-content'
3
+ import { frontPage } from './pages/front-page/front-page-content'
4
4
  import { CookiesProvider, Cookies } from 'react-cookie'
5
5
  import { ToastContainer } from 'react-toastify'
6
6
  import { MediaContextProvider } from './styles/media'
@@ -25,6 +25,7 @@ class Papaya extends React.Component {
25
25
  allowScroll: false,
26
26
  fullScreenPadding: false,
27
27
  showControlBar: true,
28
+ showOrientation: true,
28
29
  images: [this.props.image],
29
30
  kioskMode: true,
30
31
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import Uploader from './refactor_2021/uploader/uploader.jsx'
3
- import Routes from './refactor_2021/routes'
3
+ import Routes from './routes'
4
4
  import HeaderContainer from './refactor_2021/containers/header'
5
5
  import FooterContainer from './refactor_2021/containers/footer'
6
6
  import { SearchParamsProvider } from './refactor_2021/search/search-params-ctx'
@@ -4,7 +4,7 @@ import React from 'react'
4
4
  import { Redirect, Switch, Route, NavLink } from 'react-router-dom'
5
5
  import Users from './users.jsx'
6
6
  import FlaggedFiles from './flagged-files.jsx'
7
- import AdminUser from '../authentication/admin-user.jsx'
7
+ import AdminUser from '../../refactor_2021/authentication/admin-user.jsx'
8
8
 
9
9
  class Dashboard extends React.Component {
10
10
  // life cycle events --------------------------------------------------
@@ -2,7 +2,7 @@ import React, { FC, ReactElement } from 'react'
2
2
  import { gql } from '@apollo/client'
3
3
  import { Mutation } from '@apollo/client/react/components'
4
4
  import { WarnButton } from '@openneuro/components/warn-button'
5
- import { getProfile } from '../authentication/profile.js'
5
+ import { getProfile } from '../../refactor_2021/authentication/profile.js'
6
6
  import { useCookies } from 'react-cookie'
7
7
  import { USER_FRAGMENT } from './user-fragment'
8
8
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { frontPage } from '../front-page/front-page-content'
2
+ import { frontPage } from './front-page/front-page-content'
3
3
  import styled from '@emotion/styled'
4
4
 
5
5
  const CitationPageStyle = styled.div`
@@ -1,13 +1,13 @@
1
- import ljaf from '../../assets/ljaf.png'
2
- import nsf from '../../assets/nsf.png'
3
- import nih from '../../assets/nih.png'
4
- import squishymedia from '../../assets/squishymedia.png'
5
- import stanford from '../../assets/stanford.png'
6
- import logo_app from '../../assets/logo_app.png'
7
- import logo_cube from '../../assets/logo_cube.png'
8
- import logo_data from '../../assets/logo_data.png'
9
- import logo_users from '../../assets/logo_users.png'
10
- import brand_mark from '../../assets/brand_mark.png'
1
+ import ljaf from '../../../assets/ljaf.png'
2
+ import nsf from '../../../assets/nsf.png'
3
+ import nih from '../../../assets/nih.png'
4
+ import squishymedia from '../../../assets/squishymedia.png'
5
+ import stanford from '../../../assets/stanford.png'
6
+ import logo_app from '../../../assets/logo_app.png'
7
+ import logo_cube from '../../../assets/logo_cube.png'
8
+ import logo_data from '../../../assets/logo_data.png'
9
+ import logo_users from '../../../assets/logo_users.png'
10
+ import brand_mark from '../../../assets/brand_mark.png'
11
11
 
12
12
  export const frontPage = {
13
13
  pageTitle: 'OpenNeuro',
@@ -2,9 +2,9 @@ import { apm } from '../../apm'
2
2
  import React from 'react'
3
3
  import { gql, useQuery } from '@apollo/client'
4
4
  import { Mutation } from '@apollo/client/react/components'
5
+ import styled from '@emotion/styled'
5
6
 
6
7
  import {
7
- FrontPage,
8
8
  AffiliateBlock,
9
9
  ActivityHeader,
10
10
  Contributors,
@@ -154,37 +154,58 @@ export const FrontPageNewQuery = ({ query }) => {
154
154
  )
155
155
  }
156
156
  }
157
- const FrontPageContainer: React.FC = () => {
158
- return (
159
- <>
160
- <FrontPage
161
- className="front-page"
162
- renderAffiliateBlock={() => <AffiliateBlock />}
163
- renderInfographic={() => <Infographic />}
164
- renderActivitySliderFront={() => (
165
- <>
166
- <ActivityHeader />
167
- <FrontPageTopQuery query={TOP_VIEWED} />
168
- <FrontPageNewQuery query={RECENTLY_PUBLISHED} />
169
- </>
170
- )}
171
- renderGetUpdates={() => (
172
- <Mutation mutation={SUBSCRIBE_TO_NEWSLETTER}>
173
- {subscribeToNewsletter => (
174
- <GetUpdates
175
- subscribe={(email, cb) => {
176
- subscribeToNewsletter({ variables: { email } })
177
- .then(cb)
178
- .catch(cb)
179
- }}
180
- />
181
- )}
182
- </Mutation>
157
+
158
+ const FrontPageSection = styled.section`
159
+ margin: 100px 0;
160
+ &:last-child {
161
+ margin-bottom: 0;
162
+ }
163
+ &.gray-bg {
164
+ margin: 0;
165
+ padding: 100px 0;
166
+ &:last-child {
167
+ padding-bottom: 0;
168
+ }
169
+ }
170
+ `
171
+
172
+ const FrontPageContainer: React.FC = () => (
173
+ <div className="front-page page">
174
+ <FrontPageSection>
175
+ <AffiliateBlock />
176
+ </FrontPageSection>
177
+ <FrontPageSection>
178
+ <div className="container">
179
+ <Infographic />
180
+ </div>
181
+ </FrontPageSection>
182
+ <FrontPageSection className="front-page-activity">
183
+ <div className="activity-swoop">
184
+ <div></div>
185
+ </div>
186
+ <div className="swoop-content gray-bg">
187
+ <div className="container">
188
+ <ActivityHeader />
189
+ <FrontPageTopQuery query={TOP_VIEWED} />
190
+ <FrontPageNewQuery query={RECENTLY_PUBLISHED} />
191
+ </div>
192
+ </div>
193
+ </FrontPageSection>
194
+ <FrontPageSection className="gray-bg">
195
+ <Mutation mutation={SUBSCRIBE_TO_NEWSLETTER}>
196
+ {subscribeToNewsletter => (
197
+ <GetUpdates
198
+ subscribe={(email, cb) => {
199
+ subscribeToNewsletter({ variables: { email } }).then(cb).catch(cb)
200
+ }}
201
+ />
183
202
  )}
184
- renderContributors={() => <Contributors />}
185
- />
186
- </>
187
- )
188
- }
203
+ </Mutation>
204
+ </FrontPageSection>
205
+ <FrontPageSection className="gray-bg">
206
+ <Contributors />
207
+ </FrontPageSection>
208
+ </div>
209
+ )
189
210
 
190
211
  export default FrontPageContainer
@@ -0,0 +1,57 @@
1
+ import React from 'react'
2
+ import styled from '@emotion/styled'
3
+
4
+ const FrontPageSection = styled.section`
5
+ margin: 100px 0;
6
+ &:last-child {
7
+ margin-bottom: 0;
8
+ }
9
+ &.gray-bg {
10
+ margin: 0;
11
+ padding: 100px 0;
12
+ &:last-child {
13
+ padding-bottom: 0;
14
+ }
15
+ }
16
+ `
17
+
18
+ export interface FrontPageProps {
19
+ renderAffiliateBlock: () => React.ReactNode
20
+ renderInfographic: () => React.ReactNode
21
+ renderActivitySliderFront: () => React.ReactNode
22
+ renderGetUpdates: () => React.ReactNode
23
+ renderContributors: () => React.ReactNode
24
+ className?: string
25
+ }
26
+
27
+ export const FrontPage: React.FC<FrontPageProps> = ({
28
+ renderAffiliateBlock,
29
+ renderInfographic,
30
+ renderActivitySliderFront,
31
+ renderGetUpdates,
32
+ renderContributors,
33
+ className,
34
+ }) => (
35
+ <>
36
+ <div className={className + ' page'}>
37
+ <FrontPageSection>{renderAffiliateBlock()}</FrontPageSection>
38
+ <FrontPageSection>
39
+ <div className="container">{renderInfographic()}</div>
40
+ </FrontPageSection>
41
+ <FrontPageSection className="front-page-activity">
42
+ <div className="activity-swoop">
43
+ <div></div>
44
+ </div>
45
+ <div className="swoop-content gray-bg">
46
+ <div className="container">{renderActivitySliderFront()}</div>
47
+ </div>
48
+ </FrontPageSection>
49
+ <FrontPageSection className="gray-bg">
50
+ {renderGetUpdates()}
51
+ </FrontPageSection>
52
+ <FrontPageSection className="gray-bg">
53
+ {renderContributors()}
54
+ </FrontPageSection>
55
+ </div>
56
+ </>
57
+ )