From 9bfa07ecf56175b5dc281a93993cc669ce0122d3 Mon Sep 17 00:00:00 2001 From: Kanagaraj M Date: Tue, 13 Feb 2018 12:00:02 +0530 Subject: [PATCH] re-organize components and actions by feature (#5518) Now the files grouped based on the features instead of the previous approach of grouping by type. --- browser/app/index.js | 2 +- browser/app/js/{components => }/App.js | 8 ++++---- browser/app/js/{components => }/__tests__/App.test.js | 0 browser/app/js/{components => alert}/Alert.js | 0 .../__tests__ => alert/__tests___}/Alert.test.js | 0 .../alert.test.js => alert/__tests___/actions.test.js} | 2 +- .../alert.test.js => alert/__tests___/reducer.test.js} | 6 +++--- browser/app/js/{actions/alert.js => alert/actions.js} | 0 browser/app/js/{reducers/alert.js => alert/reducer.js} | 2 +- browser/app/js/{components => browser}/Browser.js | 0 browser/app/js/{components => browser}/Header.js | 2 +- browser/app/js/{components => browser}/Host.js | 0 browser/app/js/{components => browser}/Login.js | 7 ++++--- browser/app/js/{components => browser}/MainContent.js | 2 +- browser/app/js/{components => browser}/MobileHeader.js | 4 ++-- browser/app/js/{components => browser}/SideBar.js | 8 ++++---- browser/app/js/{components => browser}/StorageInfo.js | 4 ++-- .../{components => browser}/__tests__/Browser.test.js | 0 .../js/{components => browser}/__tests__/Host.test.js | 0 .../js/{components => browser}/__tests__/Login.test.js | 0 .../__tests__/MobileHeader.test.js | 0 .../{components => browser}/__tests__/SideBar.test.js | 0 .../__tests__/StorageInfo.test.js | 0 .../__tests__/actions.test.js} | 2 +- .../__tests__/reducer.test.js} | 4 ++-- .../app/js/{actions/common.js => browser/actions.js} | 0 .../app/js/{reducers/common.js => browser/reducer.js} | 2 +- browser/app/js/{components => buckets}/Bucket.js | 0 .../app/js/{components => buckets}/BucketContainer.js | 4 ++-- browser/app/js/{components => buckets}/BucketList.js | 4 ++-- browser/app/js/{components => buckets}/BucketSearch.js | 2 +- .../{components => buckets}/__tests__/Bucket.test.js | 0 .../__tests__/BucketContainer.test.js | 0 .../__tests__/BucketList.test.js | 0 .../__tests__/BucketSearch.test.js | 0 .../__tests__/actions.test.js} | 6 ++---- .../__tests__/reducer.test.js} | 4 ++-- .../__tests__/selectors.test.js} | 2 +- .../app/js/{actions/buckets.js => buckets/actions.js} | 0 .../app/js/{reducers/buckets.js => buckets/reducer.js} | 2 +- .../js/{selectors/buckets.js => buckets/selectors.js} | 0 .../app/js/{components => objects}/ObjectContainer.js | 2 +- browser/app/js/{components => objects}/ObjectItem.js | 0 .../app/js/{components => objects}/ObjectsHeader.js | 2 +- browser/app/js/{components => objects}/ObjectsList.js | 0 .../js/{components => objects}/ObjectsListContainer.js | 2 +- .../app/js/{components => objects}/ObjectsSection.js | 0 browser/app/js/{components => objects}/Path.js | 4 ++-- .../app/js/{components => objects}/PrefixContainer.js | 2 +- .../__tests__/ObjectsHeader.test.js | 0 .../__tests__/ObjectsList.test.js | 0 .../__tests__/ObjectsListContainer.test.js | 0 .../__tests__/ObjetctItem.test.js | 0 .../js/{components => objects}/__tests__/Path.test.js | 0 .../__tests__/PrefixContainer.test.js | 0 .../__tests__/actions.test.js} | 2 +- .../__tests__/reducer.test.js} | 4 ++-- .../app/js/{actions/objects.js => objects/actions.js} | 0 .../app/js/{reducers/objects.js => objects/reducer.js} | 2 +- browser/app/js/{reducers/index.js => reducers.js} | 10 +++++----- browser/app/js/store/configure-store.js | 2 +- 61 files changed, 55 insertions(+), 56 deletions(-) rename browser/app/js/{components => }/App.js (89%) rename browser/app/js/{components => }/__tests__/App.test.js (100%) rename browser/app/js/{components => alert}/Alert.js (100%) rename browser/app/js/{components/__tests__ => alert/__tests___}/Alert.test.js (100%) rename browser/app/js/{actions/__tests__/alert.test.js => alert/__tests___/actions.test.js} (97%) rename browser/app/js/{reducers/__tests__/alert.test.js => alert/__tests___/reducer.test.js} (94%) rename browser/app/js/{actions/alert.js => alert/actions.js} (100%) rename browser/app/js/{reducers/alert.js => alert/reducer.js} (95%) rename browser/app/js/{components => browser}/Browser.js (100%) rename browser/app/js/{components => browser}/Header.js (95%) rename browser/app/js/{components => browser}/Host.js (100%) rename browser/app/js/{components => browser}/Login.js (95%) rename browser/app/js/{components => browser}/MainContent.js (94%) rename browser/app/js/{components => browser}/MobileHeader.js (94%) rename browser/app/js/{components => browser}/SideBar.js (90%) rename browser/app/js/{components => browser}/StorageInfo.js (94%) rename browser/app/js/{components => browser}/__tests__/Browser.test.js (100%) rename browser/app/js/{components => browser}/__tests__/Host.test.js (100%) rename browser/app/js/{components => browser}/__tests__/Login.test.js (100%) rename browser/app/js/{components => browser}/__tests__/MobileHeader.test.js (100%) rename browser/app/js/{components => browser}/__tests__/SideBar.test.js (100%) rename browser/app/js/{components => browser}/__tests__/StorageInfo.test.js (100%) rename browser/app/js/{actions/__tests__/common.test.js => browser/__tests__/actions.test.js} (96%) rename browser/app/js/{reducers/__tests__/common.test.js => browser/__tests__/reducer.test.js} (94%) rename browser/app/js/{actions/common.js => browser/actions.js} (100%) rename browser/app/js/{reducers/common.js => browser/reducer.js} (95%) rename browser/app/js/{components => buckets}/Bucket.js (100%) rename browser/app/js/{components => buckets}/BucketContainer.js (90%) rename browser/app/js/{components => buckets}/BucketList.js (93%) rename browser/app/js/{components => buckets}/BucketSearch.js (95%) rename browser/app/js/{components => buckets}/__tests__/Bucket.test.js (100%) rename browser/app/js/{components => buckets}/__tests__/BucketContainer.test.js (100%) rename browser/app/js/{components => buckets}/__tests__/BucketList.test.js (100%) rename browser/app/js/{components => buckets}/__tests__/BucketSearch.test.js (100%) rename browser/app/js/{actions/__tests__/buckets.test.js => buckets/__tests__/actions.test.js} (94%) rename browser/app/js/{reducers/__tests__/buckets.test.js => buckets/__tests__/reducer.test.js} (94%) rename browser/app/js/{selectors/__tests__/buckets.test.js => buckets/__tests__/selectors.test.js} (94%) rename browser/app/js/{actions/buckets.js => buckets/actions.js} (100%) rename browser/app/js/{reducers/buckets.js => buckets/reducer.js} (95%) rename browser/app/js/{selectors/buckets.js => buckets/selectors.js} (100%) rename browser/app/js/{components => objects}/ObjectContainer.js (95%) rename browser/app/js/{components => objects}/ObjectItem.js (100%) rename browser/app/js/{components => objects}/ObjectsHeader.js (98%) rename browser/app/js/{components => objects}/ObjectsList.js (100%) rename browser/app/js/{components => objects}/ObjectsListContainer.js (97%) rename browser/app/js/{components => objects}/ObjectsSection.js (100%) rename browser/app/js/{components => objects}/Path.js (93%) rename browser/app/js/{components => objects}/PrefixContainer.js (96%) rename browser/app/js/{components => objects}/__tests__/ObjectsHeader.test.js (100%) rename browser/app/js/{components => objects}/__tests__/ObjectsList.test.js (100%) rename browser/app/js/{components => objects}/__tests__/ObjectsListContainer.test.js (100%) rename browser/app/js/{components => objects}/__tests__/ObjetctItem.test.js (100%) rename browser/app/js/{components => objects}/__tests__/Path.test.js (100%) rename browser/app/js/{components => objects}/__tests__/PrefixContainer.test.js (100%) rename browser/app/js/{actions/__tests__/objects.test.js => objects/__tests__/actions.test.js} (99%) rename browser/app/js/{reducers/__tests__/objects.test.js => objects/__tests__/reducer.test.js} (97%) rename browser/app/js/{actions/objects.js => objects/actions.js} (100%) rename browser/app/js/{reducers/objects.js => objects/reducer.js} (96%) rename browser/app/js/{reducers/index.js => reducers.js} (81%) diff --git a/browser/app/index.js b/browser/app/index.js index 85afb30b1..8162022c0 100644 --- a/browser/app/index.js +++ b/browser/app/index.js @@ -27,7 +27,7 @@ import { Provider } from "react-redux" import { minioBrowserPrefix } from "./js/constants" import configureStore from "./js/store/configure-store" import hideLoader from "./js/loader" -import App from "./js/components/App" +import App from "./js/App" const store = configureStore() diff --git a/browser/app/js/components/App.js b/browser/app/js/App.js similarity index 89% rename from browser/app/js/components/App.js rename to browser/app/js/App.js index 05fb52f72..eb833e400 100644 --- a/browser/app/js/components/App.js +++ b/browser/app/js/App.js @@ -16,10 +16,10 @@ import React from "react" import { Route, Switch, Redirect } from "react-router-dom" -import Browser from "../components/Browser" -import Login from "../components/Login" -import web from "../web" -import { minioBrowserPrefix } from "../constants" +import Browser from "./browser/Browser" +import Login from "./browser/Login" +import web from "./web" +import { minioBrowserPrefix } from "./constants" const AuthorizedRoute = ({ component: Component, ...rest }) => ( { +describe("alert reducer", () => { it("should return the initial state", () => { expect(reducer(undefined, {})).toEqual({ show: false, diff --git a/browser/app/js/actions/alert.js b/browser/app/js/alert/actions.js similarity index 100% rename from browser/app/js/actions/alert.js rename to browser/app/js/alert/actions.js diff --git a/browser/app/js/reducers/alert.js b/browser/app/js/alert/reducer.js similarity index 95% rename from browser/app/js/reducers/alert.js rename to browser/app/js/alert/reducer.js index f60f1e19e..3bcd4fddb 100644 --- a/browser/app/js/reducers/alert.js +++ b/browser/app/js/alert/reducer.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import * as actionsAlert from "../actions/alert" +import * as actionsAlert from "./actions" const initialState = { show: false, diff --git a/browser/app/js/components/Browser.js b/browser/app/js/browser/Browser.js similarity index 100% rename from browser/app/js/components/Browser.js rename to browser/app/js/browser/Browser.js diff --git a/browser/app/js/components/Header.js b/browser/app/js/browser/Header.js similarity index 95% rename from browser/app/js/components/Header.js rename to browser/app/js/browser/Header.js index e82d2a2f2..138f9ad33 100644 --- a/browser/app/js/components/Header.js +++ b/browser/app/js/browser/Header.js @@ -15,7 +15,7 @@ */ import React from "react" -import Path from "./Path" +import Path from "../objects/Path" import StorageInfo from "./StorageInfo" export const Header = () => ( diff --git a/browser/app/js/components/Host.js b/browser/app/js/browser/Host.js similarity index 100% rename from browser/app/js/components/Host.js rename to browser/app/js/browser/Host.js diff --git a/browser/app/js/components/Login.js b/browser/app/js/browser/Login.js similarity index 95% rename from browser/app/js/components/Login.js rename to browser/app/js/browser/Login.js index 3bc6aa7a2..063e9cabb 100644 --- a/browser/app/js/components/Login.js +++ b/browser/app/js/browser/Login.js @@ -18,8 +18,8 @@ import React from "react" import { connect } from "react-redux" import classNames from "classnames" import logo from "../../img/logo.svg" -import Alert from "./Alert" -import * as actionsAlert from "../actions/alert" +import Alert from "../alert/Alert" +import * as actionsAlert from "../alert/actions" import InputGroup from "../components/InputGroup" import { minioBrowserPrefix } from "../constants" import web from "../web" @@ -115,7 +115,8 @@ export class Login extends React.Component { const mapDispatchToProps = dispatch => { return { - showAlert: (type, message) => dispatch(actionsAlert.set({type: type, message: message})), + showAlert: (type, message) => + dispatch(actionsAlert.set({ type: type, message: message })), clearAlert: () => dispatch(actionsAlert.clear()) } } diff --git a/browser/app/js/components/MainContent.js b/browser/app/js/browser/MainContent.js similarity index 94% rename from browser/app/js/components/MainContent.js rename to browser/app/js/browser/MainContent.js index 55f77a335..46b728901 100644 --- a/browser/app/js/components/MainContent.js +++ b/browser/app/js/browser/MainContent.js @@ -17,7 +17,7 @@ import React from "react" import MobileHeader from "./MobileHeader" import Header from "./Header" -import ObjectsSection from "./ObjectsSection" +import ObjectsSection from "../objects/ObjectsSection" export const MainContent = () => (
diff --git a/browser/app/js/components/MobileHeader.js b/browser/app/js/browser/MobileHeader.js similarity index 94% rename from browser/app/js/components/MobileHeader.js rename to browser/app/js/browser/MobileHeader.js index d93c0744e..e4633a9cd 100644 --- a/browser/app/js/components/MobileHeader.js +++ b/browser/app/js/browser/MobileHeader.js @@ -18,7 +18,7 @@ import React from "react" import classNames from "classnames" import { connect } from "react-redux" import logo from "../../img/logo.svg" -import * as actionsCommon from "../actions/common" +import * as actionsCommon from "./actions" export const MobileHeader = ({ sidebarOpen, toggleSidebar }) => (
@@ -47,7 +47,7 @@ export const MobileHeader = ({ sidebarOpen, toggleSidebar }) => ( const mapStateToProps = state => { return { - sidebarOpen: state.common.sidebarOpen + sidebarOpen: state.browser.sidebarOpen } } diff --git a/browser/app/js/components/SideBar.js b/browser/app/js/browser/SideBar.js similarity index 90% rename from browser/app/js/components/SideBar.js rename to browser/app/js/browser/SideBar.js index 975dd9357..0932ca555 100644 --- a/browser/app/js/components/SideBar.js +++ b/browser/app/js/browser/SideBar.js @@ -21,10 +21,10 @@ import { connect } from "react-redux" import logo from "../../img/logo.svg" import Dropdown from "react-bootstrap/lib/Dropdown" -import BucketSearch from "./BucketSearch" -import BucketList from "./BucketList" +import BucketSearch from "../buckets/BucketSearch" +import BucketList from "../buckets/BucketList" import Host from "./Host" -import * as actionsCommon from "../actions/common" +import * as actionsCommon from "./actions" export const SideBar = ({ sidebarOpen, clickOutside }) => { return ( @@ -51,7 +51,7 @@ export const SideBar = ({ sidebarOpen, clickOutside }) => { const mapStateToProps = state => { return { - sidebarOpen: state.common.sidebarOpen + sidebarOpen: state.browser.sidebarOpen } } diff --git a/browser/app/js/components/StorageInfo.js b/browser/app/js/browser/StorageInfo.js similarity index 94% rename from browser/app/js/components/StorageInfo.js rename to browser/app/js/browser/StorageInfo.js index f0e5e0c02..0532fb4d7 100644 --- a/browser/app/js/components/StorageInfo.js +++ b/browser/app/js/browser/StorageInfo.js @@ -17,7 +17,7 @@ import React from "react" import { connect } from "react-redux" import humanize from "humanize" -import * as actionsCommon from "../actions/common" +import * as actionsCommon from "./actions" export class StorageInfo extends React.Component { componentWillMount() { @@ -51,7 +51,7 @@ export class StorageInfo extends React.Component { const mapStateToProps = state => { return { - storageInfo: state.common.storageInfo + storageInfo: state.browser.storageInfo } } diff --git a/browser/app/js/components/__tests__/Browser.test.js b/browser/app/js/browser/__tests__/Browser.test.js similarity index 100% rename from browser/app/js/components/__tests__/Browser.test.js rename to browser/app/js/browser/__tests__/Browser.test.js diff --git a/browser/app/js/components/__tests__/Host.test.js b/browser/app/js/browser/__tests__/Host.test.js similarity index 100% rename from browser/app/js/components/__tests__/Host.test.js rename to browser/app/js/browser/__tests__/Host.test.js diff --git a/browser/app/js/components/__tests__/Login.test.js b/browser/app/js/browser/__tests__/Login.test.js similarity index 100% rename from browser/app/js/components/__tests__/Login.test.js rename to browser/app/js/browser/__tests__/Login.test.js diff --git a/browser/app/js/components/__tests__/MobileHeader.test.js b/browser/app/js/browser/__tests__/MobileHeader.test.js similarity index 100% rename from browser/app/js/components/__tests__/MobileHeader.test.js rename to browser/app/js/browser/__tests__/MobileHeader.test.js diff --git a/browser/app/js/components/__tests__/SideBar.test.js b/browser/app/js/browser/__tests__/SideBar.test.js similarity index 100% rename from browser/app/js/components/__tests__/SideBar.test.js rename to browser/app/js/browser/__tests__/SideBar.test.js diff --git a/browser/app/js/components/__tests__/StorageInfo.test.js b/browser/app/js/browser/__tests__/StorageInfo.test.js similarity index 100% rename from browser/app/js/components/__tests__/StorageInfo.test.js rename to browser/app/js/browser/__tests__/StorageInfo.test.js diff --git a/browser/app/js/actions/__tests__/common.test.js b/browser/app/js/browser/__tests__/actions.test.js similarity index 96% rename from browser/app/js/actions/__tests__/common.test.js rename to browser/app/js/browser/__tests__/actions.test.js index caf7a8800..d89ee5873 100644 --- a/browser/app/js/actions/__tests__/common.test.js +++ b/browser/app/js/browser/__tests__/actions.test.js @@ -16,7 +16,7 @@ import configureStore from "redux-mock-store" import thunk from "redux-thunk" -import * as actionsCommon from "../common" +import * as actionsCommon from "../actions" jest.mock("../../web", () => ({ StorageInfo: jest.fn(() => { diff --git a/browser/app/js/reducers/__tests__/common.test.js b/browser/app/js/browser/__tests__/reducer.test.js similarity index 94% rename from browser/app/js/reducers/__tests__/common.test.js rename to browser/app/js/browser/__tests__/reducer.test.js index d49cc7757..d7dee346f 100644 --- a/browser/app/js/reducers/__tests__/common.test.js +++ b/browser/app/js/browser/__tests__/reducer.test.js @@ -14,8 +14,8 @@ * limitations under the License. */ -import reducer from "../common" -import * as actionsCommon from "../../actions/common" +import reducer from "../reducer" +import * as actionsCommon from "../actions" describe("common reducer", () => { it("should return the initial state", () => { diff --git a/browser/app/js/actions/common.js b/browser/app/js/browser/actions.js similarity index 100% rename from browser/app/js/actions/common.js rename to browser/app/js/browser/actions.js diff --git a/browser/app/js/reducers/common.js b/browser/app/js/browser/reducer.js similarity index 95% rename from browser/app/js/reducers/common.js rename to browser/app/js/browser/reducer.js index 33573aede..3ee036534 100644 --- a/browser/app/js/reducers/common.js +++ b/browser/app/js/browser/reducer.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import * as actionsCommon from "../actions/common" +import * as actionsCommon from "./actions" export default ( state = { sidebarOpen: false, storageInfo: { total: 0, free: 0 } }, diff --git a/browser/app/js/components/Bucket.js b/browser/app/js/buckets/Bucket.js similarity index 100% rename from browser/app/js/components/Bucket.js rename to browser/app/js/buckets/Bucket.js diff --git a/browser/app/js/components/BucketContainer.js b/browser/app/js/buckets/BucketContainer.js similarity index 90% rename from browser/app/js/components/BucketContainer.js rename to browser/app/js/buckets/BucketContainer.js index 9f0324b9b..39d69ca25 100644 --- a/browser/app/js/components/BucketContainer.js +++ b/browser/app/js/buckets/BucketContainer.js @@ -16,8 +16,8 @@ import React from "react" import { connect } from "react-redux" -import * as actionsBuckets from "../actions/buckets" -import { getCurrentBucket } from "../selectors/buckets" +import * as actionsBuckets from "./actions" +import { getCurrentBucket } from "./selectors" import Bucket from "./Bucket" const mapStateToProps = (state, ownProps) => { diff --git a/browser/app/js/components/BucketList.js b/browser/app/js/buckets/BucketList.js similarity index 93% rename from browser/app/js/components/BucketList.js rename to browser/app/js/buckets/BucketList.js index b06294a42..75df7e6ca 100644 --- a/browser/app/js/components/BucketList.js +++ b/browser/app/js/buckets/BucketList.js @@ -17,8 +17,8 @@ import React from "react" import { connect } from "react-redux" import { Scrollbars } from "react-custom-scrollbars" -import * as actionsBuckets from "../actions/buckets" -import { getVisibleBuckets } from "../selectors/buckets" +import * as actionsBuckets from "./actions" +import { getVisibleBuckets } from "./selectors" import BucketContainer from "./BucketContainer" export class BucketList extends React.Component { diff --git a/browser/app/js/components/BucketSearch.js b/browser/app/js/buckets/BucketSearch.js similarity index 95% rename from browser/app/js/components/BucketSearch.js rename to browser/app/js/buckets/BucketSearch.js index 2f13320bb..ac1b6e1ea 100644 --- a/browser/app/js/components/BucketSearch.js +++ b/browser/app/js/buckets/BucketSearch.js @@ -16,7 +16,7 @@ import React from "react" import { connect } from "react-redux" -import * as actionsBuckets from "../actions/buckets" +import * as actionsBuckets from "./actions" export const BucketSearch = ({ onChange }) => (
({ ListBuckets: jest.fn(() => { @@ -52,9 +52,7 @@ describe("Buckets actions", () => { it("creates buckets/SET_FILTER directly", () => { const store = mockStore() - const expectedActions = [ - { type: "buckets/SET_FILTER", filter: "test" } - ] + const expectedActions = [{ type: "buckets/SET_FILTER", filter: "test" }] store.dispatch(actionsBuckets.setFilter("test")) const actions = store.getActions() expect(actions).toEqual(expectedActions) diff --git a/browser/app/js/reducers/__tests__/buckets.test.js b/browser/app/js/buckets/__tests__/reducer.test.js similarity index 94% rename from browser/app/js/reducers/__tests__/buckets.test.js rename to browser/app/js/buckets/__tests__/reducer.test.js index 38b68515e..298389af0 100644 --- a/browser/app/js/reducers/__tests__/buckets.test.js +++ b/browser/app/js/buckets/__tests__/reducer.test.js @@ -14,8 +14,8 @@ * limitations under the License. */ -import reducer from "../buckets" -import * as actions from "../../actions/buckets" +import reducer from "../reducer" +import * as actions from "../actions" describe("buckets reducer", () => { it("should return the initial state", () => { diff --git a/browser/app/js/selectors/__tests__/buckets.test.js b/browser/app/js/buckets/__tests__/selectors.test.js similarity index 94% rename from browser/app/js/selectors/__tests__/buckets.test.js rename to browser/app/js/buckets/__tests__/selectors.test.js index 563860d72..c4dd41b0f 100644 --- a/browser/app/js/selectors/__tests__/buckets.test.js +++ b/browser/app/js/buckets/__tests__/selectors.test.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import { getVisibleBuckets, getCurrentBucket } from "../buckets" +import { getVisibleBuckets, getCurrentBucket } from "../selectors" describe("getVisibleBuckets", () => { let state diff --git a/browser/app/js/actions/buckets.js b/browser/app/js/buckets/actions.js similarity index 100% rename from browser/app/js/actions/buckets.js rename to browser/app/js/buckets/actions.js diff --git a/browser/app/js/reducers/buckets.js b/browser/app/js/buckets/reducer.js similarity index 95% rename from browser/app/js/reducers/buckets.js rename to browser/app/js/buckets/reducer.js index 56a1d6eb1..69be47e34 100644 --- a/browser/app/js/reducers/buckets.js +++ b/browser/app/js/buckets/reducer.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import * as actionsBuckets from "../actions/buckets" +import * as actionsBuckets from "./actions" export default ( state = { list: [], filter: "", currentBucket: "" }, diff --git a/browser/app/js/selectors/buckets.js b/browser/app/js/buckets/selectors.js similarity index 100% rename from browser/app/js/selectors/buckets.js rename to browser/app/js/buckets/selectors.js diff --git a/browser/app/js/components/ObjectContainer.js b/browser/app/js/objects/ObjectContainer.js similarity index 95% rename from browser/app/js/components/ObjectContainer.js rename to browser/app/js/objects/ObjectContainer.js index f61bb654d..17014d6a5 100644 --- a/browser/app/js/components/ObjectContainer.js +++ b/browser/app/js/objects/ObjectContainer.js @@ -18,7 +18,7 @@ import React from "react" import humanize from "humanize" import Moment from "moment" import ObjectItem from "./ObjectItem" -import * as actionsObjects from "../actions/objects" +import * as actionsObjects from "./actions" export const ObjectContainer = ({ object }) => { const actionButtons = [] diff --git a/browser/app/js/components/ObjectItem.js b/browser/app/js/objects/ObjectItem.js similarity index 100% rename from browser/app/js/components/ObjectItem.js rename to browser/app/js/objects/ObjectItem.js diff --git a/browser/app/js/components/ObjectsHeader.js b/browser/app/js/objects/ObjectsHeader.js similarity index 98% rename from browser/app/js/components/ObjectsHeader.js rename to browser/app/js/objects/ObjectsHeader.js index 30964854e..331595f19 100644 --- a/browser/app/js/components/ObjectsHeader.js +++ b/browser/app/js/objects/ObjectsHeader.js @@ -17,7 +17,7 @@ import React from "react" import classNames from "classnames" import { connect } from "react-redux" -import * as actionsObjects from "../actions/objects" +import * as actionsObjects from "./actions" export const ObjectsHeader = ({ sortNameOrder, diff --git a/browser/app/js/components/ObjectsList.js b/browser/app/js/objects/ObjectsList.js similarity index 100% rename from browser/app/js/components/ObjectsList.js rename to browser/app/js/objects/ObjectsList.js diff --git a/browser/app/js/components/ObjectsListContainer.js b/browser/app/js/objects/ObjectsListContainer.js similarity index 97% rename from browser/app/js/components/ObjectsListContainer.js rename to browser/app/js/objects/ObjectsListContainer.js index c7af13b5a..9c1f037dc 100644 --- a/browser/app/js/components/ObjectsListContainer.js +++ b/browser/app/js/objects/ObjectsListContainer.js @@ -18,7 +18,7 @@ import React from "react" import classNames from "classnames" import { connect } from "react-redux" import InfiniteScroll from "react-infinite-scroller" -import * as actionsObjects from "../actions/objects" +import * as actionsObjects from "./actions" import ObjectsList from "./ObjectsList" export class ObjectsListContainer extends React.Component { diff --git a/browser/app/js/components/ObjectsSection.js b/browser/app/js/objects/ObjectsSection.js similarity index 100% rename from browser/app/js/components/ObjectsSection.js rename to browser/app/js/objects/ObjectsSection.js diff --git a/browser/app/js/components/Path.js b/browser/app/js/objects/Path.js similarity index 93% rename from browser/app/js/components/Path.js rename to browser/app/js/objects/Path.js index cd4e128fa..f28f241dd 100644 --- a/browser/app/js/components/Path.js +++ b/browser/app/js/objects/Path.js @@ -16,8 +16,8 @@ import React from "react" import { connect } from "react-redux" -import { getCurrentBucket, getCurrentPrefix } from "../selectors/buckets" -import * as actionsObjects from "../actions/objects" +import { getCurrentBucket } from "../buckets/selectors" +import * as actionsObjects from "./actions" export const Path = ({ currentBucket, currentPrefix, selectPrefix }) => { const onPrefixClick = (e, prefix) => { diff --git a/browser/app/js/components/PrefixContainer.js b/browser/app/js/objects/PrefixContainer.js similarity index 96% rename from browser/app/js/components/PrefixContainer.js rename to browser/app/js/objects/PrefixContainer.js index 07ad1b4ac..78dacc2ca 100644 --- a/browser/app/js/components/PrefixContainer.js +++ b/browser/app/js/objects/PrefixContainer.js @@ -17,7 +17,7 @@ import React from "react" import { connect } from "react-redux" import ObjectItem from "./ObjectItem" -import * as actionsObjects from "../actions/objects" +import * as actionsObjects from "./actions" export const PrefixContainer = ({ object, currentPrefix, selectPrefix }) => { const props = { diff --git a/browser/app/js/components/__tests__/ObjectsHeader.test.js b/browser/app/js/objects/__tests__/ObjectsHeader.test.js similarity index 100% rename from browser/app/js/components/__tests__/ObjectsHeader.test.js rename to browser/app/js/objects/__tests__/ObjectsHeader.test.js diff --git a/browser/app/js/components/__tests__/ObjectsList.test.js b/browser/app/js/objects/__tests__/ObjectsList.test.js similarity index 100% rename from browser/app/js/components/__tests__/ObjectsList.test.js rename to browser/app/js/objects/__tests__/ObjectsList.test.js diff --git a/browser/app/js/components/__tests__/ObjectsListContainer.test.js b/browser/app/js/objects/__tests__/ObjectsListContainer.test.js similarity index 100% rename from browser/app/js/components/__tests__/ObjectsListContainer.test.js rename to browser/app/js/objects/__tests__/ObjectsListContainer.test.js diff --git a/browser/app/js/components/__tests__/ObjetctItem.test.js b/browser/app/js/objects/__tests__/ObjetctItem.test.js similarity index 100% rename from browser/app/js/components/__tests__/ObjetctItem.test.js rename to browser/app/js/objects/__tests__/ObjetctItem.test.js diff --git a/browser/app/js/components/__tests__/Path.test.js b/browser/app/js/objects/__tests__/Path.test.js similarity index 100% rename from browser/app/js/components/__tests__/Path.test.js rename to browser/app/js/objects/__tests__/Path.test.js diff --git a/browser/app/js/components/__tests__/PrefixContainer.test.js b/browser/app/js/objects/__tests__/PrefixContainer.test.js similarity index 100% rename from browser/app/js/components/__tests__/PrefixContainer.test.js rename to browser/app/js/objects/__tests__/PrefixContainer.test.js diff --git a/browser/app/js/actions/__tests__/objects.test.js b/browser/app/js/objects/__tests__/actions.test.js similarity index 99% rename from browser/app/js/actions/__tests__/objects.test.js rename to browser/app/js/objects/__tests__/actions.test.js index ef1de722e..a539b26a4 100644 --- a/browser/app/js/actions/__tests__/objects.test.js +++ b/browser/app/js/objects/__tests__/actions.test.js @@ -16,7 +16,7 @@ import configureStore from "redux-mock-store" import thunk from "redux-thunk" -import * as actionsObjects from "../objects" +import * as actionsObjects from "../actions" jest.mock("../../web", () => ({ ListObjects: jest.fn(() => { diff --git a/browser/app/js/reducers/__tests__/objects.test.js b/browser/app/js/objects/__tests__/reducer.test.js similarity index 97% rename from browser/app/js/reducers/__tests__/objects.test.js rename to browser/app/js/objects/__tests__/reducer.test.js index 979bdc150..5d9ec924a 100644 --- a/browser/app/js/reducers/__tests__/objects.test.js +++ b/browser/app/js/objects/__tests__/reducer.test.js @@ -14,8 +14,8 @@ * limitations under the License. */ -import reducer from "../objects" -import * as actions from "../../actions/objects" +import reducer from "../reducer" +import * as actions from "../actions" describe("objects reducer", () => { it("should return the initial state", () => { diff --git a/browser/app/js/actions/objects.js b/browser/app/js/objects/actions.js similarity index 100% rename from browser/app/js/actions/objects.js rename to browser/app/js/objects/actions.js diff --git a/browser/app/js/reducers/objects.js b/browser/app/js/objects/reducer.js similarity index 96% rename from browser/app/js/reducers/objects.js rename to browser/app/js/objects/reducer.js index 7b298c15d..952a3fcb1 100644 --- a/browser/app/js/reducers/objects.js +++ b/browser/app/js/objects/reducer.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import * as actionsObjects from "../actions/objects" +import * as actionsObjects from "./actions" export default ( state = { diff --git a/browser/app/js/reducers/index.js b/browser/app/js/reducers.js similarity index 81% rename from browser/app/js/reducers/index.js rename to browser/app/js/reducers.js index 3b0d8bdb2..5ab902209 100644 --- a/browser/app/js/reducers/index.js +++ b/browser/app/js/reducers.js @@ -15,13 +15,13 @@ */ import { combineReducers } from "redux" -import common from "./common" -import alert from "./alert" -import buckets from "./buckets" -import objects from "./objects" +import browser from "./browser/reducer" +import alert from "./alert/reducer" +import buckets from "./buckets/reducer" +import objects from "./objects/reducer" const rootReducer = combineReducers({ - common, + browser, alert, buckets, objects diff --git a/browser/app/js/store/configure-store.js b/browser/app/js/store/configure-store.js index 8aa56bd20..57c863fdc 100644 --- a/browser/app/js/store/configure-store.js +++ b/browser/app/js/store/configure-store.js @@ -16,7 +16,7 @@ import { createStore, applyMiddleware } from "redux" import thunkMiddleware from "redux-thunk" -import reducers from "../reducers/index" +import reducers from "../reducers" const createStoreWithMiddleware = applyMiddleware(thunkMiddleware)(createStore)