From 6a7f600fd3c1c279c46e7ed27d95d9be1506452a Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Fri, 15 May 2020 00:58:41 +0300 Subject: [PATCH] move elements from system namespace to server namespace --- src/components/home/HomePage.js | 4 ++-- src/features/{system => server}/actionCreators.js | 0 src/features/{system => server}/actionTypes.js | 0 src/features/{system => server}/api.js | 0 .../components/ActiveSessionComponent.js | 0 .../components/ServerComponent.js} | 4 ++-- .../components/ServerContainer.js} | 14 +++++++------- src/features/{system => server}/reducer.js | 2 +- src/redux/reducers/index.js | 4 ++-- src/redux/reducers/initialState.js | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) rename src/features/{system => server}/actionCreators.js (100%) rename src/features/{system => server}/actionTypes.js (100%) rename src/features/{system => server}/api.js (100%) rename src/features/{system => server}/components/ActiveSessionComponent.js (100%) rename src/features/{system/components/SystemComponent.js => server/components/ServerComponent.js} (98%) rename src/features/{system/components/SystemContainer.js => server/components/ServerContainer.js} (72%) rename src/features/{system => server}/reducer.js (83%) diff --git a/src/components/home/HomePage.js b/src/components/home/HomePage.js index c751752..204c0dc 100644 --- a/src/components/home/HomePage.js +++ b/src/components/home/HomePage.js @@ -1,10 +1,10 @@ import React from "react"; -import SystemContainer from "../../features/system/components/SystemContainer"; +import ServerContainer from "../../features/server/components/ServerContainer"; const HomePage = () => { return ( <> - + ); }; diff --git a/src/features/system/actionCreators.js b/src/features/server/actionCreators.js similarity index 100% rename from src/features/system/actionCreators.js rename to src/features/server/actionCreators.js diff --git a/src/features/system/actionTypes.js b/src/features/server/actionTypes.js similarity index 100% rename from src/features/system/actionTypes.js rename to src/features/server/actionTypes.js diff --git a/src/features/system/api.js b/src/features/server/api.js similarity index 100% rename from src/features/system/api.js rename to src/features/server/api.js diff --git a/src/features/system/components/ActiveSessionComponent.js b/src/features/server/components/ActiveSessionComponent.js similarity index 100% rename from src/features/system/components/ActiveSessionComponent.js rename to src/features/server/components/ActiveSessionComponent.js diff --git a/src/features/system/components/SystemComponent.js b/src/features/server/components/ServerComponent.js similarity index 98% rename from src/features/system/components/SystemComponent.js rename to src/features/server/components/ServerComponent.js index 309201e..b69b898 100644 --- a/src/features/system/components/SystemComponent.js +++ b/src/features/server/components/ServerComponent.js @@ -31,7 +31,7 @@ const useStyles = makeStyles((theme) => ({ } })); -const SystemComponent = () => { +const ServerComponent = () => { const classes = useStyles(); const [expanded, setExpanded] = React.useState(false); @@ -115,4 +115,4 @@ const SystemComponent = () => { ); }; -export default SystemComponent; +export default ServerComponent; diff --git a/src/features/system/components/SystemContainer.js b/src/features/server/components/ServerContainer.js similarity index 72% rename from src/features/system/components/SystemContainer.js rename to src/features/server/components/ServerContainer.js index 30498cb..047796c 100644 --- a/src/features/system/components/SystemContainer.js +++ b/src/features/server/components/ServerContainer.js @@ -3,10 +3,10 @@ import { connect } from "react-redux"; import { bindActionCreators } from "redux"; import PropTypes from "prop-types"; import { loadSystemDateTime, loadSystemVersion } from "../actionCreators"; -import SystemComponent from "./SystemComponent"; +import ServerComponent from "./ServerComponent"; import ActiveSessionComponent from "./ActiveSessionComponent"; -const SystemContainer = ({ actions }) => { +const ServerContainer = ({ actions }) => { useEffect(() => { actions.loadSystemDateTime(); actions.loadSystemVersion(); @@ -14,7 +14,7 @@ const SystemContainer = ({ actions }) => { return ( <> - +

@@ -22,14 +22,14 @@ const SystemContainer = ({ actions }) => { ); }; -SystemContainer.propTypes = { +ServerContainer.propTypes = { actions: PropTypes.object.isRequired, - system: PropTypes.object.isRequired + server: PropTypes.object.isRequired }; function mapStateToProps(state) { return { - system: state.system + server: state.server }; } @@ -42,4 +42,4 @@ function mapDispatchToProps(dispatch) { }; } -export default connect(mapStateToProps, mapDispatchToProps)(SystemContainer); +export default connect(mapStateToProps, mapDispatchToProps)(ServerContainer); diff --git a/src/features/system/reducer.js b/src/features/server/reducer.js similarity index 83% rename from src/features/system/reducer.js rename to src/features/server/reducer.js index 1199eab..00c88f2 100644 --- a/src/features/system/reducer.js +++ b/src/features/server/reducer.js @@ -1,7 +1,7 @@ import * as types from "./actionTypes"; import initialState from "../../redux/reducers/initialState"; -export default function systemReducer(state = initialState.system, action) { +export default function serverReducer(state = initialState.server, action) { switch (action.type) { case types.LOAD_SYSTEM_DATETIME_SUCCESS: return { diff --git a/src/redux/reducers/index.js b/src/redux/reducers/index.js index f42ef8e..4eee89e 100644 --- a/src/redux/reducers/index.js +++ b/src/redux/reducers/index.js @@ -1,6 +1,6 @@ import { combineReducers } from "redux"; import ajaxStatusReducer from "./ajaxStatusReducer"; -import systemReducer from "../../features/system/reducer"; +import serverReducer from "../../features/server/reducer"; import { sessionsReducer, forwardsReducer @@ -8,7 +8,7 @@ import { import releaseNotesReducer from "../../features/releaseNotes/reducer"; const rootReducer = combineReducers({ - system: systemReducer, + server: serverReducer, sessions: sessionsReducer, forwards: forwardsReducer, releaseNotes: releaseNotesReducer, diff --git a/src/redux/reducers/initialState.js b/src/redux/reducers/initialState.js index b8ca7c3..331243f 100644 --- a/src/redux/reducers/initialState.js +++ b/src/redux/reducers/initialState.js @@ -1,5 +1,5 @@ export default { - system: {}, + server: {}, sessions: Object.assign([], { loading: false, loaded: false }), forwards: {}, releaseNotes: Object.assign([], { loading: false, loaded: false }),