Skip to content

Commit a721e62

Browse files
author
Rodolfo Carvalho
authored
Merge pull request #29 from rscarvalho/rodolfo/react-bootstrap
Added the basic bootstrap skeleton for the app
2 parents e39e1ef + 2f71948 commit a721e62

File tree

15 files changed

+439
-99
lines changed

15 files changed

+439
-99
lines changed

.travis.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ python:
33
- '3.4'
44

55
node_js:
6-
- 0.10.13
6+
- 8.6.0
77

8-
ruby:
9-
- 1.9.3-p429
8+
cache:
9+
yarn: true
10+
pip: true
11+
directories:
12+
- ui/node_modules
1013

1114
before_install:
1215
# Workaround for a permissions issue with Travis virtual machine images
@@ -16,12 +19,17 @@ before_install:
1619
- sudo ln -s /run/shm /dev/shm
1720

1821
install:
22+
# pip is not able to install distribute: "ImportError: No module named _markerlib"
23+
- easy_install distribute
1924
- pip install -qr requirements.txt
2025
- pip install -qr requirements-dev.txt
21-
- ./install_assets_deps.sh
22-
- grunt clean build
26+
- ls -la
27+
- cd ./ui
28+
- yarn install --frozen-lockfile
29+
- cd ..
2330

2431
script:
2532
- nosetests -c nose.cfg --verbosity=1
26-
- grunt test
27-
33+
- cd ./ui
34+
- yarn test
35+
- cd ..

ui/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6+
"bootstrap": "^3.3.7",
67
"key-mirror": "^1.0.1",
78
"react": "^16.1.0",
9+
"react-bootstrap": "^0.31.5",
810
"react-dom": "^16.1.0",
911
"react-redux": "^5.0.6",
1012
"react-scripts": "1.0.17",
1113
"redux": "^3.7.2",
1214
"redux-actions": "^2.2.1"
1315
},
1416
"devDependencies": {
17+
"enzyme": "^3.1.1",
18+
"enzyme-adapter-react-16": "^1.0.4",
1519
"eslint-config-react-app": "^2.0.1"
1620
},
1721
"scripts": {

ui/public/favicon.ico

-1.91 KB
Binary file not shown.

ui/public/index.html

Lines changed: 60 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6-
<meta name="theme-color" content="#000000">
7-
<!--
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7+
<meta name="theme-color" content="#000000">
8+
9+
<meta name="keywords" content="python, regex, regexp, regular expression, regular expressions, text, linguistic, text analyzer">
10+
<meta name="description" content="PyRegex is a online regular expression tester to check validity of regular expressions in the Python language regex subset.">
11+
<meta name="author" content="Rodolfo Carvalho ([email protected])">
12+
<!--
813
manifest.json provides metadata used when your web app is added to the
914
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
1015
-->
11-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
12-
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
13-
<!--
16+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
17+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
18+
<link href='http://fonts.googleapis.com/css?family=Ubuntu:300,400,700' rel='stylesheet' type='text/css'>
19+
20+
<!--
1421
Notice the use of %PUBLIC_URL% in the tags above.
1522
It will be replaced with the URL of the `public` folder during the build.
1623
Only files inside the `public` folder can be referenced from the HTML.
@@ -19,22 +26,51 @@
1926
work correctly both with client-side routing and a non-root public URL.
2027
Learn how to configure a non-root public URL by running `npm run build`.
2128
-->
22-
<title>React App</title>
23-
</head>
24-
<body>
25-
<noscript>
26-
You need to enable JavaScript to run this app.
27-
</noscript>
28-
<div id="root"></div>
29-
<!--
30-
This HTML file is a template.
31-
If you open it directly in the browser, you will see an empty page.
29+
<title>PyRegex</title>
30+
</head>
3231

33-
You can add webfonts, meta tags, or analytics to this file.
34-
The build step will place the bundled scripts into the <body> tag.
32+
<body>
33+
<noscript>
34+
You need to enable JavaScript to run this app.
35+
</noscript>
36+
<div id="root"></div>
37+
<footer class="main">&nbsp;
38+
<div class="container">
39+
<p>
40+
Made by
41+
<a href="https://www.github.com/rscarvalho">Rodolfo Carvalho</a>
42+
(
43+
<a href="https://www.github.com/rscarvalho">@rscarvalho</a>)
44+
<span class="footer__featured-separator">
45+
&#9679;
46+
</span>
47+
Inspired by
48+
<a href="http://rubular.com"> Rubular</a>
49+
<br/> Code licensed under the
50+
<a href="https://www.gnu.org/licenses/gpl-2.0.html#SEC1">GNU General Public License version 2</a>
51+
<p>
52+
<a href="https://www.heroku.com" title="Hosted by Heroku">
53+
<img src="https://logos.heroku.com/images/heroku-logo-light-88x31.png" alt="Hosted by Heroku" />
54+
</a>
55+
<span class="footer__featured-separator">
56+
&#9679;
57+
</span>
58+
<a href="https://travis-ci.org/rscarvalho/pyregex" title="Tested with Travis CI">
59+
<img src="https://travis-ci.org/rscarvalho/pyregex.png?branch=master" alt="Travis CI Status">
60+
</a>
61+
<span class="footer__featured-separator">
62+
&#9679;
63+
</span>
64+
<a href="http://www.python.org" title="Python Powered">
65+
<img src="https://www.python.org/static/community_logos/python-powered-w-70x28.png" alt="Python Powered">
66+
</a>
67+
</p>
68+
</div>
69+
</footer>
70+
<a href="https://github.com/rscarvalho/pyregex" class="hidden-sm hidden-xs">
71+
<img style="position: absolute; top: 0; right: 0; border: 0; z-index: 999999" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"
72+
alt="Fork me on GitHub">
73+
</a>
74+
</body>
3575

36-
To begin the development, run `npm start` or `yarn start`.
37-
To create a production bundle, use `npm run build` or `yarn build`.
38-
-->
39-
</body>
4076
</html>

ui/src/App.css

Lines changed: 0 additions & 28 deletions
This file was deleted.

ui/src/App.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

ui/src/components/App.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import Col from 'react-bootstrap/lib/Col';
2+
import Grid from 'react-bootstrap/lib/Grid';
3+
import NavBar from './NavBar';
4+
import React from 'react';
5+
import Row from 'react-bootstrap/lib/Row';
6+
7+
export default function App() {
8+
return (
9+
<div className="app">
10+
<NavBar />
11+
<Grid fluid>
12+
<Row>
13+
<Col size={12}>The rest of the app goes here</Col>
14+
</Row>
15+
</Grid>
16+
</div>
17+
);
18+
}

ui/src/components/NavBar.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import MenuItem from 'react-bootstrap/lib/MenuItem';
2+
import Nav from 'react-bootstrap/lib/Nav';
3+
import NavDropdown from 'react-bootstrap/lib/NavDropdown';
4+
import NavItem from 'react-bootstrap/lib/NavItem';
5+
import Navbar from 'react-bootstrap/lib/Navbar';
6+
import React from 'react';
7+
8+
export default function NavBar() {
9+
return (
10+
<Navbar inverse collapseOnSelect fixedTop>
11+
<Navbar.Header>
12+
<Navbar.Brand>
13+
<a href="/">
14+
<span class="logo">.*</span> PyRegex
15+
</a>
16+
</Navbar.Brand>
17+
<Navbar.Toggle />
18+
</Navbar.Header>
19+
<Navbar.Collapse>
20+
<Nav>
21+
<NavItem eventKey="home" href="#">
22+
Home
23+
</NavItem>
24+
<NavItem eventKey="changelog" href="#">
25+
Changelog
26+
</NavItem>
27+
<NavDropdown eventKey="help" title="Help" id="topnav-dropdown-help">
28+
<MenuItem eventKey="help-documentation">
29+
Official Python Documentation
30+
</MenuItem>
31+
</NavDropdown>
32+
<NavDropdown
33+
eventKey="contribute"
34+
title="Contribute"
35+
id="topnav-dropdown-contribute"
36+
>
37+
<MenuItem eventKey="contribute-develop">Develop</MenuItem>
38+
<MenuItem eventKey="contribute-donate">Donate</MenuItem>
39+
</NavDropdown>
40+
</Nav>
41+
</Navbar.Collapse>
42+
</Navbar>
43+
);
44+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import App from '../App';
2+
import NavBar from '../NavBar';
3+
import React from 'react';
4+
import { shallow } from 'enzyme';
5+
6+
describe('components/App', () => {
7+
it('renders the NavBar', () => {
8+
const wrapper = shallow(<App />);
9+
10+
expect(wrapper.find(NavBar)).toHaveLength(1);
11+
});
12+
});

ui/src/images/pyregex.svg

Lines changed: 8 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)