Skip to content

Commit

Permalink
Merge pull request #5 from agl0809/develop
Browse files Browse the repository at this point in the history
Dependencies imports paths modified
  • Loading branch information
agl0809 committed Feb 4, 2018
2 parents 7f296c2 + 7c50a1d commit bf19af5
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 24 deletions.
2 changes: 1 addition & 1 deletion config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = {
appBuild: resolveApp('build'),
appPublic: resolveApp('public'),
appHtml: resolveApp('public/index.html'),
appIndexJs: resolveApp('src/js/index.js'),
appIndexJs: resolveApp('src/index.js'),
appPackageJson: resolveApp('package.json'),
appSrc: resolveApp('src'),
appTest: resolveApp('test'),
Expand Down
1 change: 1 addition & 0 deletions config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ module.exports = {
alias: {
'js': path.resolve('src/js'),
'helpers': path.resolve('src/helpers'),
'services': path.resolve('src/services'),
'style': path.resolve('src/style'),
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
Expand Down
1 change: 1 addition & 0 deletions config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ module.exports = {
alias: {
'js': path.resolve('src/js'),
'helpers': path.resolve('src/helpers'),
'services': path.resolve('src/services'),
'style': path.resolve('src/style'),
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "timeline-history-heatmap-react",
"version": "0.3.0",
"version": "0.4.0",
"private": true,
"dependencies": {
"leaflet": "^1.3.0",
Expand Down Expand Up @@ -51,8 +51,9 @@
"coverage": "node scripts/test.js --env=jsdom --coverage"
},
"jest": {
"verbose": true,
"collectCoverageFrom": [
"src/js/**/*.{js,jsx,mjs}"
"src/**/*.{js,jsx,mjs}"
],
"setupFiles": [
"<rootDir>/config/polyfills.js"
Expand Down
8 changes: 4 additions & 4 deletions __tests__/index.test.js → src/__tests__/index.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {HEATMAP_CONTAINER_ID, LEAFLET_OPTIONS, HEAT_OPTIONS, JSON_FILE_URL} from 'helpers/constants';
import start from 'js/index';
import * as locationHistoryController from 'js/locationHistoryController';
import * as MapController from 'js/mapController';
import {HEATMAP_CONTAINER_ID, LEAFLET_OPTIONS, HEAT_OPTIONS, JSON_FILE_URL} from '../helpers/constants';
import start from '../index';
import * as locationHistoryController from '../locationHistoryController';
import * as MapController from '../mapController';

describe('running up the app', () => {
it('spec name', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {locationHistoryParser} from 'js/locationHistoryParser';
import {locationHistoryParser} from '../locationHistoryParser';

describe('parsing a service response', () => {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {getCoordinates} from 'js/locationHistoryController';
import * as serviceDep from 'js/service';
import * as parserDep from 'js/locationHistoryParser'
import {SCALAR_E7} from 'helpers/constants';
import {getCoordinates} from '../locationHistoryController';
import * as serviceDep from '../services/service';
import * as parserDep from '../locationHistoryParser'
import {SCALAR_E7} from '../helpers/constants';

describe('locationHistoryController', () => {
it('should read the file content', function () {
Expand All @@ -11,7 +11,7 @@ describe('locationHistoryController', () => {
let promise;

serviceDep.service = jest.fn(() => {
return new Promise((resolve, reject) => {
return new Promise((resolve) => {
process.nextTick(
() => resolve(fileContent)
);
Expand Down
4 changes: 2 additions & 2 deletions __tests__/map.test.js → src/__tests__/map.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import LeafMap from "leaflet";
import * as Map from 'js/map';
import * as Map from '../map';

describe('drawing a map', () => {
it('should create a map', () => {
Expand Down Expand Up @@ -31,7 +31,7 @@ describe('drawing a map', () => {
expect(LeafMap.tileLayer).toBeCalledWith(URL_TEMPLATE, TILE_LAYER_OPTIONS);
});

it('should create a heat layer on the map using the coordenates received', () => {
it('should create a heat layer on the map using the coordinates received', () => {
const heatOptions = {
tileOpacity: 'any tileOpacity',
heatOpacity: 'any heatOpacity',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {renderHeatMap} from 'js/mapController';
import * as Map from 'js/map';
import {renderHeatMap} from '../mapController';
import * as Map from '../map';

describe('Map Controller', () => {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {service} from 'js/service';
import {service} from 'services/service';

let ready_state, state;
let oldXMLHttpRequest;
Expand Down
4 changes: 2 additions & 2 deletions src/js/index.js → src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {HEATMAP_CONTAINER_ID, LEAFLET_OPTIONS, HEAT_OPTIONS, JSON_FILE_URL} from 'helpers/constants';
import {getCoordinates} from 'js/locationHistoryController';
import {renderHeatMap} from 'js/mapController';
import {renderHeatMap} from './mapController';
import {getCoordinates} from './locationHistoryController';

export default function start() {
getCoordinates(JSON_FILE_URL)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {locationHistoryParser} from 'js/locationHistoryParser';
import {service} from 'js/service';
import {locationHistoryParser} from './locationHistoryParser';
import {service} from 'services/service';
import {SCALAR_E7} from 'helpers/constants';

function getCoordinates(JSONFileUrl) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {SCALAR_E7} from '../helpers/constants';
import {SCALAR_E7} from 'helpers/constants';

function _getLagLngCoordinates(coordinates) {
return coordinates.map(elem =>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/js/mapController.js → src/mapController.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Map from 'js/map';
import * as Map from './map';

function renderHeatMap(options) {
let map = Map.createMap(options.containerId, options.mapOptions);
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit bf19af5

Please sign in to comment.