Skip to content

Commit a557bf8

Browse files
authored
Merge pull request #5 from topcoderinc/dev
Dev +map and mission and 3 and 4
2 parents 5ae6e01 + 047430b commit a557bf8

File tree

148 files changed

+3908
-200
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+3908
-200
lines changed

.eslintrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"no-script-url": 0,
2222
"max-len": 0,
2323
"new-cap": 0,
24-
"object-curly-spacing": 0,
24+
"object-curly-spacing": ["error", "always"],
2525
"react/jsx-no-bind": 0,
2626
"no-mixed-operators": 0,
2727
"arrow-parens": [
@@ -41,6 +41,6 @@
4141
"jsx-a11y/label-has-for": 0,
4242
"no-plusplus": 0,
4343
"jsx-a11y/no-static-element-interactions": 0,
44-
"no-use-before-define": ["error", { "functions": false, "classes": true }]
44+
"no-use-before-define": ["error", { "functions": false, "classes": true }],
4545
}
4646
}

README.md

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# dsp-fronted
1+
## DSP app
22

33
## Requirements
44
* node v6 (https://nodejs.org)
55

66
## Quick Start
7-
* `npm install -g nodemon`
87
* `npm install`
98
* `npm run dev`
109
* Navigate browser to `http://localhost:3000`
@@ -18,6 +17,7 @@ See Guild https://github.com/lorenwest/node-config/wiki/Configuration-Files
1817
|----|-----------|
1918
|`PORT`| The port to listen|
2019
|`GOOGLE_API_KEY`| The google api key see (https://developers.google.com/maps/documentation/javascript/get-api-key#key)|
20+
|`API_BASE_URL`| The base URL for Drone API |
2121

2222

2323
## Install dependencies
@@ -36,23 +36,3 @@ See Guild https://github.com/lorenwest/node-config/wiki/Configuration-Files
3636

3737
## Google Map
3838
In this project module [react-google-maps](https://github.com/tomchentw/react-google-maps) is used to work with google maps. So it can be used for any new functionality.
39-
40-
# Challenges
41-
42-
## [30055900](https://www.topcoder.com/challenge-details/30055900)
43-
## DONE
44-
- All modules were rewritten almost from the scratch because the previous code was very buggy, hard to support and too far from the redux way which is used in the new project. This was the biggest job. Current code is much more robust and is 99% stateless.
45-
- For most important parts detailed unit tests are written.
46-
- Redrawing mission on the map was optimised, no unnecessary redrawing.
47-
- Readme file was cleaned and updated with information about tests and module used to implement google maps for future developers.
48-
49-
## ADDITIONALLY
50-
- These small things from `kbowerma` was added:
51-
- - I know this was not in the challenge req but another thing that would be nice is if the label for PARAM4 changed to “Heading” only if NAV_WAYPOINT is selected. and PARAMA1 label changed to “hold time” only if NAV_WAYPOINT is selected.
52-
- - IT should be, but home and take off should be pinned together with the first click, but then should be able to be dragged or updated with text separately
53-
- All modules integrated with current project styles.
54-
- Test environment was set up. It uses `Mocha`, `Chai` and `Enzyme`. Also, it supports `jsx`, `css-modules` and `webpack resolve aliases`. Even though it's implicitly the scope of the challenge, it was a tangible part.
55-
56-
## NOTES
57-
- As there is no Authorization implemented in the project. In the API I've hardcoded automatic registering and authorization of a dumb user to make requests to the server.
58-
- A lot of files in the repository had the `crlf` line endings. Though `eslint` and `.editorconfig` prescribe using `lf` line endings. So all files were converted to `lf` line endings to pass the linting process and follow configuration.

config/default.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
* Main config file
44
*/
55
module.exports = {
6+
// below env variables are NOT visible in frontend
67
PORT: process.env.PORT || 3000,
8+
9+
// below env variables are visible in frontend
710
GOOGLE_API_KEY: process.env.GOOGLE_API_KEY || 'AIzaSyCrL-O319wNJK8kk8J_JAYsWgu6yo5YsDI',
8-
//API_BASE_PATH: process.env.API_BASE_PATH || 'http://localhost:3000',
911
API_BASE_PATH: process.env.API_BASE_PATH || 'https://kb-dsp-server-dev.herokuapp.com',
1012
};

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"copy-webpack-plugin": "^4.0.0",
3333
"cross-env": "^3.1.2",
3434
"css-loader": "^0.23.0",
35+
"dateformat": "^2.0.0",
3536
"express": "^4.14.0",
3637
"extract-text-webpack-plugin": "^1.0.1",
3738
"file-loader": "^0.9.0",
@@ -43,6 +44,7 @@
4344
"json-loader": "^0.5.4",
4445
"lodash": "^4.16.4",
4546
"moment": "^2.17.0",
47+
"node-js-marker-clusterer": "^1.0.0",
4648
"node-sass": "^3.7.0",
4749
"postcss-flexboxfixer": "0.0.5",
4850
"postcss-loader": "^0.13.0",
@@ -55,12 +57,18 @@
5557
"react-flexbox-grid": "^0.10.2",
5658
"react-google-maps": "^6.0.1",
5759
"react-modal": "^1.5.2",
60+
"react-flexbox-grid": "^0.10.2",
61+
"react-highcharts": "^11.0.0",
62+
"react-modal": "^1.5.2",
5863
"react-redux": "^4.0.0",
5964
"react-redux-toastr": "^4.2.2",
6065
"react-router": "^2.8.1",
6166
"react-router-redux": "^4.0.0",
6267
"react-select": "^1.0.0-rc.2",
6368
"react-simple-dropdown": "^1.1.5",
69+
"react-slick": "^0.14.5",
70+
"react-star-rating-component": "^1.2.2",
71+
"react-timeago": "^3.1.3",
6472
"redbox-react": "^1.2.10",
6573
"redux": "^3.0.0",
6674
"redux-actions": "^0.10.1",
@@ -69,6 +77,7 @@
6977
"redux-logger": "^2.6.1",
7078
"redux-thunk": "^2.0.0",
7179
"sass-loader": "^4.0.0",
80+
"socket.io-client": "^1.7.1",
7281
"style-loader": "^0.13.0",
7382
"superagent": "^2.3.0",
7483
"superagent-promise": "^1.1.0",

src/components/Accordion/Accordion.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import CSSModules from 'react-css-modules';
44
import cn from 'classnames';
55
import styles from './Accordion.scss';
66

7-
export const Accordion = ({onToggleExpand, isExpanded, children, title}) => (
8-
<div styleName={cn('accordion', {expanded: isExpanded})}>
7+
export const Accordion = ({ onToggleExpand, isExpanded, children, title }) => (
8+
<div styleName={cn('accordion', { expanded: isExpanded })}>
99
<div styleName="title" onClick={() => onToggleExpand(!isExpanded)}>
1010
{title}
1111
</div>
@@ -20,6 +20,6 @@ Accordion.propTypes = {
2020
title: PropTypes.any,
2121
};
2222

23-
export default uncontrollable(CSSModules(Accordion, styles, {allowMultiple: true}), {
23+
export default uncontrollable(CSSModules(Accordion, styles, { allowMultiple: true }), {
2424
isExpanded: 'onToggleExpand',
2525
});
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import React, { PropTypes } from 'react';
2+
import CSSModules from 'react-css-modules';
3+
import { Link } from 'react-router';
4+
import styles from './Breadcrumb.scss';
5+
6+
export const Breadcrumb = ({ items }) => (
7+
<ul styleName="breadcrumb">
8+
{items.map((item, index) => (
9+
<li styleName="item" key={index}>
10+
{item.path
11+
? <Link to={item.path}>{item.text}</Link>
12+
: <span key={index}>{item.text}</span>}
13+
</li>
14+
))}
15+
</ul>
16+
);
17+
18+
const BreadcrumbItemPropType = {
19+
text: PropTypes.string.isRequired,
20+
path: PropTypes.string,
21+
};
22+
23+
Breadcrumb.propTypes = {
24+
items: PropTypes.arrayOf(
25+
PropTypes.shape(BreadcrumbItemPropType)
26+
).isRequired,
27+
};
28+
29+
export default CSSModules(Breadcrumb, styles);
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
.breadcrumb {
2+
background-color: #fff;
3+
border-bottom: 1px solid #d8d8d8;
4+
border-top: 1px solid #d8d8d8;
5+
color: #525051;
6+
font-size: 12px;
7+
line-height: 37px;
8+
margin: 0;
9+
padding: 0 30px;
10+
}
11+
12+
.item {
13+
display: inline;
14+
list-style: none;
15+
16+
&:after {
17+
content: '>';
18+
display: inline;
19+
margin-left: 4px;
20+
margin-right: 8px;
21+
}
22+
23+
&:last-child:after {
24+
content: '';
25+
display: none;
26+
}
27+
28+
> a {
29+
color: #525051;
30+
}
31+
32+
> span {
33+
color: #525051;
34+
font-weight: 600;
35+
}
36+
}

src/components/Breadcrumb/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Breadcrumb from './Breadcrumb';
2+
3+
export default Breadcrumb;

src/components/Button/Button.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ Button.defaultProps = {
2121
size: 'normal',
2222
};
2323

24-
export default CSSModules(Button, styles, {allowMultiple: true});
24+
export default CSSModules(Button, styles, { allowMultiple: true });

src/components/DatePicker/DatePicker.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import CSSModules from 'react-css-modules';
33
import { DateField, TransitionView, Calendar } from 'react-date-picker';
44
import styles from './DatePicker.scss';
55

6-
export const DatePicker = ({onChange, value}) => (
6+
export const DatePicker = ({ onChange, value }) => (
77
<div styleName="date-picker">
88
<DateField
99
dateFormat="YYYY-MM-DD hh:mm:ss A"
1010
onChange={onChange}
1111
value={value}
1212
>
1313
<TransitionView>
14-
<Calendar style={{padding: 10}} />
14+
<Calendar style={{ padding: 10 }} />
1515
</TransitionView>
1616
</DateField>
1717
</div>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy