Skip to content

Commit

Permalink
docs: update styleguide build and add missing descriptions/examples
Browse files Browse the repository at this point in the history
fix #64
  • Loading branch information
erichartline committed Nov 30, 2018
1 parent 99dd62e commit 0f56519
Show file tree
Hide file tree
Showing 16 changed files with 16,349 additions and 46,726 deletions.
63,003 changes: 16,283 additions & 46,720 deletions docs/build/bundle.6afc6367.js → docs/build/bundle.f88a2a79.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>Genomepage Style Guide</title></head><body><div id="rsg-root"></div><script src="build/bundle.6afc6367.js"></script></body></html>
<!DOCTYPE html><html><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>Genomepage Style Guide</title></head><body><div id="rsg-root"></div><script src="build/bundle.f88a2a79.js"></script></body></html>
4 changes: 4 additions & 0 deletions src/app/routes/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import AuthLoader from "features/Authentication/AuthLoader"
import Logout from "features/Authentication/Logout"
import PageNotReady from "common/components/PageNotReady"

/**
* List of routes used with React Router.
*/

// Switch is used to only render the first Route that matches the current location
const Routes = () => (
<Switch>
Expand Down
5 changes: 4 additions & 1 deletion src/common/components/ErrorBoundary.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { withStyles } from "@material-ui/core/styles"

import sadDicty from "images/sad-dicty.png"

// eslint-disable-next-line
const styles = theme => ({
gridContainer: {
marginTop: "33px",
Expand All @@ -23,6 +22,10 @@ const styles = theme => ({
},
})

/**
* This is an ErrorBoundary wrapper that catches any JavaScript errors and provides a fallback UI.
*/

class ErrorBoundary extends Component {
state = { error: null, errorInfo: null }

Expand Down
2 changes: 1 addition & 1 deletion src/common/components/ErrorPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ type Props = {
}

/**
* General error handling page
* General error handling page. It displays different messages based on HTTP status code.
*/

export const ErrorPage = (props: Props) => {
Expand Down
4 changes: 4 additions & 0 deletions src/common/components/PageHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ const titleConverter = path => {
return "Gene Information"
}

/**
* Basic page header for all gene pages.
*/

const PageHeader = (props: Props) => {
const { name, match } = props

Expand Down
4 changes: 4 additions & 0 deletions src/common/components/TypographyWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
import React from "react"
import Typography from "@material-ui/core/Typography"

/**
* This is a basic typography wrapper for consistent Material-UI styling.
*/

const TypographyWrapper = ({ children }: any) => (
<Typography component="div">{children}</Typography>
)
Expand Down
2 changes: 1 addition & 1 deletion src/common/components/panels/LeftDisplay.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
```js
<LeftDisplay title="Molecular Function" />
<LeftDisplay>Molecular Function</LeftDisplay>
```
10 changes: 10 additions & 0 deletions src/features/Authentication/Login.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
```js
const Provider = require("react-redux").Provider
const createStore = require("redux").createStore
const reducers = require("../../app/reducers/rootReducer").default

let store = createStore(reducers)
;<Provider store={store}>
<Login location={{}} />
</Provider>
```
9 changes: 8 additions & 1 deletion src/features/Ontology/InnerGoPanel.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
```js
const Provider = require("react-redux").Provider
const createStore = require("redux").createStore
const reducers = require("../../app/reducers/rootReducer").default
const data = require("./mockData").data
;<InnerGoPanel goaData={data} />

let store = createStore(reducers)
;<Provider store={store}>
<InnerGoPanel goaData={data} />
</Provider>
```
5 changes: 5 additions & 0 deletions src/features/Ontology/OntologyLoader.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @flow
import React from "react"
import Skeleton, { SkeletonTheme } from "react-loading-skeleton"
import AppBar from "@material-ui/core/AppBar"
Expand All @@ -22,6 +23,10 @@ const skeletonTheme = createMuiTheme({
},
})

/**
* Loading screen for GO page
*/

const OntologyLoader = () => (
<div>
<PageHeader />
Expand Down
9 changes: 8 additions & 1 deletion src/features/Ontology/Table/DisplayTable.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
```js
const Provider = require("react-redux").Provider
const createStore = require("redux").createStore
const reducers = require("../../../app/reducers/rootReducer").default
const data = require("../mockData").data
;<DisplayTable goaData={data} />

let store = createStore(reducers)
;<Provider store={store}>
<DisplayTable goaData={data} />
</Provider>
```
4 changes: 4 additions & 0 deletions src/features/Summary/Panels/GoaPanelContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ type Props = {
item: Object,
}

/**
* The content that goes in the right side of the GOA panel on the summary page.
*/

const GoaPanelContent = (props: Props) => {
const { item, classes } = props

Expand Down
5 changes: 5 additions & 0 deletions src/features/Summary/SummaryContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ type Props = {
identifier: Boolean,
}

/**
* This is the master container component for the Gene Summary tab.
* It generates the list of tabs and panels needed to display and fetches data.
*/

export class SummaryContainer extends Component<Props> {
componentDidMount() {
const { fetchGeneralData, match, identifier } = this.props
Expand Down
5 changes: 5 additions & 0 deletions src/features/Summary/SummaryLoader.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
// @flow
import React from "react"
import Skeleton, { SkeletonTheme } from "react-loading-skeleton"
import AppBar from "@material-ui/core/AppBar"
import Tabs from "@material-ui/core/Tabs"
import Tab from "@material-ui/core/Tab"
import PageHeader from "common/components/PageHeader"

/**
* Loading screen for Summary page
*/

const SummaryLoader = () => (
<div>
<PageHeader />
Expand Down
2 changes: 2 additions & 0 deletions styleguide.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ module.exports = {
"src/common/utils/*.js",
"src/features/Ontology/utils/*.js",
"src/features/Ontology/Table/utils/*.js",
"src/features/ProteinInformation/*.js",
"src/features/ProteinInformation/Tables/*.js",
"src/styles/*.js",
"src/index.js",
"src/registerServiceWorker.js",
Expand Down

0 comments on commit 0f56519

Please sign in to comment.