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.
master
Kanagaraj M 7 years ago committed by Harshavardhana
parent ead6337eab
commit 9bfa07ecf5
  1. 2
      browser/app/index.js
  2. 8
      browser/app/js/App.js
  3. 0
      browser/app/js/__tests__/App.test.js
  4. 0
      browser/app/js/alert/Alert.js
  5. 0
      browser/app/js/alert/__tests___/Alert.test.js
  6. 2
      browser/app/js/alert/__tests___/actions.test.js
  7. 6
      browser/app/js/alert/__tests___/reducer.test.js
  8. 0
      browser/app/js/alert/actions.js
  9. 2
      browser/app/js/alert/reducer.js
  10. 0
      browser/app/js/browser/Browser.js
  11. 2
      browser/app/js/browser/Header.js
  12. 0
      browser/app/js/browser/Host.js
  13. 7
      browser/app/js/browser/Login.js
  14. 2
      browser/app/js/browser/MainContent.js
  15. 4
      browser/app/js/browser/MobileHeader.js
  16. 8
      browser/app/js/browser/SideBar.js
  17. 4
      browser/app/js/browser/StorageInfo.js
  18. 0
      browser/app/js/browser/__tests__/Browser.test.js
  19. 0
      browser/app/js/browser/__tests__/Host.test.js
  20. 0
      browser/app/js/browser/__tests__/Login.test.js
  21. 0
      browser/app/js/browser/__tests__/MobileHeader.test.js
  22. 0
      browser/app/js/browser/__tests__/SideBar.test.js
  23. 0
      browser/app/js/browser/__tests__/StorageInfo.test.js
  24. 2
      browser/app/js/browser/__tests__/actions.test.js
  25. 4
      browser/app/js/browser/__tests__/reducer.test.js
  26. 0
      browser/app/js/browser/actions.js
  27. 2
      browser/app/js/browser/reducer.js
  28. 0
      browser/app/js/buckets/Bucket.js
  29. 4
      browser/app/js/buckets/BucketContainer.js
  30. 4
      browser/app/js/buckets/BucketList.js
  31. 2
      browser/app/js/buckets/BucketSearch.js
  32. 0
      browser/app/js/buckets/__tests__/Bucket.test.js
  33. 0
      browser/app/js/buckets/__tests__/BucketContainer.test.js
  34. 0
      browser/app/js/buckets/__tests__/BucketList.test.js
  35. 0
      browser/app/js/buckets/__tests__/BucketSearch.test.js
  36. 6
      browser/app/js/buckets/__tests__/actions.test.js
  37. 4
      browser/app/js/buckets/__tests__/reducer.test.js
  38. 2
      browser/app/js/buckets/__tests__/selectors.test.js
  39. 0
      browser/app/js/buckets/actions.js
  40. 2
      browser/app/js/buckets/reducer.js
  41. 0
      browser/app/js/buckets/selectors.js
  42. 2
      browser/app/js/objects/ObjectContainer.js
  43. 0
      browser/app/js/objects/ObjectItem.js
  44. 2
      browser/app/js/objects/ObjectsHeader.js
  45. 0
      browser/app/js/objects/ObjectsList.js
  46. 2
      browser/app/js/objects/ObjectsListContainer.js
  47. 0
      browser/app/js/objects/ObjectsSection.js
  48. 4
      browser/app/js/objects/Path.js
  49. 2
      browser/app/js/objects/PrefixContainer.js
  50. 0
      browser/app/js/objects/__tests__/ObjectsHeader.test.js
  51. 0
      browser/app/js/objects/__tests__/ObjectsList.test.js
  52. 0
      browser/app/js/objects/__tests__/ObjectsListContainer.test.js
  53. 0
      browser/app/js/objects/__tests__/ObjetctItem.test.js
  54. 0
      browser/app/js/objects/__tests__/Path.test.js
  55. 0
      browser/app/js/objects/__tests__/PrefixContainer.test.js
  56. 2
      browser/app/js/objects/__tests__/actions.test.js
  57. 4
      browser/app/js/objects/__tests__/reducer.test.js
  58. 0
      browser/app/js/objects/actions.js
  59. 2
      browser/app/js/objects/reducer.js
  60. 10
      browser/app/js/reducers.js
  61. 2
      browser/app/js/store/configure-store.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()

@ -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 }) => (
<Route

@ -16,7 +16,7 @@
import configureStore from "redux-mock-store"
import thunk from "redux-thunk"
import * as actionsAlert from "../alert"
import * as actionsAlert from "../actions"
const middlewares = [thunk]
const mockStore = configureStore(middlewares)

@ -14,10 +14,10 @@
* limitations under the License.
*/
import reducer from "../alert"
import * as actionsAlert from "../../actions/alert"
import reducer from "../reducer"
import * as actionsAlert from "../actions"
describe("buckets reducer", () => {
describe("alert reducer", () => {
it("should return the initial state", () => {
expect(reducer(undefined, {})).toEqual({
show: false,

@ -14,7 +14,7 @@
* limitations under the License.
*/
import * as actionsAlert from "../actions/alert"
import * as actionsAlert from "./actions"
const initialState = {
show: false,

@ -15,7 +15,7 @@
*/
import React from "react"
import Path from "./Path"
import Path from "../objects/Path"
import StorageInfo from "./StorageInfo"
export const Header = () => (

@ -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())
}
}

@ -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 = () => (
<div className="fe-body">

@ -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 }) => (
<header className="fe-header-mobile hidden-lg hidden-md">
@ -47,7 +47,7 @@ export const MobileHeader = ({ sidebarOpen, toggleSidebar }) => (
const mapStateToProps = state => {
return {
sidebarOpen: state.common.sidebarOpen
sidebarOpen: state.browser.sidebarOpen
}
}

@ -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
}
}

@ -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
}
}

@ -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(() => {

@ -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", () => {

@ -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 } },

@ -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) => {

@ -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 {

@ -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 }) => (
<div

@ -16,7 +16,7 @@
import configureStore from "redux-mock-store"
import thunk from "redux-thunk"
import * as actionsBuckets from "../buckets"
import * as actionsBuckets from "../actions"
jest.mock("../../web", () => ({
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)

@ -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", () => {

@ -14,7 +14,7 @@
* limitations under the License.
*/
import { getVisibleBuckets, getCurrentBucket } from "../buckets"
import { getVisibleBuckets, getCurrentBucket } from "../selectors"
describe("getVisibleBuckets", () => {
let state

@ -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: "" },

@ -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 = []

@ -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,

@ -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 {

@ -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) => {

@ -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 = {

@ -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(() => {

@ -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", () => {

@ -14,7 +14,7 @@
* limitations under the License.
*/
import * as actionsObjects from "../actions/objects"
import * as actionsObjects from "./actions"
export default (
state = {

@ -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

@ -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)

Loading…
Cancel
Save