Skip to content

Commit

Permalink
Merge pull request #616 from rwblair/610_add_ga
Browse files Browse the repository at this point in the history
Add analytics, reorg front end code
  • Loading branch information
adelavega committed Jul 12, 2019
2 parents 302b37f + 4da7a25 commit a99c69b
Show file tree
Hide file tree
Showing 41 changed files with 2,371 additions and 2,362 deletions.
4 changes: 3 additions & 1 deletion neuroscout/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "frontend",
"version": "0.1.0",
"proxy": "https://alpha.neuroscout.org:80",
"proxy": "http://alpha.neuroscout.org:80",
"private": true,
"dependencies": {
"@types/antd": "^1.0.0",
Expand All @@ -19,6 +19,7 @@
"react": "^16.3.2",
"react-beautiful-dnd": "^10.0.3",
"react-dom": "^16.3.2",
"react-ga": "^2.6.0",
"react-google-login": "^3.2.1",
"react-router": "^4.1.1",
"react-router-dom": "^4.1.1",
Expand All @@ -35,6 +36,7 @@
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"react-scripts-ts": "3.1.0",
"tslint-etc": "^1.5.6",
"tsutils": "^2.26.2",
"typescript": "^3"
},
Expand Down
20 changes: 0 additions & 20 deletions neuroscout/frontend/src/404.tsx

This file was deleted.

30 changes: 22 additions & 8 deletions neuroscout/frontend/src/AnalysisList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ Resuable AnalysisList component used for displaying a list of analyses, e.g. on
the home page or on the 'browse public analysis' page
*/
import * as React from 'react';
import { Button, Table } from 'antd';
import { Space } from './HelperComponents';
import { Button, Row, Table } from 'antd';
import { MainCol, Space, StatusTag } from './HelperComponents';
import { AppAnalysis, Dataset } from './coretypes';
import { Status } from './Status';
import { Link } from 'react-router-dom';

export interface AnalysisListProps {
Expand All @@ -19,9 +18,7 @@ export interface AnalysisListProps {
datasets: Dataset[];
}

class AnalysisTable extends Table<AppAnalysis> {}

class AnalysisList extends React.Component<AnalysisListProps> {
class AnalysisListTable extends React.Component<AnalysisListProps> {
render() {
const { analyses, datasets, publicList, cloneAnalysis, onDelete } = this.props;

Expand All @@ -47,7 +44,7 @@ class AnalysisList extends React.Component<AnalysisListProps> {
{
title: 'Status',
dataIndex: 'status',
render: (text, record) => <Status status={record.status} />,
render: (text, record) => <StatusTag status={record.status} />,
sorter: (a, b) => a.status.localeCompare(b.status)
},
{
Expand Down Expand Up @@ -96,7 +93,7 @@ class AnalysisList extends React.Component<AnalysisListProps> {
];
return (
<div>
<AnalysisTable
<Table
columns={analysisTableColumns}
rowKey="id"
size="small"
Expand All @@ -112,4 +109,21 @@ class AnalysisList extends React.Component<AnalysisListProps> {
}
}

// wrap table in components for use by itself as route
const AnalysisList = (props: AnalysisListProps) => {
return (
<div>
<Row type="flex" justify="center">
<MainCol>
<h3>
{props.publicList ? 'Public analyses' : 'Your saved analyses'}
</h3>
<br />
<AnalysisListTable {...props} />
</MainCol>
</Row>
</div>
);
};

export default AnalysisList;

0 comments on commit a99c69b

Please sign in to comment.