-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
514 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
assets/bundles/ | ||
assets/webpack_bundles/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ __pycache__/ | |
|
||
# coverage result | ||
.coverage | ||
/coverage/ | ||
|
||
# pycharm | ||
.idea | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[[source]] | ||
|
||
url = "https://pypi.python.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
|
||
[dev-packages] | ||
django-debug-toolbar = "*" | ||
django-debug-toolbar-request-history = "*" | ||
django-naomi = "*" | ||
fixmydjango = "*" | ||
model-mommy = "*" | ||
pre_commit = "*" | ||
|
||
|
||
|
||
[packages] | ||
|
||
Django = ">=1,<2" | ||
celery = {extras = ["redis"]} | ||
django-model-utils = "*" | ||
django-webpack-loader = "*" | ||
django-js-reverse = "*" | ||
django-import-export = "*" | ||
python-decouple = "*" | ||
"psycopg2" = "*" | ||
brotlipy = "*" | ||
django-log-request-id = "*" | ||
dj-database-url = "*" | ||
gunicorn = "*" | ||
opbeat = "*" | ||
whitenoise = "*" | ||
bandit = "*" | ||
coverage = "*" | ||
astroid = "<1.6" | ||
pylint = "<1.8" | ||
prospector = {extras = ["with-vulture"]} | ||
isort = "*" | ||
safety = "*" | ||
ipython = "*" | ||
|
||
|
||
[requires] | ||
|
||
python_version = "3.6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
assets/js/app/example-app/components/ColorChanger/ColorChanger.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import ColorDisplay from '../ColorDisplay'; | ||
|
||
import './style.scss'; | ||
|
||
|
||
class ColorChanger extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
|
||
this.state = { | ||
color: 'black', | ||
}; | ||
|
||
this.handleChangeColor = this.handleChangeColor.bind(this); | ||
} | ||
|
||
handleChangeColor(e) { | ||
const color = e.target.value; | ||
this.setState({ color }); | ||
} | ||
|
||
render() { | ||
const { title } = this.props; | ||
|
||
return ( | ||
<div className="main-container"> | ||
<h2>{title}</h2> | ||
<h3 className="app-name">Color Changer App</h3> | ||
<p> | ||
Check this example app: change the color to see it reflected in the text next to it. | ||
</p> | ||
|
||
<div className="inner-container"> | ||
<select className="color-picker" onChange={this.handleChangeColor}> | ||
<option value="black">Black</option> | ||
<option value="green">Green</option> | ||
<option value="red">Red</option> | ||
<option value="blue">Blue</option> | ||
<option value="purple">Purple</option> | ||
</select> | ||
|
||
<ColorDisplay color={this.state.color} /> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
ColorChanger.defaultProps = { | ||
title: 'React App Loaded!', | ||
}; | ||
|
||
ColorChanger.propTypes = { | ||
title: PropTypes.string, | ||
}; | ||
|
||
export default ColorChanger; |
28 changes: 28 additions & 0 deletions
28
assets/js/app/example-app/components/ColorChanger/__tests__/ColorChanger.snaps.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
|
||
import ColorChanger from '../ColorChanger'; | ||
|
||
jest.mock('../../ColorDisplay/ColorDisplay'); | ||
|
||
|
||
describe('ColorChanger', () => { | ||
let Component; | ||
let tree; | ||
|
||
test('Some title', () => { | ||
Component = renderer.create( | ||
<ColorChanger title="This is a test title" />); | ||
|
||
tree = Component.toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
test('No title (should use default)', () => { | ||
Component = renderer.create( | ||
<ColorChanger />); | ||
|
||
tree = Component.toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
}); |
113 changes: 113 additions & 0 deletions
113
...ample-app/components/ColorChanger/__tests__/__snapshots__/ColorChanger.snaps.spec.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ColorChanger No title (should use default) 1`] = ` | ||
<div | ||
className="main-container" | ||
> | ||
<h2> | ||
React App Loaded! | ||
</h2> | ||
<h3 | ||
className="app-name" | ||
> | ||
Color Changer App | ||
</h3> | ||
<p> | ||
Check this example app: change the color to see it reflected in the text next to it. | ||
</p> | ||
<div | ||
className="inner-container" | ||
> | ||
<select | ||
className="color-picker" | ||
onChange={[Function]} | ||
> | ||
<option | ||
value="black" | ||
> | ||
Black | ||
</option> | ||
<option | ||
value="green" | ||
> | ||
Green | ||
</option> | ||
<option | ||
value="red" | ||
> | ||
Red | ||
</option> | ||
<option | ||
value="blue" | ||
> | ||
Blue | ||
</option> | ||
<option | ||
value="purple" | ||
> | ||
Purple | ||
</option> | ||
</select> | ||
<span> | ||
ColorDisplay | ||
{"color":"black"} | ||
</span> | ||
</div> | ||
</div> | ||
`; | ||
|
||
exports[`ColorChanger Some title 1`] = ` | ||
<div | ||
className="main-container" | ||
> | ||
<h2> | ||
This is a test title | ||
</h2> | ||
<h3 | ||
className="app-name" | ||
> | ||
Color Changer App | ||
</h3> | ||
<p> | ||
Check this example app: change the color to see it reflected in the text next to it. | ||
</p> | ||
<div | ||
className="inner-container" | ||
> | ||
<select | ||
className="color-picker" | ||
onChange={[Function]} | ||
> | ||
<option | ||
value="black" | ||
> | ||
Black | ||
</option> | ||
<option | ||
value="green" | ||
> | ||
Green | ||
</option> | ||
<option | ||
value="red" | ||
> | ||
Red | ||
</option> | ||
<option | ||
value="blue" | ||
> | ||
Blue | ||
</option> | ||
<option | ||
value="purple" | ||
> | ||
Purple | ||
</option> | ||
</select> | ||
<span> | ||
ColorDisplay | ||
{"color":"black"} | ||
</span> | ||
</div> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import ColorChanger from './ColorChanger'; | ||
|
||
export default ColorChanger; |
19 changes: 19 additions & 0 deletions
19
assets/js/app/example-app/components/ColorChanger/style.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.main-container { | ||
border: 1px dashed grey; | ||
margin: 5px; | ||
padding: 5px; | ||
|
||
.app-name { | ||
color: red; | ||
padding-top: 20px; | ||
} | ||
|
||
.inner-container { | ||
margin: 0; | ||
padding: 5px; | ||
|
||
.color-picker { | ||
margin: 0px 5px 0px 5px; | ||
} | ||
} | ||
} |
Oops, something went wrong.