Skip to content

Commit

Permalink
refactor(application structure): flattened the whole structure
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardIvan committed Jun 16, 2016
1 parent 405ae15 commit 5cea01d
Show file tree
Hide file tree
Showing 25 changed files with 54 additions and 58 deletions.
5 changes: 4 additions & 1 deletion .tern-project
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"libs": [
"browser"
],
"loadEagerly": [
"./app"
],
"plugins": {
"complete_strings": {},
"modules": {},
Expand All @@ -11,4 +14,4 @@
"fullDocs": true
}
}
}
}
4 changes: 3 additions & 1 deletion app/js/components/Main/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
'use strict'

import m from 'mithril'
import ToolbarContainer from '../../containers/Root/Main/Toolbar'

// TODO remove this toolbar from the presentational component and pass it down from container
import ToolbarContainer from '../../containers/Toolbar'
import styles from './style.scss'

const Main = {
Expand Down
18 changes: 9 additions & 9 deletions app/js/components/Table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ const Table = {
},
m(`ul.${styles.contentColumn}`, [
m(`li.${styles.header}`, m('p', column)),
vdom.attrs.issues.map((issue, i) => {
return m(`li.${styles.row}`,
{
class: (i % 2 !== 0) ? `${styles.dimmed}` : '',
},
m('p', issue[index]))
// issue.map((field) => m('li', m('p', field)))
}),
]))
vdom.attrs.issues.map((issue, i) => {
return m(`li.${styles.row}`,
{
class: (i % 2 !== 0) ? `${styles.dimmed}` : '',
},
m('p', issue[index]))
// issue.map((field) => m('li', m('p', field)))
}),
]))
}),
])
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

import m from 'mithril'
import DataComponent from '../../../../components/Data'
import DataComponent from '../components/Data'

import TableContainer from './Table'
// import PaginationContainer from './Pagination'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

import m from 'mithril'
import GeospacialComponent from '../../../../components/Geospacial'
import GeospacialComponent from '../components/Geospacial'

const Geospacial = {
view() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

import m from 'mithril'
import GraphComponent from '../../../../components/Graph'
import GraphComponent from '../components/Graph'

const Graph = {
view() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import m from 'mithril'
// import {getEntityById, isPending} from '../selectors';
// import {fetchRepo, showMessage} from '../actions';
// import styles from './style.scss'
import MainComponent from '../../../components/Main'
import { retrieveContainer } from '../../../helpers'
import MainComponent from '../components/Main'
import { retrieveContainer } from '../helpers'

const Main = {
view(vdom) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
'use strict'

import m from 'mithril'
import NavbarComponent from '../../components/Navbar'
import NavbarComponent from '../components/Navbar'

import mapIcon from '../../../svg/map-icon'
import graphIcon from '../../../svg/graph-icon'
import dataIcon from '../../../svg/data-icon'
import mapIcon from '../../svg/map-icon'
import graphIcon from '../../svg/graph-icon'
import dataIcon from '../../svg/data-icon'

const icons = [mapIcon, graphIcon, dataIcon]

Expand Down
8 changes: 4 additions & 4 deletions app/js/containers/Root/index.js → app/js/containers/Root.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

import { configureStore } from '../../store'
import { configureStore } from '../store'
// this configure store function takes in initial state
// we can store this persistent state in indexdb and reload it on next app
// initialtion
Expand All @@ -12,16 +12,16 @@ import { configureStore } from '../../store'
const store = configureStore()

// import 'normalize-css'
import '../global-style.scss'
import '../../../fonts/Roboto-Regular.ttf'
import './global-style.scss'
import '../../fonts/Roboto-Regular.ttf'

import m from 'mithril'

import Toolbar from './Toolbar'
import Navbar from './Navbar'
import Main from './Main'

import styles from '../../components/styles.scss'
import styles from '../components/styles.scss'

const Root = {
view(vnode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import m from 'mithril'

import TableComponent from '../../../../../../../app/js/components/Table'
import TableComponent from '../components/Table'

import { mockedHeaderColumnNames, mockedIssue } from '../../../../../../../tests/mocks/data'
import { mockedHeaderColumnNames, mockedIssue } from '../../../tests/mocks/data'

// import { mockedIssue } from '../../../../../../../../tests/mocks/data'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

import m from 'mithril'
// import classNames from 'classnames'
import ToolbarComponent from '../../../../components/Toolbar'
import { resolveHeading } from '../../../../helpers'
import ToolbarComponent from '../components/Toolbar'
import { resolveHeading } from '../helpers'
// import {getMessages} from '../selectors'
// import {clearMessage} from '../actions'
// import styles from './style.scss'
import styles from '../../../../components/Toolbar/styles.scss'
import styles from '../components/Toolbar/styles.scss'


const Toolbar = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

import m from 'mithril'
// import classNames from 'classnames'
import ToolbarComponent from '../../../components/Toolbar'
import { resolveHeading } from '../../../helpers'
import ToolbarComponent from '../components/Toolbar'
import { resolveHeading } from '../helpers'
// import {getMessages} from '../selectors'
// import {clearMessage} from '../actions'
// import styles from './style.scss'
import styles from '../../../components/Toolbar/styles.scss'
import styles from '../components/Toolbar/styles.scss'

const Toolbar = {
view(vnode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
'use strict'

import m from 'mithril'
import NavbarComponent from '../../../components/Navbar'
import NavbarComponent from '../components/Navbar'

import mapIcon from '../../../../svg/map-icon'
import graphIcon from '../../../../svg/graph-icon'
import dataIcon from '../../../../svg/data-icon'
import mapIcon from '../../svg/map-icon'
import graphIcon from '../../svg/graph-icon'
import dataIcon from '../../svg/data-icon'

const icons = [mapIcon, graphIcon, dataIcon]

Expand Down
6 changes: 3 additions & 3 deletions app/js/helpers/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import GraphContainer from '../containers/Root/Main/Graph'
import DataContainer from '../containers/Root/Main/Data'
import GeoContainer from '../containers/Root/Main/Geospacial'
import GraphContainer from '../containers/Graph'
import DataContainer from '../containers/Data'
import GeoContainer from '../containers/Geo'

export function retrieveContainer(route) {
switch (route) {
Expand Down
Binary file removed dist/build/ac3f799d5bbaf5196fab15ab8de8431c.ttf
Binary file not shown.
2 changes: 0 additions & 2 deletions dist/build/css/main.css

This file was deleted.

1 change: 0 additions & 1 deletion dist/build/css/main.css.map

This file was deleted.

5 changes: 0 additions & 5 deletions dist/build/js/index.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/build/js/index.js.map

This file was deleted.

6 changes: 3 additions & 3 deletions tests/app/js/components/main.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import mq from 'mithril-query'

import Main from '../../../../app/js/components/Main'

import GeospacialContainer from '../../../../app/js/containers/Root/Main/Geospacial'
import Data from '../../../../app/js/containers/Root/Main/Data'
import Graph from '../../../../app/js/containers/Root/Main/Graph'
import GeospacialContainer from '../../../../app/js/containers/Geo'
import Data from '../../../../app/js/containers/Data'
import Graph from '../../../../app/js/containers/Graph'

describe('main component', () => {
it('should display geospacial view', () => {
Expand Down
Empty file.
Loading

0 comments on commit 5cea01d

Please sign in to comment.