Skip to content

Commit

Permalink
Merge pull request #7 from cbridges1/refactor
Browse files Browse the repository at this point in the history
Refactor
  • Loading branch information
cbridges1 committed Jan 20, 2021
2 parents 14b8c42 + 922f6a6 commit 409e837
Show file tree
Hide file tree
Showing 56 changed files with 116 additions and 179 deletions.
19 changes: 9 additions & 10 deletions src/components/App/index.jsx → src/components/App.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import React, { lazy, Suspense } from 'react';
import 'react-quill/dist/quill.snow.css';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import '../../css/acsys.css';
import '../../css/react-datetime.css';
import { getRefreshSession } from '../../services/Session/session';
import Loading from '../Loading';
import './App.css';
import '../css/acsys.css';
import '../css/react-datetime.css';
import { getRefreshSession } from '../utils/Session/session';
import Loading from './Loading';

const SignInPage = lazy(() => import('../SignIn'));
const PasswordReset = lazy(() => import('../PasswordReset'));
const ForgotPassword = lazy(() => import('../ForgotPassword'));
const SignInPage = lazy(() => import('../pages/SignIn'));
const PasswordReset = lazy(() => import('../pages/PasswordReset'));
const ForgotPassword = lazy(() => import('../pages/ForgotPassword'));

const Driver = lazy(() => import('../Driver'));
const Driver = lazy(() => import('./Driver'));

export default function App() {
return (
<div className="App">
<div>
<Router>
<Suspense fallback={<Loading />}>
<Switch>
Expand Down
38 changes: 0 additions & 38 deletions src/components/App/App.css

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Grid } from '@material-ui/core';
import React from 'react';

function AutoGen(props) {
export default function AutoGen(props) {
if (props.new) {
return (
<Grid item xs={props.width}>
Expand Down Expand Up @@ -30,4 +30,3 @@ function AutoGen(props) {
</Grid>
);
}
export default AutoGen;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Grid, NativeSelect } from '@material-ui/core';
import React from 'react';

function NumberEditor(props) {
export default function NumberEditor(props) {
return (
<Grid item xs={props.width}>
<h3 className="element-header">{props.field_name.toUpperCase()}</h3>
Expand All @@ -21,4 +21,3 @@ function NumberEditor(props) {
</Grid>
);
}
export default NumberEditor;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Grid } from '@material-ui/core';
import React from 'react';
import Datetime from 'react-datetime';

function DateTimePicker(props) {
export default function DateTimePicker(props) {
return (
<Grid item xs={props.width}>
<Grid container spacing={0}>
Expand All @@ -21,4 +21,3 @@ function DateTimePicker(props) {
</Grid>
);
}
export default DateTimePicker;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Button, Grid } from '@material-ui/core';
import React from 'react';

function ImageReference(props) {
export default function ImageReference(props) {
if (props.url === undefined || props.url === '') {
return (
<Grid item xs={props.width}>
Expand Down Expand Up @@ -44,4 +44,3 @@ function ImageReference(props) {
</Grid>
);
}
export default ImageReference;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Button, Grid } from '@material-ui/core';
import React from 'react';

function ImageURL(props) {
export default function ImageURL(props) {
if (props.url === undefined || props.url === '') {
return (
<Grid item xs={props.width}>
Expand Down Expand Up @@ -44,4 +44,3 @@ function ImageURL(props) {
</Grid>
);
}
export default ImageURL;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Grid } from '@material-ui/core';
import React from 'react';

function NumberEditor(props) {
export default function NumberEditor(props) {
return (
<Grid item xs={props.width}>
<h3 className="element-header">{props.field_name.toUpperCase()}</h3>
Expand All @@ -17,4 +17,3 @@ function NumberEditor(props) {
</Grid>
);
}
export default NumberEditor;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Grid, MenuItem, Select } from '@material-ui/core';
import React from 'react';

function Position(props) {
export default function Position(props) {
if (props.draft) {
return (
<Grid item xs={props.width}>
Expand Down Expand Up @@ -34,4 +34,3 @@ function Position(props) {
</Grid>
);
}
export default Position;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Grid, Hidden } from '@material-ui/core';
import React from 'react';
import ReactQuill from 'react-quill';

function RichTextEditor(props) {
export default function RichTextEditor(props) {
const modules = {
toolbar: {
container: [
Expand Down Expand Up @@ -61,4 +61,3 @@ function RichTextEditor(props) {
</Grid>
);
}
export default RichTextEditor;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Grid } from '@material-ui/core';
import React from 'react';

function TextField(props) {
export default function TextField(props) {
return (
<Grid item xs={props.width}>
<h3 className="element-header">{props.field_name.toUpperCase()}</h3>
Expand All @@ -15,4 +15,3 @@ function TextField(props) {
</Grid>
);
}
export default TextField;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Button, Grid } from '@material-ui/core';
import React from 'react';

function ImageReference(props) {
export default function ImageReference(props) {
if (props.url === undefined || props.url === '') {
return (
<Grid item xs={props.width}>
Expand Down Expand Up @@ -50,4 +50,3 @@ function ImageReference(props) {
</Grid>
);
}
export default ImageReference;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Button, Grid } from '@material-ui/core';
import React from 'react';

function ImageReference(props) {
export default function ImageReference(props) {
if (props.url === undefined || props.url === '') {
return (
<Grid item xs={props.width}>
Expand Down Expand Up @@ -50,4 +50,3 @@ function ImageReference(props) {
</Grid>
);
}
export default ImageReference;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Dialog } from '@material-ui/core';
import Storage from '../Storage';
import Storage from '../../pages/Storage';

export default function StorageDialog(props) {
return (
Expand Down
File renamed without changes.
File renamed without changes.
18 changes: 9 additions & 9 deletions src/components/Driver.jsx → src/components/Driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ import {
Switch,
} from 'react-router-dom';
import * as ROUTES from '../constants/routes';
import * as Acsys from '../services/Acsys/Acsys';
import * as Acsys from '../utils/Acsys/Acsys';
import Footer from './Footer';
import Header from './Header';
import Navigator from './Navigator';

const Account = lazy(() => import('./Account'));
const CollectionView = lazy(() => import('./CollectionView'));
const Database = lazy(() => import('./Database'));
const DocumentView = lazy(() => import('./DocumentView'));
const LogicalContent = lazy(() => import('./LogicalContent'));
const Settings = lazy(() => import('./Settings'));
const Storage = lazy(() => import('./Storage'));
const Users = lazy(() => import('./Users'));
const Account = lazy(() => import('../pages/Account'));
const CollectionView = lazy(() => import('../pages/CollectionView'));
const Database = lazy(() => import('../pages/Database'));
const DocumentView = lazy(() => import('../pages/DocumentView'));
const LogicalContent = lazy(() => import('../pages/LogicalContent'));
const Settings = lazy(() => import('../pages/Settings'));
const Storage = lazy(() => import('../pages/Storage'));
const Users = lazy(() => import('../pages/Users'));

export default function Driver(props) {
const [header, setHeader] = useState('');
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/components/Header.jsx → src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import MenuIcon from '@material-ui/icons/Menu';
import React from 'react';
import { Link } from 'react-router-dom';
import * as ROUTES from '../constants/routes';
import * as Acsys from '../services/Acsys/Acsys';
import SignOutButton from './SignOut';
import * as Acsys from '../utils/Acsys/Acsys';
import SignOutButton from '../pages/SignOut';

export default function Header(props) {
return (
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import clsx from 'clsx';
import React from 'react';
import { Link } from 'react-router-dom';
import * as ROUTES from '../constants/routes';
import * as Acsys from '../services/Acsys/Acsys';
import * as Acsys from '../utils/Acsys/Acsys';

const styles = (theme) =>
createStyles({
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions src/css/acsys.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}

#root {
height: 100%;
text-align: center;
}
.landing-grid {
min-height: 600px;
Expand Down
13 changes: 0 additions & 13 deletions src/index.css

This file was deleted.

11 changes: 5 additions & 6 deletions src/index.jsx → src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import { createMuiTheme, ThemeProvider } from '@material-ui/core/styles';
import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/App';
import Configuration from './components/Configuration';
import './index.css';
import * as Acsys from './services/Acsys/Acsys';
import { PromProvider } from './services/Session/PromProvider';
import Configuration from './pages/Configuration';
import * as Acsys from './utils/Acsys/Acsys';
import { AcsysProvider } from './utils/Session/AcsysProvider';
import * as serviceWorker from './serviceWorker';

let theme = createMuiTheme({
Expand Down Expand Up @@ -125,9 +124,9 @@ const init = async () => {
ReactDOM.render(
<body>
<ThemeProvider theme={theme}>
<PromProvider>
<AcsysProvider>
<App />
</PromProvider>
</AcsysProvider>
</ThemeProvider>
</body>,
document.getElementById('root')
Expand Down
7 changes: 0 additions & 7 deletions src/logo.svg

This file was deleted.

6 changes: 3 additions & 3 deletions src/components/Account/index.jsx → src/pages/Account.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import Grid from '@material-ui/core/Grid';
import Paper from '@material-ui/core/Paper';
import Typography from '@material-ui/core/Typography';
import { KeyboardArrowDown } from '@material-ui/icons';
import LoadingDialog from '../Dialogs/LoadingDialog';
import MessageDialog from '../Dialogs/MessageDialog';
import LoadingDialog from '../components/Dialogs/LoadingDialog';
import MessageDialog from '../components/Dialogs/MessageDialog';
import React from 'react';
import * as Acsys from '../../services/Acsys/Acsys';
import * as Acsys from '../utils/Acsys/Acsys';

const INITIAL_STATE = {
passwordChange: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ import React from 'react';
import { HTML5Backend } from 'react-dnd-html5-backend';
import { Link } from 'react-router-dom';
import uniqid from 'uniqid';
import * as Acsys from '../../services/Acsys/Acsys';
import { PromConsumer } from '../../services/Session/PromProvider';
import FieldDef from '../FieldControl/FieldDef';
import FieldControlDialog from '../Dialogs/FieldControlDialog';
import LoadingDialog from '../Dialogs/LoadingDialog';
import MessageDialog from '../Dialogs/MessageDialog';
import YesNoDialog from '../Dialogs/YesNoDialog';
import ViewDialog from '../Dialogs/ViewDialog';
import * as Acsys from '../utils/Acsys/Acsys';
import { AcsysConsumer } from '../utils/Session/AcsysProvider';
import FieldDef from '../components/FieldControl/FieldDef';
import FieldControlDialog from '../components/Dialogs/FieldControlDialog';
import LoadingDialog from '../components/Dialogs/LoadingDialog';
import MessageDialog from '../components/Dialogs/MessageDialog';
import YesNoDialog from '../components/Dialogs/YesNoDialog';
import ViewDialog from '../components/Dialogs/ViewDialog';

const INITIAL_STATE = {
content_id: '',
Expand Down Expand Up @@ -1028,5 +1028,5 @@ class CollectionView extends React.Component {
);
}
}
CollectionView.contextType = PromConsumer;
CollectionView.contextType = AcsysConsumer;
export default CollectionView;
Loading

0 comments on commit 409e837

Please sign in to comment.