Skip to content
This repository has been archived by the owner on Dec 13, 2017. It is now read-only.

Commit

Permalink
Use absolute imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
benoccrp committed Nov 29, 2017
1 parent 4cc42fb commit c148630
Show file tree
Hide file tree
Showing 22 changed files with 45 additions and 45 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NODE_PATH=src
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

# misc
.DS_Store
.env
npm-debug.log*
yarn-debug.log*
yarn-error.log*
Expand Down
8 changes: 4 additions & 4 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import en from 'react-intl/locale-data/en';
import de from 'react-intl/locale-data/de';
import ru from 'react-intl/locale-data/ru';
import es from 'react-intl/locale-data/es';
import translations from './translations.json';
import translations from 'translations.json';

import store from './store'
import store from 'store'

import PageLayout from './screens/PageLayout';
import PageLayout from 'screens/PageLayout';

import './App.css';
import 'App.css';

// have blueprint handle focus properly
FocusStyleManager.onlyShowFocusOnTabs();
Expand Down
2 changes: 1 addition & 1 deletion src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import App from 'App';

it('renders without crashing', () => {
const div = document.createElement('div');
Expand Down
2 changes: 1 addition & 1 deletion src/actions/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {endpoint} from '../api';
import {endpoint} from 'api';

export const fetchCollections = () => (dispatch) => {
const limit = 5000;
Expand Down
2 changes: 1 addition & 1 deletion src/actions/sessionActions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {endpoint} from '../api';
import {endpoint} from 'api';

export const loginWithToken = token => dispatch => {
dispatch({type: 'LOGIN', token});
Expand Down
2 changes: 1 addition & 1 deletion src/api.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from 'axios';
import queryString from 'query-string';
import store from './store';
import store from 'store';

export const endpoint = axios.create({
baseURL: 'http://localhost:5000/api/2',
Expand Down
2 changes: 1 addition & 1 deletion src/components/XhrToast.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {showErrorToast, showSuccessToast} from "./Toast";
import messages from "../messages";
import messages from "messages";

const defaultStatusMap = {
400: messages.status.bad_request,
Expand Down
4 changes: 2 additions & 2 deletions src/components/search/SearchFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { Component } from 'react';
import { connect } from 'react-redux';
import { mapValues, size, xor } from 'lodash';

import { endpoint } from '../../api';
import filters from '../../filters';
import { endpoint } from 'api';
import filters from 'filters';

import SearchFilterCountries from './SearchFilterCountries';
import SearchFilterCollections from './SearchFilterCollections';
Expand Down
2 changes: 1 addition & 1 deletion src/components/search/SearchFilterCollections.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FormattedMessage } from 'react-intl';
import { Button, Checkbox, Dialog, NonIdealState, Spinner } from '@blueprintjs/core';
import { debounce, fromPairs, xor } from 'lodash';

import { endpoint } from '../../api';
import { endpoint } from 'api';

import SearchFilterList from './SearchFilterList';
import SearchFilterText from './SearchFilterText';
Expand Down
2 changes: 1 addition & 1 deletion src/components/search/SearchResultList.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { connect } from 'react-redux';
import { NonIdealState, Spinner } from '@blueprintjs/core';
import Waypoint from 'react-waypoint';

import { fetchNextSearchResults } from '../../actions';
import { fetchNextSearchResults } from 'actions';

import SearchResultListItem from './SearchResultListItem';

Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import App from 'App';

ReactDOM.render(
<App />,
Expand Down
8 changes: 4 additions & 4 deletions src/screens/ActivateScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import {connect} from 'react-redux';
import {Redirect} from 'react-router';
import {injectIntl, FormattedMessage} from 'react-intl';

import {endpoint} from '../api';
import {loginWithPassword} from '../actions/sessionActions';
import {endpoint} from 'api';
import {loginWithPassword} from 'actions/sessionActions';

import {PasswordAuthActivate} from '../components/PasswordAuth';
import {xhrErrorToast} from '../components/XhrToast';
import {PasswordAuthActivate} from 'components/PasswordAuth';
import {xhrErrorToast} from 'components/XhrToast';

class ActivateScreen extends Component {
onActivate(data) {
Expand Down
4 changes: 2 additions & 2 deletions src/screens/CollectionScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { withRouter } from 'react-router';
import { Link } from 'react-router-dom';
import { Icon } from '@blueprintjs/core';

import Breadcrumbs from '../components/Breadcrumbs';
import Article from '../components/Article';
import Breadcrumbs from 'components/Breadcrumbs';
import Article from 'components/Article';
import SearchScreen_ from './SearchScreen';
const SearchScreen = withRouter(SearchScreen_);

Expand Down
4 changes: 2 additions & 2 deletions src/screens/EntityScreen.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';

import Article from '../components/Article';
import { fetchEntity } from '../actions';
import Article from 'components/Article';
import { fetchEntity } from 'actions';

class EntityInfo extends Component {
render() {
Expand Down
8 changes: 4 additions & 4 deletions src/screens/LoginScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import {connect} from 'react-redux'
import {Redirect} from 'react-router';
import {NonIdealState} from '@blueprintjs/core';

import messages from '../messages';
import {loginWithPassword, loginWithToken} from '../actions/sessionActions';
import messages from 'messages';
import {loginWithPassword, loginWithToken} from 'actions/sessionActions';

import OAuthLogin, {handleOAuthCallback} from '../components/OAuthLogin';
import {PasswordAuthLogin} from '../components/PasswordAuth';
import OAuthLogin, {handleOAuthCallback} from 'components/OAuthLogin';
import {PasswordAuthLogin} from 'components/PasswordAuth';

class LoginScreen extends Component {
onLogin(data) {
Expand Down
6 changes: 3 additions & 3 deletions src/screens/LogoutScreen.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, {Component} from 'react';
import {connect} from 'react-redux'
import {logout} from "../actions/sessionActions";
import {logout} from "actions/sessionActions";
import {withRouter} from "react-router";
import {injectIntl} from "react-intl";
import {showSuccessToast} from "../components/Toast";
import messages from "../messages";
import {showSuccessToast} from "components/Toast";
import messages from "messages";

class LogoutScreen extends Component {
componentWillMount() {
Expand Down
4 changes: 2 additions & 2 deletions src/screens/PageLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { Route, Switch } from 'react-router-dom';
import { connect } from 'react-redux';
import { Spinner } from "@blueprintjs/core";

import { fetchCollections, fetchMetadata } from '../actions';
import { fetchCollections, fetchMetadata } from 'actions';

import PageNavbar from '../components/PageNavbar';
import PageNavbar from 'components/PageNavbar';

import SwitchPage from './SwitchPage';
import LoginScreen from "./LoginScreen";
Expand Down
4 changes: 2 additions & 2 deletions src/screens/RootScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { Link } from 'react-router-dom';
import { groupBy, map } from 'lodash';
import { Icon } from '@blueprintjs/core';

import Breadcrumbs from '../components/Breadcrumbs';
import Article from '../components/Article';
import Breadcrumbs from 'components/Breadcrumbs';
import Article from 'components/Article';

import './RootScreen.css';

Expand Down
8 changes: 4 additions & 4 deletions src/screens/SearchScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import queryString from 'query-string';
import { debounce, isEqual, pick, pickBy, isArray } from 'lodash';
import { mergeWith } from 'lodash/fp'; // use fp version to not mutate the array

import { fetchSearchResults } from '../actions';
import filters from '../filters';
import { fetchSearchResults } from 'actions';
import filters from 'filters';

import SearchResultList from '../components/search/SearchResultList';
import SearchFilter from '../components/search/SearchFilter';
import SearchResultList from 'components/search/SearchResultList';
import SearchFilter from 'components/search/SearchFilter';

const defaultQuery = {
'q': '',
Expand Down
10 changes: 5 additions & 5 deletions src/screens/SignupScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import {connect} from 'react-redux';
import {Redirect} from 'react-router';
import {Callout, Intent, NonIdealState} from '@blueprintjs/core';

import messages from '../messages';
import {endpoint} from '../api';
import messages from 'messages';
import {endpoint} from 'api';

import OAuthLogin from '../components/OAuthLogin';
import {PasswordAuthSignup} from '../components/PasswordAuth';
import {xhrErrorToast} from '../components/XhrToast';
import OAuthLogin from 'components/OAuthLogin';
import {PasswordAuthSignup} from 'components/PasswordAuth';
import {xhrErrorToast} from 'components/XhrToast';

class SignupScreen extends Component {
state = {submitted: false};
Expand Down
4 changes: 2 additions & 2 deletions src/store.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {applyMiddleware, createStore} from 'redux';
import thunk from 'redux-thunk';
import logger from 'redux-logger';
import {loadState, saveState} from "./storage";
import {loadState, saveState} from "storage";
import {throttle} from "lodash";

import rootReducer from './reducers';
import rootReducer from 'reducers';

const persistedState = loadState();
const store = createStore(
Expand Down

0 comments on commit c148630

Please sign in to comment.