From f66d201046bf3f4a9b3e893d9458c8c362096c6d Mon Sep 17 00:00:00 2001 From: James Crowley Date: Sat, 20 Apr 2019 15:46:35 +0200 Subject: [PATCH] Enable absolute paths setting NODE_PATH, until create-react-app reaches v4 when we can use baseUrl instead - https://github.com/facebook/create-react-app/issues/6475 --- .eslintrc.json | 4 +-- package.json | 8 ++--- src/__tests__/firestore.rules.test.js | 2 +- src/actions/auth.js | 6 ++-- src/actions/box.js | 4 +-- src/actions/product.js | 6 ++-- src/actions/profile.js | 4 +-- src/commons/HOCs/withAuthentication.js | 4 +-- src/components/AddBoxDialog.js | 2 +- src/components/AppDrawer.js | 2 +- src/components/AppFrame.js | 2 +- src/components/BoxListContainer.js | 4 +-- src/components/CategorySelector.js | 2 +- src/components/CreateOrganizationFlow.js | 6 ++-- src/components/InviteLink.js | 4 +-- src/components/NotFound.js | 14 +++++---- src/components/PasswordChangeForm.js | 2 +- src/components/ProductDialog.js | 4 +-- src/components/ProductSelectorMockup.js | 2 +- src/components/ProductTable.js | 4 +-- src/components/ResetPasswordForm.test.js | 4 +-- src/components/SignInForm.js | 2 +- src/components/SignInForm.test.js | 4 +-- src/components/SignUpForm.test.js | 4 +-- src/containers/components/AddBoxDialog.js | 4 +-- src/containers/components/AddProductDialog.js | 4 +-- src/containers/components/AppDrawerAuth.js | 4 +-- .../components/EditProductDialog.js | 4 +-- .../components/PasswordChangeForm.js | 4 +-- .../components/ProductDeleteConfirm.js | 4 +-- src/containers/components/ProductTable.js | 4 +-- .../components/ResetPasswordForm.js | 4 +-- src/containers/components/SignInForm.js | 4 +-- src/containers/pages/PasswordChangeForm.js | 2 +- src/containers/pages/ResetPasswordPage.js | 2 +- src/containers/pages/SignInPage.js | 2 +- src/pages/BoxesPage.js | 4 +-- src/pages/CreateOrganizationPage.js | 4 +-- src/pages/DashboardPage.js | 6 ++-- src/pages/FindBoxMockupPage.js | 29 ++++--------------- src/pages/HomePage.js | 4 +-- src/pages/InvitePage.js | 6 ++-- src/pages/JoinPage.js | 10 +++---- src/pages/MakeBoxMockupPage.js | 22 ++++---------- src/pages/MockupsPage.js | 2 +- src/pages/PasswordChangePage.js | 6 ++-- src/pages/ProductsPage.js | 8 ++--- src/pages/ResetPasswordPage.js | 4 +-- src/pages/SignInPage.js | 4 +-- src/queries/invites.js | 2 +- src/queries/invites.test.js | 2 +- src/queries/organizations.js | 2 +- src/queries/products.js | 2 +- src/reducers/boxes.js | 2 +- src/reducers/products.js | 2 +- src/reducers/profile.js | 2 +- src/reducers/user.js | 2 +- 57 files changed, 120 insertions(+), 147 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 9dfb4e8..19d2372 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -16,9 +16,7 @@ /* don't allow imports of internal modules */ //"\\./modules/*/**", /* don't allow relative imports that go up the tree */ - //"../**", - /* don't allow ./ imports - instead just use the name */ - //"./**" + "../**" ] } ] diff --git a/package.json b/package.json index fab8b57..b91a43b 100644 --- a/package.json +++ b/package.json @@ -46,10 +46,10 @@ "yarnhook": "^0.4.0" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test --modulePaths=src", - "test-with-coverage": "react-scripts test --modulePaths=src --coverage", + "start": "NODE_PATH=src react-scripts start", + "build": "NODE_PATH=src react-scripts build", + "test": "NODE_PATH=src react-scripts test --modulePaths=src", + "test-with-coverage": "NODE_PATH=src react-scripts test --modulePaths=src --coverage", "upload-coverage-report": "./node_modules/.bin/codecov", "eject": "react-scripts eject", "prettier": "prettier --write \"src/**/*.{js,jsx,json,css}\"", diff --git a/src/__tests__/firestore.rules.test.js b/src/__tests__/firestore.rules.test.js index 57b0fe9..30a2870 100644 --- a/src/__tests__/firestore.rules.test.js +++ b/src/__tests__/firestore.rules.test.js @@ -6,7 +6,7 @@ import * as firestore from "expect-firestore"; let describeButSkipIfNoKey = describe; let serviceAccountKey; try { - serviceAccountKey = require("../../.service-account-key.json"); + serviceAccountKey = require(".service-account-key.json"); } catch (e) { describeButSkipIfNoKey = describe.skip; } diff --git a/src/actions/auth.js b/src/actions/auth.js index c245dfe..ecac8b9 100644 --- a/src/actions/auth.js +++ b/src/actions/auth.js @@ -1,6 +1,6 @@ -import firebase from "../firebase"; -import { handleError } from "../utils"; -import { asyncAction, editAction } from "../commons/utils/action-creators"; +import { handleError } from "utils"; +import { asyncAction, editAction } from "commons/utils/action-creators"; +import firebase from "firebase.js"; import { fetchProfile } from "./profile"; diff --git a/src/actions/box.js b/src/actions/box.js index 6e847a6..75222f9 100644 --- a/src/actions/box.js +++ b/src/actions/box.js @@ -1,5 +1,5 @@ -import firebase, { firestore } from "../firebase"; -import { handleError } from "../utils"; +import { handleError } from "utils"; +import firebase, { firestore } from "firebase.js"; const BOX_ADD_ = TYPE => `BOX_ADD_${TYPE}`; export const BOX_ADD_START = BOX_ADD_`START`; diff --git a/src/actions/product.js b/src/actions/product.js index 85d1cfb..718efba 100644 --- a/src/actions/product.js +++ b/src/actions/product.js @@ -1,11 +1,11 @@ -import firebase, { firestore } from "../firebase"; import { addAction, listAction, editAction, deleteAction -} from "../commons/utils/action-creators"; -import { handleError } from "../utils"; +} from "commons/utils/action-creators"; +import { handleError } from "utils"; +import firebase, { firestore } from "firebase.js"; export const PRODUCT_LIST = listAction("product"); export const PRODUCT_ADD = addAction("product"); diff --git a/src/actions/profile.js b/src/actions/profile.js index 8714ace..fb1d939 100644 --- a/src/actions/profile.js +++ b/src/actions/profile.js @@ -1,5 +1,5 @@ -import { firestore } from "../firebase"; -import { handleError } from "../utils"; +import { handleError } from "utils"; +import { firestore } from "firebase.js"; const FETCH_PROFILE_ = TYPE => `FETCH_PROFILE_${TYPE}`; export const FETCH_PROFILE_START = FETCH_PROFILE_`START`; diff --git a/src/commons/HOCs/withAuthentication.js b/src/commons/HOCs/withAuthentication.js index b99124e..2c2d2ff 100644 --- a/src/commons/HOCs/withAuthentication.js +++ b/src/commons/HOCs/withAuthentication.js @@ -2,8 +2,8 @@ import React, { PureComponent } from "react"; import { connect } from "react-redux"; import { Redirect } from "react-router-dom"; -import { registerAuthStateObserver } from "../../actions/auth"; -import Progress from "../../components/Progress"; +import { registerAuthStateObserver } from "actions/auth"; +import Progress from "components/Progress"; export default function withAuthentication(Comp, FallbackComp) { const mapStateToProps = ({ user, profile }) => ({ user, profile }); diff --git a/src/components/AddBoxDialog.js b/src/components/AddBoxDialog.js index f2517eb..ee148bc 100644 --- a/src/components/AddBoxDialog.js +++ b/src/components/AddBoxDialog.js @@ -2,7 +2,7 @@ import React, { PureComponent } from "react"; import { bool, func } from "prop-types"; import Dialog from "@material-ui/core/Dialog"; -import { ProductsCollection } from "../queries/products"; +import { ProductsCollection } from "queries/products"; import AddBoxForm from "./AddBoxForm"; import AddBoxDone from "./AddBoxDone"; diff --git a/src/components/AppDrawer.js b/src/components/AppDrawer.js index cfbad8c..ad8c1f8 100644 --- a/src/components/AppDrawer.js +++ b/src/components/AppDrawer.js @@ -10,7 +10,7 @@ import Divider from "@material-ui/core/Divider"; import Hidden from "@material-ui/core/Hidden"; import { Link } from "react-router-dom"; -import AppDrawerAuthContainer from "../containers/components/AppDrawerAuth"; +import AppDrawerAuthContainer from "containers/components/AppDrawerAuth"; const styles = theme => ({ logo: { diff --git a/src/components/AppFrame.js b/src/components/AppFrame.js index d9b7d63..63a056d 100644 --- a/src/components/AppFrame.js +++ b/src/components/AppFrame.js @@ -7,7 +7,7 @@ import Toolbar from "@material-ui/core/Toolbar"; import IconButton from "@material-ui/core/IconButton"; import MenuIcon from "@material-ui/icons/Menu"; -import { drawerTheme } from "../theme"; +import { drawerTheme } from "theme"; import AppDrawer from "./AppDrawer"; diff --git a/src/components/BoxListContainer.js b/src/components/BoxListContainer.js index 9f97ad8..4e6a68a 100644 --- a/src/components/BoxListContainer.js +++ b/src/components/BoxListContainer.js @@ -2,8 +2,8 @@ import React from "react"; import { connect } from "react-redux"; import { FirestoreCollection } from "react-firestore"; -import { ProductsCollection } from "../queries/products"; -import { firestore } from "../firebase"; +import { ProductsCollection } from "queries/products"; +import { firestore } from "firebase.js"; import BoxList from "./BoxList"; diff --git a/src/components/CategorySelector.js b/src/components/CategorySelector.js index 6c21be2..038a8e4 100644 --- a/src/components/CategorySelector.js +++ b/src/components/CategorySelector.js @@ -1,6 +1,6 @@ import React from "react"; -import ProductButton from "../components/ProductButton"; +import ProductButton from "components/ProductButton"; const CategorySelector = () => { return ( diff --git a/src/components/CreateOrganizationFlow.js b/src/components/CreateOrganizationFlow.js index c36d258..b01ef67 100644 --- a/src/components/CreateOrganizationFlow.js +++ b/src/components/CreateOrganizationFlow.js @@ -2,9 +2,9 @@ import React from "react"; import Typography from "@material-ui/core/Typography"; import Button from "@material-ui/core/Button"; -import { addOrganization } from "../queries/organizations"; -import { createUserAndProfile } from "../auth"; -import { handleError } from "../utils"; +import { addOrganization } from "queries/organizations"; +import { createUserAndProfile } from "auth"; +import { handleError } from "utils"; import CreateOrganizationForm from "./CreateOrganizationForm"; import SignUpForm from "./SignUpForm"; diff --git a/src/components/InviteLink.js b/src/components/InviteLink.js index a84cff1..f18843d 100644 --- a/src/components/InviteLink.js +++ b/src/components/InviteLink.js @@ -7,8 +7,8 @@ import TextField from "@material-ui/core/TextField"; import Button from "@material-ui/core/Button"; import Snackbar from "@material-ui/core/Snackbar"; -import { getOrAddInvite, createInviteLink } from "../queries/invites"; -import { waitForProfile, handleError } from "../utils"; +import { getOrAddInvite, createInviteLink } from "queries/invites"; +import { waitForProfile, handleError } from "utils"; import Progress from "./Progress.js"; diff --git a/src/components/NotFound.js b/src/components/NotFound.js index bb0fc5a..9b56cc2 100644 --- a/src/components/NotFound.js +++ b/src/components/NotFound.js @@ -1,14 +1,12 @@ -/* eslint-disable */ - import React from "react"; -import AppFrame from "../components/AppFrame"; -import Page from "../components/Page"; import Typography from "@material-ui/core/Typography"; - import { withStyles } from "@material-ui/core/styles"; import Grid from "@material-ui/core/Grid"; import Paper from "@material-ui/core/Paper"; +import Page from "components/Page"; +import AppFrame from "components/AppFrame"; + const styles = theme => ({ div: { display: "block", @@ -39,7 +37,11 @@ class NotFound extends React.Component { - + empty box There is nothing here diff --git a/src/components/PasswordChangeForm.js b/src/components/PasswordChangeForm.js index 86f2618..37a537b 100644 --- a/src/components/PasswordChangeForm.js +++ b/src/components/PasswordChangeForm.js @@ -4,7 +4,7 @@ import { withStyles } from "@material-ui/core/styles"; import { TextField } from "formik-material-ui"; import Typography from "@material-ui/core/Typography"; -import { handleError } from "../utils"; +import { handleError } from "utils"; import ButtonWithProgress from "./ButtonWithProgress"; diff --git a/src/components/ProductDialog.js b/src/components/ProductDialog.js index a296c96..dbedaf5 100644 --- a/src/components/ProductDialog.js +++ b/src/components/ProductDialog.js @@ -1,3 +1,5 @@ +import { CATEGORIES } from "constants/product"; + import React from "react"; import PropTypes from "prop-types"; import { Formik, Field } from "formik"; @@ -11,8 +13,6 @@ import Typography from "@material-ui/core/Typography"; import withMobileDialog from "@material-ui/core/withMobileDialog"; import Slide from "@material-ui/core/Slide"; -import { CATEGORIES } from "../constants/product"; - import DialogToolbar from "./DialogToolbar"; const styles = theme => ({ diff --git a/src/components/ProductSelectorMockup.js b/src/components/ProductSelectorMockup.js index d76683b..1f3642c 100644 --- a/src/components/ProductSelectorMockup.js +++ b/src/components/ProductSelectorMockup.js @@ -1,6 +1,6 @@ import React from "react"; -import ProductButton from "../components/ProductButton"; +import ProductButton from "components/ProductButton"; const ProductSelectorMockup = () => { return ( diff --git a/src/components/ProductTable.js b/src/components/ProductTable.js index 35928b5..14a2165 100644 --- a/src/components/ProductTable.js +++ b/src/components/ProductTable.js @@ -9,8 +9,8 @@ import IconButton from "@material-ui/core/IconButton"; import EditIcon from "@material-ui/icons/Edit"; import DeleteIcon from "@material-ui/icons/Delete"; -import EditProductDialog from "../containers/components/EditProductDialog"; -import ProductDeleteConfirm from "../containers/components/ProductDeleteConfirm.js"; +import EditProductDialog from "containers/components/EditProductDialog"; +import ProductDeleteConfirm from "containers/components/ProductDeleteConfirm.js"; import Progress from "./Progress.js"; diff --git a/src/components/ResetPasswordForm.test.js b/src/components/ResetPasswordForm.test.js index 7e09a09..ae34283 100644 --- a/src/components/ResetPasswordForm.test.js +++ b/src/components/ResetPasswordForm.test.js @@ -1,10 +1,10 @@ import React from "react"; import { mount } from "enzyme"; -import ResetPassword from "./ResetPasswordForm"; - import { setInputFieldValue } from "commons/utils/test-util"; +import ResetPassword from "./ResetPasswordForm"; + describe("ResetPasswordForm", () => { const resetPassword = jest.fn(({ email }) => { Promise.resolve(); diff --git a/src/components/SignInForm.js b/src/components/SignInForm.js index b09f559..1009e36 100644 --- a/src/components/SignInForm.js +++ b/src/components/SignInForm.js @@ -3,7 +3,7 @@ import { withStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; import FormHelperText from "@material-ui/core/FormHelperText"; -import { useMaterialUIForm } from "../hooks/forms"; +import { useMaterialUIForm } from "hooks/forms"; import ButtonWithProgress from "./ButtonWithProgress"; diff --git a/src/components/SignInForm.test.js b/src/components/SignInForm.test.js index f5f8ed7..ad744d1 100644 --- a/src/components/SignInForm.test.js +++ b/src/components/SignInForm.test.js @@ -1,10 +1,10 @@ import React from "react"; import { mount } from "enzyme"; -import SignInFormUnconnected from "./SignInForm"; - import { setInputFieldValue } from "commons/utils/test-util"; +import SignInFormUnconnected from "./SignInForm"; + describe("SignInForm", () => { let component; const userSignIn = jest.fn(({ email, password }) => { diff --git a/src/components/SignUpForm.test.js b/src/components/SignUpForm.test.js index a52df2d..329c970 100644 --- a/src/components/SignUpForm.test.js +++ b/src/components/SignUpForm.test.js @@ -1,10 +1,10 @@ import React from "react"; import { mount } from "enzyme"; -import SignUpFormUnconnected from "./SignUpForm"; - import { setInputFieldValue } from "commons/utils/test-util"; +import SignUpFormUnconnected from "./SignUpForm"; + describe("SignUpForm", () => { const onSubmit = jest.fn(({ name, email, password }) => { Promise.resolve(); diff --git a/src/containers/components/AddBoxDialog.js b/src/containers/components/AddBoxDialog.js index 08518b4..ef6009e 100644 --- a/src/containers/components/AddBoxDialog.js +++ b/src/containers/components/AddBoxDialog.js @@ -1,7 +1,7 @@ import { connect } from "react-redux"; -import AddBoxDialog from "../../components/AddBoxDialog"; -import { addBox } from "../../actions/box"; +import AddBoxDialog from "components/AddBoxDialog"; +import { addBox } from "actions/box"; const mapStateToProps = ({ profile }) => ({ profile }); const mapDispatchToProps = { addBox }; diff --git a/src/containers/components/AddProductDialog.js b/src/containers/components/AddProductDialog.js index abf8b15..67e442d 100644 --- a/src/containers/components/AddProductDialog.js +++ b/src/containers/components/AddProductDialog.js @@ -1,7 +1,7 @@ import { connect } from "react-redux"; -import ProductDialog from "../../components/ProductDialog"; -import { productAdd } from "../../actions/product"; +import ProductDialog from "components/ProductDialog"; +import { productAdd } from "actions/product"; const mapDispatchToProps = { productAdd }; const mergeProps = (stateProps, { productAdd }, { onClose, ...props }) => ({ diff --git a/src/containers/components/AppDrawerAuth.js b/src/containers/components/AppDrawerAuth.js index 651c5e9..9ca7fcb 100644 --- a/src/containers/components/AppDrawerAuth.js +++ b/src/containers/components/AppDrawerAuth.js @@ -1,7 +1,7 @@ import { connect } from "react-redux"; -import AppDrawerAuth from "../../components/AppDrawerAuth"; -import { firebaseSignOut } from "../../actions/auth"; +import AppDrawerAuth from "components/AppDrawerAuth"; +import { firebaseSignOut } from "actions/auth"; const mapStateToProps = ({ profile, user }) => ({ profile, user }); const mapDispatchToProps = dispatch => ({ diff --git a/src/containers/components/EditProductDialog.js b/src/containers/components/EditProductDialog.js index cff4972..9e75d72 100644 --- a/src/containers/components/EditProductDialog.js +++ b/src/containers/components/EditProductDialog.js @@ -1,7 +1,7 @@ import { connect } from "react-redux"; -import ProductDialog from "../../components/ProductDialog"; -import { productEdit } from "../../actions/product"; +import ProductDialog from "components/ProductDialog"; +import { productEdit } from "actions/product"; const mapDispatchToProps = { productEdit }; const mergeProps = ( diff --git a/src/containers/components/PasswordChangeForm.js b/src/containers/components/PasswordChangeForm.js index 3c46b86..379bde8 100644 --- a/src/containers/components/PasswordChangeForm.js +++ b/src/containers/components/PasswordChangeForm.js @@ -1,7 +1,7 @@ import { connect } from "react-redux"; -import { userPasswordChange } from "../../actions/auth"; -import PasswordChangeForm from "../../components/PasswordChangeForm"; +import { userPasswordChange } from "actions/auth"; +import PasswordChangeForm from "components/PasswordChangeForm"; const mapStateToProps = ({ user }) => ({ user }); const mapDispatchToProps = { userPasswordChange }; diff --git a/src/containers/components/ProductDeleteConfirm.js b/src/containers/components/ProductDeleteConfirm.js index 740c26a..9599d05 100644 --- a/src/containers/components/ProductDeleteConfirm.js +++ b/src/containers/components/ProductDeleteConfirm.js @@ -1,7 +1,7 @@ import { connect } from "react-redux"; -import ConfirmDeleteAlert from "../../components/ConfirmDeleteAlert"; -import { productDelete, productDeleteCancel } from "../../actions/product"; +import ConfirmDeleteAlert from "components/ConfirmDeleteAlert"; +import { productDelete, productDeleteCancel } from "actions/product"; const mapStateToProps = ({ products: { confirmDeleteOf } }) => ({ confirmDeleteOf diff --git a/src/containers/components/ProductTable.js b/src/containers/components/ProductTable.js index 177866b..87eb2a9 100644 --- a/src/containers/components/ProductTable.js +++ b/src/containers/components/ProductTable.js @@ -1,7 +1,7 @@ import { connect } from "react-redux"; -import ProductTableWrapper from "../../components/ProductTable"; -import { productDeleteConfirm, productList } from "../../actions/product"; +import ProductTableWrapper from "components/ProductTable"; +import { productDeleteConfirm, productList } from "actions/product"; const mapStateToProps = ({ products }) => ({ products }); const mapDispatchToProps = { productDeleteConfirm, productList }; diff --git a/src/containers/components/ResetPasswordForm.js b/src/containers/components/ResetPasswordForm.js index 8a282f4..b32a77d 100644 --- a/src/containers/components/ResetPasswordForm.js +++ b/src/containers/components/ResetPasswordForm.js @@ -1,7 +1,7 @@ import { connect } from "react-redux"; -import { resetPassword } from "../../actions/auth"; -import ResetPasswordForm from "../../components/ResetPasswordForm"; +import { resetPassword } from "actions/auth"; +import ResetPasswordForm from "components/ResetPasswordForm"; const mapStateToProps = ({ user: { loading } }) => ({ loading }); const mapDispatchToProps = { resetPassword }; diff --git a/src/containers/components/SignInForm.js b/src/containers/components/SignInForm.js index 9bb3d70..fc297ed 100644 --- a/src/containers/components/SignInForm.js +++ b/src/containers/components/SignInForm.js @@ -1,7 +1,7 @@ import { connect } from "react-redux"; -import { userSignIn } from "../../actions/auth"; -import SignInForm from "../../components/SignInForm"; +import { userSignIn } from "actions/auth"; +import SignInForm from "components/SignInForm"; const mapStateToProps = ({ user: { error, loading } }) => ({ serverError: error, diff --git a/src/containers/pages/PasswordChangeForm.js b/src/containers/pages/PasswordChangeForm.js index 7391020..7d20725 100644 --- a/src/containers/pages/PasswordChangeForm.js +++ b/src/containers/pages/PasswordChangeForm.js @@ -1,7 +1,7 @@ import { connect } from "react-redux"; import { withRouter } from "react-router-dom"; -import PasswordChangePage from "../../pages/PasswordChangePage"; +import PasswordChangePage from "pages/PasswordChangePage"; const mapStateToProps = ({ user }) => ({ user }); export default connect(mapStateToProps)(withRouter(PasswordChangePage)); diff --git a/src/containers/pages/ResetPasswordPage.js b/src/containers/pages/ResetPasswordPage.js index c75c166..a28a938 100644 --- a/src/containers/pages/ResetPasswordPage.js +++ b/src/containers/pages/ResetPasswordPage.js @@ -1,7 +1,7 @@ import { connect } from "react-redux"; import { withRouter } from "react-router-dom"; -import ResetPasswordPage from "../../pages/ResetPasswordPage"; +import ResetPasswordPage from "pages/ResetPasswordPage"; const mapStateToProps = ({ user }) => ({ user }); export default connect(mapStateToProps)(withRouter(ResetPasswordPage)); diff --git a/src/containers/pages/SignInPage.js b/src/containers/pages/SignInPage.js index d014e40..61afc60 100644 --- a/src/containers/pages/SignInPage.js +++ b/src/containers/pages/SignInPage.js @@ -1,7 +1,7 @@ import { connect } from "react-redux"; import { withRouter } from "react-router-dom"; -import SignInPage from "../../pages/SignInPage"; +import SignInPage from "pages/SignInPage"; const mapStateToProps = ({ user }) => ({ user }); export default connect(mapStateToProps)(withRouter(SignInPage)); diff --git a/src/pages/BoxesPage.js b/src/pages/BoxesPage.js index fb88d48..dfb5012 100644 --- a/src/pages/BoxesPage.js +++ b/src/pages/BoxesPage.js @@ -1,7 +1,7 @@ import React from "react"; -import AppFrame from "../components/AppFrame"; -import BoxListContainer from "../components/BoxListContainer"; +import AppFrame from "components/AppFrame"; +import BoxListContainer from "components/BoxListContainer"; class BoxesPage extends React.Component { render() { diff --git a/src/pages/CreateOrganizationPage.js b/src/pages/CreateOrganizationPage.js index 8625e80..81fe7ac 100644 --- a/src/pages/CreateOrganizationPage.js +++ b/src/pages/CreateOrganizationPage.js @@ -8,8 +8,8 @@ import ArrowBack from "@material-ui/icons/ArrowBack"; import Typography from "@material-ui/core/Typography"; import Grid from "@material-ui/core/Grid"; -import Page from "../components/Page"; -import CreateOrganizationFlow from "../components/CreateOrganizationFlow"; +import Page from "components/Page"; +import CreateOrganizationFlow from "components/CreateOrganizationFlow"; const styles = theme => ({ titleText: { diff --git a/src/pages/DashboardPage.js b/src/pages/DashboardPage.js index 7387f99..a0a7ead 100644 --- a/src/pages/DashboardPage.js +++ b/src/pages/DashboardPage.js @@ -12,9 +12,9 @@ import { defineMessages } from "react-intl"; -import Page from "../components/Page"; -import AddBoxDialog from "../containers/components/AddBoxDialog"; -import AppFrame from "../components/AppFrame"; +import Page from "components/Page"; +import AddBoxDialog from "containers/components/AddBoxDialog"; +import AppFrame from "components/AppFrame"; const styles = theme => ({ paper: theme.mixins.gutters({ diff --git a/src/pages/FindBoxMockupPage.js b/src/pages/FindBoxMockupPage.js index 9ad78bf..7b23f4f 100644 --- a/src/pages/FindBoxMockupPage.js +++ b/src/pages/FindBoxMockupPage.js @@ -1,36 +1,20 @@ -/* eslint-disable */ - import React from "react"; -import AppFrame from "../components/AppFrame"; -import Page from "../components/Page"; -import Button from "@material-ui/core/Button"; import Paper from "@material-ui/core/Paper"; -import Toolbar from "@material-ui/core/Toolbar"; -import BoxListContainer from "../components/BoxListContainer"; - import PropTypes from "prop-types"; import { withStyles } from "@material-ui/core/styles"; import Grid from "@material-ui/core/Grid"; import Typography from "@material-ui/core/Typography"; -import FormControl from "@material-ui/core/FormControl"; -import InputLabel from "@material-ui/core/InputLabel"; -import MenuItem from "@material-ui/core/MenuItem"; -import Select from "@material-ui/core/Select"; -import ButtonBase from "@material-ui/core/ButtonBase"; -import TextField from "@material-ui/core/TextField"; - -import CategorySelector from "../components/CategorySelector"; -import ProductSelectorMockup from "../components/ProductSelectorMockup"; -import ProductButton from "../components/ProductButton"; - import List from "@material-ui/core/List"; import ListItem from "@material-ui/core/ListItem"; import ListItemText from "@material-ui/core/ListItemText"; -import ListItemSecondaryAction from "@material-ui/core/ListItemSecondaryAction"; -import IconButton from "@material-ui/core/IconButton"; -import CommentIcon from "@material-ui/icons/Comment"; import Checkbox from "@material-ui/core/Checkbox"; +import ProductButton from "components/ProductButton"; +import ProductSelectorMockup from "components/ProductSelectorMockup"; +import CategorySelector from "components/CategorySelector"; +import Page from "components/Page"; +import AppFrame from "components/AppFrame"; + const styles = theme => ({ categorySelect: { float: "left", @@ -95,7 +79,6 @@ class FindBoxMockupPage extends React.Component { render() { const { classes } = this.props; - const { spacing } = this.state; return ( diff --git a/src/pages/HomePage.js b/src/pages/HomePage.js index 1d1e537..86b007f 100644 --- a/src/pages/HomePage.js +++ b/src/pages/HomePage.js @@ -5,8 +5,8 @@ import { withStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import PropTypes from "prop-types"; -import Page from "../components/Page"; -import { fontFamily } from "../theme"; +import Page from "components/Page"; +import { fontFamily } from "theme"; const styles = { homepage: { diff --git a/src/pages/InvitePage.js b/src/pages/InvitePage.js index 1b1a567..11e1a73 100644 --- a/src/pages/InvitePage.js +++ b/src/pages/InvitePage.js @@ -1,8 +1,8 @@ import React from "react"; -import AppFrame from "../components/AppFrame"; -import Page from "../components/Page"; -import InviteLink from "../components/InviteLink"; +import AppFrame from "components/AppFrame"; +import Page from "components/Page"; +import InviteLink from "components/InviteLink"; const InvitePage = () => ( diff --git a/src/pages/JoinPage.js b/src/pages/JoinPage.js index 045d523..2772bc5 100644 --- a/src/pages/JoinPage.js +++ b/src/pages/JoinPage.js @@ -4,11 +4,11 @@ import { FirestoreDocument } from "react-firestore"; import Typography from "@material-ui/core/Typography"; import Grid from "@material-ui/core/Grid"; -import SignUpForm from "../components/SignUpForm"; -import Progress from "../components/Progress.js"; -import Page from "../components/Page"; -import { createUserAndProfile } from "../auth"; -import { handleError } from "../utils"; +import SignUpForm from "components/SignUpForm"; +import Progress from "components/Progress.js"; +import Page from "components/Page"; +import { createUserAndProfile } from "auth"; +import { handleError } from "utils"; // TODO: clean this up. needs some separate components and containers. diff --git a/src/pages/MakeBoxMockupPage.js b/src/pages/MakeBoxMockupPage.js index dd080d7..5786590 100644 --- a/src/pages/MakeBoxMockupPage.js +++ b/src/pages/MakeBoxMockupPage.js @@ -1,26 +1,17 @@ -/* eslint-disable */ - import React from "react"; -import AppFrame from "../components/AppFrame"; -import Page from "../components/Page"; import Button from "@material-ui/core/Button"; import Paper from "@material-ui/core/Paper"; -import Toolbar from "@material-ui/core/Toolbar"; -import BoxListContainer from "../components/BoxListContainer"; - import PropTypes from "prop-types"; import { withStyles } from "@material-ui/core/styles"; import Grid from "@material-ui/core/Grid"; import Typography from "@material-ui/core/Typography"; -import FormControl from "@material-ui/core/FormControl"; -import InputLabel from "@material-ui/core/InputLabel"; -import MenuItem from "@material-ui/core/MenuItem"; -import Select from "@material-ui/core/Select"; -import ButtonBase from "@material-ui/core/ButtonBase"; import TextField from "@material-ui/core/TextField"; -import CategorySelector from "../components/CategorySelector"; -import ProductSelectorMockup from "../components/ProductSelectorMockup"; -import ProductButton from "../components/ProductButton"; + +import Page from "components/Page"; +import AppFrame from "components/AppFrame"; +import CategorySelector from "components/CategorySelector"; +import ProductSelectorMockup from "components/ProductSelectorMockup"; +import ProductButton from "components/ProductButton"; const styles = theme => ({ formControl: { @@ -69,7 +60,6 @@ class MakeBoxMockupPage extends React.Component { render() { const { classes } = this.props; - const { spacing } = this.state; return ( diff --git a/src/pages/MockupsPage.js b/src/pages/MockupsPage.js index 6db15e7..0b997fa 100644 --- a/src/pages/MockupsPage.js +++ b/src/pages/MockupsPage.js @@ -3,7 +3,7 @@ import { Link } from "react-router-dom"; import Typography from "@material-ui/core/Typography"; import Grid from "@material-ui/core/Grid"; -import Page from "../components/Page"; +import Page from "components/Page"; const JoinPage = () => ( diff --git a/src/pages/PasswordChangePage.js b/src/pages/PasswordChangePage.js index 0200cff..a3e72e9 100644 --- a/src/pages/PasswordChangePage.js +++ b/src/pages/PasswordChangePage.js @@ -1,8 +1,8 @@ import React from "react"; -import AppFrame from "../components/AppFrame"; -import Page from "../components/Page"; -import PasswordChangeForm from "../containers/components/PasswordChangeForm"; +import AppFrame from "components/AppFrame"; +import Page from "components/Page"; +import PasswordChangeForm from "containers/components/PasswordChangeForm"; const PasswordChangePage = () => ( diff --git a/src/pages/ProductsPage.js b/src/pages/ProductsPage.js index dbbde78..a6e5518 100644 --- a/src/pages/ProductsPage.js +++ b/src/pages/ProductsPage.js @@ -4,10 +4,10 @@ import Toolbar from "@material-ui/core/Toolbar"; import Button from "@material-ui/core/Button"; import Paper from "@material-ui/core/Paper"; -import AppFrame from "../components/AppFrame"; -import Page from "../components/Page"; -import ProductTable from "../containers/components/ProductTable"; -import AddProductDialog from "../containers/components/AddProductDialog"; +import AppFrame from "components/AppFrame"; +import Page from "components/Page"; +import ProductTable from "containers/components/ProductTable"; +import AddProductDialog from "containers/components/AddProductDialog"; const styles = theme => ({ table: { diff --git a/src/pages/ResetPasswordPage.js b/src/pages/ResetPasswordPage.js index bb719bd..f37a403 100644 --- a/src/pages/ResetPasswordPage.js +++ b/src/pages/ResetPasswordPage.js @@ -3,8 +3,8 @@ import { Link, Redirect } from "react-router-dom"; import Typography from "@material-ui/core/Typography"; import Grid from "@material-ui/core/Grid"; -import ResetPasswordForm from "../containers/components/ResetPasswordForm"; -import Page from "../components/Page"; +import ResetPasswordForm from "containers/components/ResetPasswordForm"; +import Page from "components/Page"; const ResetPasswordPage = ({ history, user }) => !user.hasTriggeredReset ? ( diff --git a/src/pages/SignInPage.js b/src/pages/SignInPage.js index a4c045b..875c5d4 100644 --- a/src/pages/SignInPage.js +++ b/src/pages/SignInPage.js @@ -3,8 +3,8 @@ import { Link, Redirect } from "react-router-dom"; import Typography from "@material-ui/core/Typography"; import Grid from "@material-ui/core/Grid"; -import SignInForm from "../containers/components/SignInForm"; -import Page from "../components/Page"; +import SignInForm from "containers/components/SignInForm"; +import Page from "components/Page"; const SignInPage = ({ history, user }) => !user.data ? ( diff --git a/src/queries/invites.js b/src/queries/invites.js index d6d52a5..3b04c1f 100644 --- a/src/queries/invites.js +++ b/src/queries/invites.js @@ -1,4 +1,4 @@ -import firebase from "../firebase"; +import firebase from "firebase.js"; const db = firebase.firestore(); diff --git a/src/queries/invites.test.js b/src/queries/invites.test.js index 23d729f..d90d853 100644 --- a/src/queries/invites.test.js +++ b/src/queries/invites.test.js @@ -1,4 +1,4 @@ -import firebase from "../firebase"; +import firebase from "firebase.js"; import { getOrAddInvite } from "./invites"; diff --git a/src/queries/organizations.js b/src/queries/organizations.js index cbba0eb..dec32f5 100644 --- a/src/queries/organizations.js +++ b/src/queries/organizations.js @@ -1,4 +1,4 @@ -import firebase from "../firebase"; +import firebase from "firebase.js"; const db = firebase.firestore(); diff --git a/src/queries/products.js b/src/queries/products.js index 25d06a3..739d7be 100644 --- a/src/queries/products.js +++ b/src/queries/products.js @@ -1,7 +1,7 @@ import React from "react"; import { FirestoreCollection } from "react-firestore"; -import { firestore } from "../firebase"; +import { firestore } from "firebase.js"; export const ProductsCollection = ({ organizationRef, ...props }) => (