Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nv indicator in analysis list #998

Merged
merged 22 commits into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
104f110
add column property for count of neurovault links
rwblair Oct 8, 2021
98ace23
Merge branch 'master' of github.com:neuroscout/neuroscout into nv_ind…
rwblair Oct 8, 2021
3be1065
add missing import
rwblair Oct 8, 2021
e99be7d
try a different way of getting nv link count
rwblair Oct 8, 2021
faae98f
just use hybrid property
rwblair Oct 8, 2021
660c335
add nv_count to analysis schema and endpoint
rwblair Oct 11, 2021
86f6a3d
add nv_count column to analysis list display
rwblair Oct 11, 2021
8440a4e
add nv_count to api transformer when loading analyses
rwblair Oct 11, 2021
7564780
sorter logic, who knows
rwblair Oct 11, 2021
e46a9ec
sorter logic, who knows
rwblair Oct 11, 2021
54f729d
change table header from uploaded to neurovault
rwblair Oct 11, 2021
7bfdc59
upgrade frontend packages, fix conflicts with new any styling. put nv…
rwblair Oct 12, 2021
2cecc1c
null commit for deepdream push
rwblair Oct 12, 2021
44ccfee
strip off time from uploaded times
rwblair Oct 12, 2021
0f91763
need nv_count i nschema for private analyses lists
rwblair Oct 13, 2021
c386c05
put nv upload cards in flex container
rwblair Oct 13, 2021
d000f8c
null deepdream commit
rwblair Oct 26, 2021
7af22bf
Sleep longer
adelavega Oct 26, 2021
7604ba0
Sleep even longer
adelavega Oct 26, 2021
f33dd95
a span has shown up between newAnalysis div and its link. fix cypress…
rwblair Oct 27, 2021
b9f788b
Merge branch 'nv_indicator_in_analysis_list' of github.com:neuroscout…
rwblair Oct 27, 2021
3d8aa5c
have run/status tab always be called 'Run'
rwblair Oct 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ jobs:
CHOKIDAR_USEPOLLING: 1
run: |
bash setup_frontend_tests.sh
sleep 15
sleep 60
cd neuroscout/frontend && ./node_modules/.bin/cypress run --record --key ${{ secrets.CYPRESS_RECORD_KEY }}
if: matrix.type == 'frontend'
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,4 @@ In a separate window, you can run cypress:
Once done, kill the first command, and run the following to tear down the test db

docker-compose exec -e APP_SETTINGS=neuroscout.config.app.DockerTestConfig neuroscout python manage.py teardown_test_db

1 change: 0 additions & 1 deletion neuroscout/frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
singleQuote: true
jsxBracketSameLine: true
semi: false
trailingComma: all
arrowParens: avoid
1 change: 1 addition & 0 deletions neuroscout/frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ All application state is contained in two main components:

`coretypes.tsx` contains the type definitinos for most key models, such as analysis, run, predictor, contrast, transformation, etc. The data models in this module are largely UI agonstic. This file is a good starting point to understand the
shape of the data in the frontend app. All resusable type definitions should go into this module.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe('Analysis Builder', () => {
beforeEach(() => {
cy.login('user@example.com', 'string')
cy.get('.newAnalysis > a')
cy.get('.newAnalysis a')
cy.visit('/builder')
})

Expand Down
1 change: 1 addition & 0 deletions neuroscout/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"jest-canvas-mock": "^2.3.1",
"prettier": "^2.3.0",
"prettier-eslint": "^12.0.0",
"prettier-eslint-cli": "^5.0.1",
"react-app-rewired": "^2.1.8",
"react-scripts": "^4.0.3",
"source-map-explorer": "^2.0.1",
Expand Down
17 changes: 15 additions & 2 deletions neuroscout/frontend/src/AnalysisList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ the home page or on the 'browse public analysis' page
*/
import * as React from 'react'
import { Button, Row, Table, Input } from 'antd'
import { CheckCircleTwoTone } from '@ant-design/icons'
import { MainCol, Space, StatusTag } from './HelperComponents'
import { AppAnalysis, Dataset } from './coretypes'
import { Link, Redirect } from 'react-router-dom'
Expand Down Expand Up @@ -185,7 +186,18 @@ export class AnalysisListTable extends React.Component<
width: `${this.state.ownersWidth}ch`,
})
}

analysisTableColumns.push({
title: 'NeuroVault',
dataIndex: 'nv_count',
width: '2ch',
sorter: (a, b) => a.nv_count - b.nv_count,
render: (text, record: AppAnalysis) => {
if (record.nv_count) {
return <CheckCircleTwoTone twoToneColor="#52c41a" />
}
return
},
})
if (publicList) {
analysisTableColumns.splice(2, 1)
}
Expand All @@ -204,7 +216,8 @@ export class AnalysisListTable extends React.Component<
void this.props.cloneAnalysis(record.id).then(id => {
this.setState({ redirectId: id })
})
}}>
}}
>
Clone
</Button>
<Space />
Expand Down
3 changes: 2 additions & 1 deletion neuroscout/frontend/src/HelperComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export const MainCol = (props: { children: React.ReactNode }): JSX.Element => {
xl={{ span: 18 }}
lg={{ span: 20 }}
xs={{ span: 24 }}
className="mainCol">
className="mainCol"
>
{props.children}
</Col>
)
Expand Down
36 changes: 24 additions & 12 deletions neuroscout/frontend/src/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ class Home extends React.Component<UserStore, Record<string, never>> {
size="large"
className="splashButton"
type="default"
href="/public">
href="/public"
>
Browse public analyses
</Button>{' '}
{this.props.loggedIn === false && (
<Button
size="large"
className="splashButton"
type="primary"
onClick={e => this.props.update({ openSignup: true })}>
onClick={e => this.props.update({ openSignup: true })}
>
Sign up to get started!
</Button>
)}
Expand All @@ -59,7 +61,8 @@ class Home extends React.Component<UserStore, Record<string, never>> {
xxl={{ span: 5 }}
xl={{ span: 6 }}
lg={{ span: 7 }}
xs={{ span: 8 }}>
xs={{ span: 8 }}
>
<div className="stat-container">
<div className="stat-title">Active Datasets</div>
<div className="stat-value">13</div>
Expand All @@ -69,7 +72,8 @@ class Home extends React.Component<UserStore, Record<string, never>> {
xxl={{ span: 5 }}
xl={{ span: 6 }}
lg={{ span: 7 }}
xs={{ span: 8 }}>
xs={{ span: 8 }}
>
<div className="stat-container">
<div className="stat-title">Number of Tasks</div>
<div className="stat-value">40</div>
Expand All @@ -82,11 +86,13 @@ class Home extends React.Component<UserStore, Record<string, never>> {
xxl={{ span: 5 }}
xl={{ span: 6 }}
lg={{ span: 7 }}
xs={{ span: 8 }}>
xs={{ span: 8 }}
>
<Card
title="Re-use public data"
headStyle={titleStyle}
bordered={false}>
bordered={false}
>
<img className="splashLogo" src="/static/browse.svg" />
<br />
<div className="introCardsText">
Expand All @@ -102,11 +108,13 @@ class Home extends React.Component<UserStore, Record<string, never>> {
xxl={{ span: 5 }}
xl={{ span: 6 }}
lg={{ span: 7 }}
xs={{ span: 8 }}>
xs={{ span: 8 }}
>
<Card
title="Design your analysis"
headStyle={titleStyle}
bordered={false}>
bordered={false}
>
<img className="splashLogo" src="/static/design.svg" />
<br />
<div className="introCardsText">
Expand All @@ -121,11 +129,13 @@ class Home extends React.Component<UserStore, Record<string, never>> {
xxl={{ span: 5 }}
xl={{ span: 6 }}
lg={{ span: 7 }}
xs={{ span: 8 }}>
xs={{ span: 8 }}
>
<Card
title="Execute and share"
headStyle={titleStyle}
bordered={false}>
bordered={false}
>
<img className="splashLogo" src="/static/share.svg" />
<br />
<div className="introCardsText">
Expand All @@ -145,7 +155,8 @@ class Home extends React.Component<UserStore, Record<string, never>> {
<Button
size="large"
className="splashButton"
href="https://neuroscout.github.io/neuroscout/">
href="https://neuroscout.github.io/neuroscout/"
>
<BookOutlined />
Learn more
</Button>
Expand All @@ -157,7 +168,8 @@ class Home extends React.Component<UserStore, Record<string, never>> {
<Card
title="Support provided by"
headStyle={titleStyle}
bordered={false}>
bordered={false}
>
<Row justify="center">
<Col span={5}>
<img className="instLogo2" src="/static/utlogo.png" />
Expand Down
39 changes: 26 additions & 13 deletions neuroscout/frontend/src/Modals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class GoogleLoginBtn extends React.Component<UserStore, Record<string, never>> {
style={{ width: '100%' }}
htmlType="submit"
type="primary"
ghost={true}>
ghost={true}
>
<GoogleOutlined />
</Button>
)}
Expand Down Expand Up @@ -69,12 +70,14 @@ export class ResetPasswordModal extends React.Component<
maskClosable={true}
onCancel={e => {
this.props.update({ openReset: false })
}}>
}}
>
<p>Please enter an email address to send reset instructions</p>
<Form
onFinish={e => {
this.props.resetPassword()
}}>
}}
>
<FormItem>
<Input
prefix={<MailOutlined style={{ fontSize: 13 }} />}
Expand Down Expand Up @@ -109,7 +112,8 @@ export class EnterResetTokenModal extends React.Component<
maskClosable={true}
onCancel={e => {
this.props.update({ openEnterResetToken: false })
}}>
}}
>
<p>
We have sent a reset token to {this.props.profile.email} <br />
Please enter the token below, along with a new password for the
Expand All @@ -118,7 +122,8 @@ export class EnterResetTokenModal extends React.Component<
<Form
onFinish={e => {
this.props.submitToken()
}}>
}}
>
<FormItem>
<Input
prefix={<TagsOutlined style={{ fontSize: 13 }} />}
Expand Down Expand Up @@ -164,13 +169,15 @@ export class LoginModal extends React.Component<
onCancel={e => {
this.props.logout()
this.props.update({ openLogin: false })
}}>
}}
>
<p>{this.props.loginError ? this.props.loginError : ''}</p>
<br />
<Form
onFinish={e => {
void this.props.login()
}}>
}}
>
<FormItem>
<Input
prefix={<MailOutlined style={{ fontSize: 13 }} />}
Expand All @@ -196,7 +203,8 @@ export class LoginModal extends React.Component<
<a
onClick={e => {
this.props.update({ openLogin: false, openReset: true })
}}>
}}
>
Forgot password
</a>
<br />
Expand Down Expand Up @@ -252,7 +260,8 @@ class RegistrationForm extends React.Component<RegistrationFormProps> {
required: true,
message: 'Please input your name!',
},
]}>
]}
>
<Input />
</FormItem>
<FormItem
Expand All @@ -267,7 +276,8 @@ class RegistrationForm extends React.Component<RegistrationFormProps> {
required: true,
message: 'Please input your email address.',
},
]}>
]}
>
<Input />
</FormItem>
<FormItem
Expand All @@ -282,7 +292,8 @@ class RegistrationForm extends React.Component<RegistrationFormProps> {
{
validator: this.validateToNextPassword,
},
]}>
]}
>
<Input.Password />
</FormItem>
<FormItem
Expand All @@ -297,7 +308,8 @@ class RegistrationForm extends React.Component<RegistrationFormProps> {
{
validator: this.compareToFirstPassword,
},
]}>
]}
>
<Input.Password />
</FormItem>
<FormItem>
Expand All @@ -323,7 +335,8 @@ export class SignupModal extends React.Component<
visible={this.props.openSignup}
footer={null}
maskClosable={true}
onCancel={e => this.props.update({ openSignup: false })}>
onCancel={e => this.props.update({ openSignup: false })}
>
{this.props.signupError && (
<Alert message={this.props.signupError} type="error" />
)}
Expand Down