diff --git a/frontend/src/components/data-tables/data-table/data-cell.jsx b/frontend/src/components/DataTable/DataCell.jsx similarity index 93% rename from frontend/src/components/data-tables/data-table/data-cell.jsx rename to frontend/src/components/DataTable/DataCell.jsx index 2c5a27c6..98718e2e 100644 --- a/frontend/src/components/data-tables/data-table/data-cell.jsx +++ b/frontend/src/components/DataTable/DataCell.jsx @@ -1,8 +1,8 @@ /*-----------------------------------------------------------------------------*/ import React from 'react'; import PropTypes from 'prop-types'; -import * as utils from '../../../utils'; -import './data-table.css'; +import * as utils from '../../utils'; +import './DataTable.css'; //---------------------------------------------------------------------- export default class DataCell extends React.Component { diff --git a/frontend/src/components/data-tables/data-table/data-row.jsx b/frontend/src/components/DataTable/DataRow.jsx similarity index 89% rename from frontend/src/components/data-tables/data-table/data-row.jsx rename to frontend/src/components/DataTable/DataRow.jsx index 130cc796..8de498a0 100644 --- a/frontend/src/components/data-tables/data-table/data-row.jsx +++ b/frontend/src/components/DataTable/DataRow.jsx @@ -1,7 +1,7 @@ /*-----------------------------------------------------------------------------*/ import React from 'react'; -import DataCell from './data-cell'; -import './data-table.css'; +import DataCell from './DataCell'; +import './DataTable.css'; //---------------------------------------------------------------------- export default class DataRow extends React.Component { diff --git a/frontend/src/components/data-tables/data-table/data-table.css b/frontend/src/components/DataTable/DataTable.css similarity index 100% rename from frontend/src/components/data-tables/data-table/data-table.css rename to frontend/src/components/DataTable/DataTable.css diff --git a/frontend/src/components/data-tables/data-table/data-table.jsx b/frontend/src/components/DataTable/DataTable.jsx similarity index 94% rename from frontend/src/components/data-tables/data-table/data-table.jsx rename to frontend/src/components/DataTable/DataTable.jsx index 0744f09a..74b3c397 100644 --- a/frontend/src/components/data-tables/data-table/data-table.jsx +++ b/frontend/src/components/DataTable/DataTable.jsx @@ -3,12 +3,12 @@ import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; -import TableControls from '../table-controls'; -import HeaderRow from './header-row'; -import DataRow from './data-row'; +import { DataTableControls } from '../DataTableControls'; +import HeaderRow from './HeaderRow'; +import DataRow from './DataRow'; -import * as utils from '../../../utils'; -import './data-table.css'; +import * as utils from '../../utils'; +import './DataTable.css'; //---------------------------------------------------------------------- class DataTable extends React.Component { @@ -86,7 +86,7 @@ class DataTable extends React.Component { return (

{'Table title: ' + str}

- - - + + ); } -TableControls.propTypes = { +DataTableControls.propTypes = { n_items: PropTypes.number.isRequired, pages: PropTypes.number.isRequired, cur_page: PropTypes.number.isRequired, per_page: (PropTypes.number || PropTypes.number).isRequired }; - -export default TableControls; diff --git a/frontend/src/components/data-tables/table-controls/table-scroll.jsx b/frontend/src/components/DataTableControls/DataTableScroll.jsx similarity index 81% rename from frontend/src/components/data-tables/table-controls/table-scroll.jsx rename to frontend/src/components/DataTableControls/DataTableScroll.jsx index e2cafdf1..90ec8d2f 100644 --- a/frontend/src/components/data-tables/table-controls/table-scroll.jsx +++ b/frontend/src/components/DataTableControls/DataTableScroll.jsx @@ -1,10 +1,10 @@ /*-----------------------------------------------------------------------------*/ import React, { Fragment } from 'react'; -import { Icon } from '../../icon'; -import '../data-table/data-table.css'; +import { Icon } from '../Icon'; +import '../DataTable/DataTable.css'; //---------------------------------------------------------------------- -function TableScroll({ n_items, pages, cur_page, per_page, perPageChanged }) { +export function DataTableScroll({ n_items, pages, cur_page, per_page, perPageChanged }) { return (
@@ -22,5 +22,3 @@ function TableScroll({ n_items, pages, cur_page, per_page, perPageChanged }) {
); } - -export default TableScroll; diff --git a/frontend/src/components/data-tables/table-controls/table-search.jsx b/frontend/src/components/DataTableControls/DataTableSearch.jsx similarity index 69% rename from frontend/src/components/data-tables/table-controls/table-search.jsx rename to frontend/src/components/DataTableControls/DataTableSearch.jsx index 17b20c9d..4f768af1 100644 --- a/frontend/src/components/data-tables/table-controls/table-search.jsx +++ b/frontend/src/components/DataTableControls/DataTableSearch.jsx @@ -1,9 +1,9 @@ /*-----------------------------------------------------------------------------*/ import React from 'react'; -import '../data-table/data-table.css'; +import '../DataTable/DataTable.css'; //---------------------------------------------------------------------- -function TableSearch({ size = '70', placeholder = 'Search...', style = { textAlign: 'left' } }) { +export function DataTableSearch({ size = '70', placeholder = 'Search...', style = { textAlign: 'left' } }) { return (
@@ -12,5 +12,3 @@ function TableSearch({ size = '70', placeholder = 'Search...', style = { textAli
); } - -export default TableSearch; diff --git a/frontend/src/components/DataTableControls/index.js b/frontend/src/components/DataTableControls/index.js new file mode 100644 index 00000000..1b4e9d1e --- /dev/null +++ b/frontend/src/components/DataTableControls/index.js @@ -0,0 +1,2 @@ +import { DataTableControls } from './DataTableControls'; +export { DataTableControls }; diff --git a/frontend/src/components/data-tables/object-data-table.css b/frontend/src/components/DataTableObject/DataTableObject.css similarity index 100% rename from frontend/src/components/data-tables/object-data-table.css rename to frontend/src/components/DataTableObject/DataTableObject.css diff --git a/frontend/src/components/data-tables/object-data-table.jsx b/frontend/src/components/DataTableObject/DataTableObject.jsx similarity index 96% rename from frontend/src/components/data-tables/object-data-table.jsx rename to frontend/src/components/DataTableObject/DataTableObject.jsx index bfe3173b..3fc9b356 100644 --- a/frontend/src/components/data-tables/object-data-table.jsx +++ b/frontend/src/components/DataTableObject/DataTableObject.jsx @@ -1,11 +1,11 @@ /*-----------------------------------------------------------------------------*/ import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; -import './object-data-table.css'; +import './DataTableObject.css'; import * as utils from '../../utils'; //---------------------------------------------------------------------- -export class ObjectTable extends React.Component { +export class DataTableObject extends React.Component { constructor(props) { super(props); var fields = []; diff --git a/frontend/src/components/DataTableObject/index.js b/frontend/src/components/DataTableObject/index.js new file mode 100644 index 00000000..7dfbe06a --- /dev/null +++ b/frontend/src/components/DataTableObject/index.js @@ -0,0 +1,2 @@ +import { DataTableObject } from './DataTableObject'; +export { DataTableObject }; diff --git a/frontend/src/components/data-tables/old-data-table.css b/frontend/src/components/DataTableOld/DataTableOld.css similarity index 100% rename from frontend/src/components/data-tables/old-data-table.css rename to frontend/src/components/DataTableOld/DataTableOld.css diff --git a/frontend/src/components/data-tables/old-data-table.js b/frontend/src/components/DataTableOld/DataTableOld.js similarity index 98% rename from frontend/src/components/data-tables/old-data-table.js rename to frontend/src/components/DataTableOld/DataTableOld.js index 0bf53397..d0383299 100644 --- a/frontend/src/components/data-tables/old-data-table.js +++ b/frontend/src/components/DataTableOld/DataTableOld.js @@ -1,12 +1,12 @@ //---------------------------------------------------------------------- import React, { Fragment } from 'react'; -import './old-data-table.css'; +import './DataTableOld.css'; import Identicon from './identicons'; -import { Icon } from '../icon'; +import { Icon } from '../Icon'; var Utils = require('../../utils'); //--------------------------------------------------------------------- -export class OldDataTable extends React.Component { +export class DataTableOld extends React.Component { render = () => { return ( diff --git a/frontend/src/components/data-tables/identicons.css b/frontend/src/components/DataTableOld/identicons.css similarity index 100% rename from frontend/src/components/data-tables/identicons.css rename to frontend/src/components/DataTableOld/identicons.css diff --git a/frontend/src/components/data-tables/identicons.jsx b/frontend/src/components/DataTableOld/identicons.jsx similarity index 100% rename from frontend/src/components/data-tables/identicons.jsx rename to frontend/src/components/DataTableOld/identicons.jsx diff --git a/frontend/src/components/DataTableOld/index.js b/frontend/src/components/DataTableOld/index.js new file mode 100644 index 00000000..a70b9d9e --- /dev/null +++ b/frontend/src/components/DataTableOld/index.js @@ -0,0 +1,2 @@ +import { DataTableOld } from './DataTableOld'; +export { DataTableOld }; diff --git a/frontend/src/components/panels/help.jsx b/frontend/src/components/HelpPanel.jsx similarity index 89% rename from frontend/src/components/panels/help.jsx rename to frontend/src/components/HelpPanel.jsx index 1427e708..4074c26a 100644 --- a/frontend/src/components/panels/help.jsx +++ b/frontend/src/components/HelpPanel.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { SidePanel } from '../'; +import { SidePanel } from './SidePanel'; export const HelpPanel = (props) => { const { isExpanded, toggle } = props; diff --git a/frontend/src/components/MainMenu/Chevron.jsx b/frontend/src/components/MainMenu/Chevron.jsx index 346625f5..7cb608d6 100644 --- a/frontend/src/components/MainMenu/Chevron.jsx +++ b/frontend/src/components/MainMenu/Chevron.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Icon } from '../icon'; +import { Icon } from '../Icon'; //------------------------------------------------------------ export default function Chevron({ active }) { diff --git a/frontend/src/components/MainMenu/MainMenu.jsx b/frontend/src/components/MainMenu/MainMenu.jsx index 925ebe85..f4970fda 100644 --- a/frontend/src/components/MainMenu/MainMenu.jsx +++ b/frontend/src/components/MainMenu/MainMenu.jsx @@ -71,4 +71,4 @@ const mapStateToProps = ({ router, reducer_MainMenu }, ownProps) => ({ toggle: ownProps.toggle }); -export default connect(mapStateToProps)(MainMenu); +export const ConnectedMainMenu = connect(mapStateToProps)(MainMenu); diff --git a/frontend/src/components/MainMenu/index.js b/frontend/src/components/MainMenu/index.js index 095b22c3..3edc55e6 100644 --- a/frontend/src/components/MainMenu/index.js +++ b/frontend/src/components/MainMenu/index.js @@ -1,2 +1,2 @@ -import MainMenu from './MainMenu'; +import { ConnectedMainMenu as MainMenu } from './MainMenu'; export { MainMenu }; diff --git a/frontend/src/components/not-ready.jsx b/frontend/src/components/NotReady.jsx similarity index 95% rename from frontend/src/components/not-ready.jsx rename to frontend/src/components/NotReady.jsx index 365e9131..f9043b7e 100644 --- a/frontend/src/components/not-ready.jsx +++ b/frontend/src/components/NotReady.jsx @@ -1,6 +1,5 @@ import React, { Fragment } from 'react'; -//import PropTypes from 'prop-types'; -import { Loading } from './loading'; +import { Loading } from './Loading'; //---------------------------------------------------------------- export class NotReady extends React.Component { diff --git a/frontend/src/components/panels/status.css b/frontend/src/components/StatusPanel/StatusPanel.css similarity index 100% rename from frontend/src/components/panels/status.css rename to frontend/src/components/StatusPanel/StatusPanel.css diff --git a/frontend/src/components/panels/status.jsx b/frontend/src/components/StatusPanel/StatusPanel.jsx similarity index 82% rename from frontend/src/components/panels/status.jsx rename to frontend/src/components/StatusPanel/StatusPanel.jsx index a776e2a0..a709418a 100644 --- a/frontend/src/components/panels/status.jsx +++ b/frontend/src/components/StatusPanel/StatusPanel.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { SidePanel } from '../SidePanel'; -import StatusInner from './status-inner'; -import './status.css'; +import StatusInner from './StatusPanelInner'; +import './StatusPanel.css'; export const StatusPanel = (props) => { const { isExpanded, toggle } = props; diff --git a/frontend/src/components/panels/status-inner.js b/frontend/src/components/StatusPanel/StatusPanelInner.js similarity index 97% rename from frontend/src/components/panels/status-inner.js rename to frontend/src/components/StatusPanel/StatusPanelInner.js index 29c81929..b4063f08 100644 --- a/frontend/src/components/panels/status-inner.js +++ b/frontend/src/components/StatusPanel/StatusPanelInner.js @@ -3,14 +3,14 @@ import { Fragment } from 'react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; -import { polling } from '../polling'; +import { Polling } from '../Polling'; import { fmtDouble, fmtInteger } from '../../utils'; import green_light from '../../img/status-green-light.png'; import yellow_light from '../../img/status-yellow-light.png'; import red_light from '../../img/status-red-light.png'; -import { dispatcher_Status } from './status-actions'; -import './status.css'; +import { dispatcher_Status } from './reducers'; +import './StatusPanel.css'; //--------------------------------------------------------------------- const StatusInner = (props) => { @@ -216,4 +216,4 @@ const mapDispatchToProps = (dispatch) => ); //--------------------------------------------------------------------- -export default polling(dispatcher_Status, 10000)(connect(mapStateToProps, mapDispatchToProps)(StatusInner)); +export default Polling(dispatcher_Status, 10000)(connect(mapStateToProps, mapDispatchToProps)(StatusInner)); diff --git a/frontend/src/components/StatusPanel/index.js b/frontend/src/components/StatusPanel/index.js new file mode 100644 index 00000000..831ae4e4 --- /dev/null +++ b/frontend/src/components/StatusPanel/index.js @@ -0,0 +1,2 @@ +import { StatusPanel } from './StatusPanel'; +export { StatusPanel }; diff --git a/frontend/src/components/panels/status-actions.js b/frontend/src/components/StatusPanel/reducers.js similarity index 100% rename from frontend/src/components/panels/status-actions.js rename to frontend/src/components/StatusPanel/reducers.js diff --git a/frontend/src/components/data-tables/data-table/index.js b/frontend/src/components/data-tables/data-table/index.js deleted file mode 100644 index 3d436291..00000000 --- a/frontend/src/components/data-tables/data-table/index.js +++ /dev/null @@ -1 +0,0 @@ -export { ConnectedDataTable } from './data-table'; diff --git a/frontend/src/components/data-tables/index.js b/frontend/src/components/data-tables/index.js deleted file mode 100644 index 8e24fdf4..00000000 --- a/frontend/src/components/data-tables/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { ConnectedDataTable as DataTable } from './data-table'; - -export { DataTable }; diff --git a/frontend/src/components/data-tables/table-controls/index.js b/frontend/src/components/data-tables/table-controls/index.js deleted file mode 100644 index 49e345d3..00000000 --- a/frontend/src/components/data-tables/table-controls/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import TableControls from './table-controls'; - -export default TableControls; diff --git a/frontend/src/components/icon.jsx b/frontend/src/components/icon.jsx index d6a2f88e..9f4e2ea1 100644 --- a/frontend/src/components/icon.jsx +++ b/frontend/src/components/icon.jsx @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import './icon.css'; +import './Icon.css'; //---------------------------------------------------------------------- export class Icon extends Component { diff --git a/frontend/src/components/index.js b/frontend/src/components/index.js index 6a123a1a..4982ca18 100644 --- a/frontend/src/components/index.js +++ b/frontend/src/components/index.js @@ -1,17 +1,17 @@ import { Page, PageHeader, PageFooter } from './Page'; -import { DataTable } from './data-tables'; -import { OldDataTable } from './data-tables/old-data-table'; -import { ObjectTable } from './data-tables/object-data-table'; -import { Icon } from './icon'; -import { Loading } from './loading'; -import { isReady, isError, NotReady, isEmpty, EmptyQuery } from './not-ready'; +import { DataTable } from './DataTable'; +import { DataTableOld } from './DataTableOld'; +import { DataTableObject } from './DataTableObject'; +import { Icon } from './Icon'; +import { Loading } from './Loading'; +import { isReady, isError, NotReady, isEmpty, EmptyQuery } from './NotReady'; import { BreadCrumb } from './BreadCrumb'; import { DashMenu } from './DashMenu'; import { TopScrollObserver } from './TopScrollObserver'; import { MainMenu } from './MainMenu'; import { SidePanel } from './SidePanel'; -import StatusPanel from './panels/status'; -import HelpPanel from './panels/help'; +import { StatusPanel } from './StatusPanel'; +import HelpPanel from './HelpPanel'; import PageHelp from './PageHelp'; import ExpandShrinkIcon from './ExpandShrinkIcon'; @@ -20,8 +20,8 @@ export { PageHeader, PageFooter, DataTable, - OldDataTable, - ObjectTable, + DataTableOld, + DataTableObject, Icon, Loading, isReady, diff --git a/frontend/src/components/loading.jsx b/frontend/src/components/loading.jsx index 0b133a29..3ad65917 100644 --- a/frontend/src/components/loading.jsx +++ b/frontend/src/components/loading.jsx @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Icon } from './icon'; -import './loading.css'; +import { Icon } from './Icon'; +import './Loading.css'; //---------------------------------------------------------------------- export class Loading extends React.Component { diff --git a/frontend/src/components/polling.jsx b/frontend/src/components/polling.jsx index e792e17e..a7c3c6a9 100644 --- a/frontend/src/components/polling.jsx +++ b/frontend/src/components/polling.jsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { connect } from 'react-redux'; -export const polling = (pollingAction, duration = 5000) => (Component) => { +export const Polling = (pollingAction, duration = 5000) => (Component) => { const Wrapper = () => class extends React.Component { componentDidMount = () => { diff --git a/frontend/src/pages/addresses/inner.js b/frontend/src/pages/addresses/inner.js index 2edb19a8..5eff0ca2 100644 --- a/frontend/src/pages/addresses/inner.js +++ b/frontend/src/pages/addresses/inner.js @@ -13,7 +13,7 @@ import './addresses.css'; // EXISTING_CODE import { dispatcher_RemoveMonitor, dispatcher_AddMonitor } from './dispatchers'; -import { OldDataTable } from '../../components'; +import { DataTableOld } from '../../components'; const headings = ['', 'Name', 'First', 'Last', 'Range', 'Count', 'Interval', 'Bytes', 'Balance', '']; // EXISTING_CODE @@ -61,7 +61,7 @@ class AddressesInner extends React.Component {
- +
;
diff --git a/frontend/src/pages/explore/inner.js b/frontend/src/pages/explore/inner.js index c09bf057..7fbc7ee3 100644 --- a/frontend/src/pages/explore/inner.js +++ b/frontend/src/pages/explore/inner.js @@ -7,7 +7,7 @@ import { dispatcher_Explore } from './dispatchers'; import { BreadCrumb } from '../../components'; import { isError, NotReady, isEmpty, EmptyQuery } from '../../components'; import { isReady } from '../../components'; -import { ObjectTable } from '../../components'; +import { DataTableObject } from '../../components'; import * as utils from '../../utils'; import './explore.css'; @@ -39,7 +39,7 @@ class ExploreInner extends React.Component { else if (isEmpty(this.props.data)) return ; // EXISTING_CODE // EXISTING_CODE - return ; + return ; }; render = () => { diff --git a/frontend/src/pages/templates/blank-content.js b/frontend/src/pages/templates/blank-content.js index 336065d3..c80eca8d 100644 --- a/frontend/src/pages/templates/blank-content.js +++ b/frontend/src/pages/templates/blank-content.js @@ -11,7 +11,8 @@ import Routes from './routes'; import './Content.css'; const mainMenu = [ -[{NAVLINKS}]]; +[{NAVLINKS}] +]; const toggleStatus = () => ({ type: STATUS_TOGGLE }); const toggleHelp = () => ({ type: HELP_TOGGLE }); diff --git a/frontend/src/pages/templates/blank-inner.js b/frontend/src/pages/templates/blank-inner.js index ca03a904..18f001a3 100644 --- a/frontend/src/pages/templates/blank-inner.js +++ b/frontend/src/pages/templates/blank-inner.js @@ -5,7 +5,7 @@ import { bindActionCreators } from 'redux'; import { dispatcher_[{PROPER}] } from './dispatchers'; import { [{MENU_TYPE}] } from '../../components'; -import { BreadCrumb } from '../../components' +import { BreadCrumb } from '../../components'; [{NO_ERROR}]import { isError, NotReady, isEmpty, EmptyQuery } from '../../components'; [{NO_DATA}]import { isReady } from '../../components'; [{NO_DT}]import { [{DT_TYPE}] } from '../../components'; @@ -37,8 +37,7 @@ class [{PROPER}]Inner extends React.Component { // EXISTING_CODE getInnerPage = () => { - [{NO_DASH}]if (this.state.cur_submenu.subpage === 'dashboard') - [{NO_DASH}] return
The dashboard for [{PROPER}]
+ [{NO_DASH}]if (this.state.cur_submenu.subpage === 'dashboard') return
The dashboard for [{PROPER}]
; [{NO_TEXT}][{TEXT_CODE}] [{NO_ERROR}]if (isError(this.props)) return ; [{NO_DATA}]else if (!isReady(this.props, this.props.data)) return ; @@ -50,11 +49,11 @@ class [{PROPER}]Inner extends React.Component { render = () => { return ( -
- - {this.getInnerPage()} - {JSON.stringify(this.state)} -
+
+ + {this.getInnerPage()} + {JSON.stringify(this.state)} +
); }; } @@ -86,7 +85,4 @@ const mapDispatchToProps = (dispatch) => ); //---------------------------------------------------------------------- -export default connect( - mapStateToProps, - mapDispatchToProps -)([{PROPER}]Inner); +export default connect(mapStateToProps, mapDispatchToProps)([{PROPER}]Inner); diff --git a/frontend/src/pages/templates/blank-root-reducers.js b/frontend/src/pages/templates/blank-root-reducers.js index 366188f8..f3ca6c22 100644 --- a/frontend/src/pages/templates/blank-root-reducers.js +++ b/frontend/src/pages/templates/blank-root-reducers.js @@ -1,7 +1,7 @@ import { combineReducers } from 'redux'; //------------------------------------------------------------------------ -import reducer_Status from './components/panels/status-actions'; +import reducer_Status from './components/StatusPanel/reducers'; import reducer_SidePanels from './components/SidePanel/reducers'; import reducer_LastLocation from './last-location-actions'; import reducer_MainMenu from './components/MainMenu/reducers'; diff --git a/frontend/src/root-reducers.js b/frontend/src/root-reducers.js index 1ab03a50..5654ce28 100644 --- a/frontend/src/root-reducers.js +++ b/frontend/src/root-reducers.js @@ -1,7 +1,7 @@ import { combineReducers } from 'redux'; //------------------------------------------------------------------------ -import reducer_Status from './components/panels/status-actions'; +import reducer_Status from './components/StatusPanel/reducers'; import reducer_SidePanels from './components/SidePanel/reducers'; import reducer_LastLocation from './last-location-actions'; import reducer_MainMenu from './components/MainMenu/reducers';