Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ad4963e
First SuperLinter test
cjayneb Feb 17, 2022
982ce9a
Fixed most lint errors
cjayneb Feb 17, 2022
8c4914f
change to re run CI
cjayneb Feb 17, 2022
e5d5823
fixed tests
cjayneb Feb 17, 2022
f4b81bf
added jest timeout for report tests
cjayneb Feb 17, 2022
fd114a6
added custom lint rules to workspace folder
cjayneb Feb 17, 2022
0c8a63c
modification to re run CI
cjayneb Feb 17, 2022
9950f56
Merge branch 'main' into conf/Testing_SuperLinter
cjayneb Feb 17, 2022
7768edf
componentization
cjayneb Feb 17, 2022
0abe667
Merge branch 'conf/Testing_SuperLinter' of https://github.com/BC-Engi…
cjayneb Feb 17, 2022
f1f908a
Fixed most lint errors
cjayneb Feb 17, 2022
6bb499b
Merge branch 'main' into conf/Testing_SuperLinter
cjayneb Feb 17, 2022
22eadae
updated test to pass
cjayneb Feb 18, 2022
f20baae
update CI to math main
cjayneb Feb 18, 2022
0b3f696
Merge branch 'conf/Testing_SuperLinter' of https://github.com/BC-Engi…
cjayneb Feb 18, 2022
996ac84
Merge branch 'main' into conf/Testing_SuperLinter
cjayneb Feb 18, 2022
e1e2181
update eslint rules for react hooks
cjayneb Feb 18, 2022
2fae6e3
Merge branch 'conf/Testing_SuperLinter' of https://github.com/BC-Engi…
cjayneb Feb 18, 2022
2cae3c7
update eslint extends
cjayneb Feb 18, 2022
ec65fdc
fixed css and lint rules files
cjayneb Feb 18, 2022
2b1edaa
updated lint rules
cjayneb Feb 18, 2022
1ea642b
Merge branch 'main' into conf/Testing_SuperLinter
cjayneb Feb 18, 2022
b17c2e3
changed ecma 2020
cjayneb Feb 18, 2022
8ad4b4e
Merge branch 'conf/Testing_SuperLinter' of https://github.com/BC-Engi…
cjayneb Feb 18, 2022
7d07fe8
update lint ruels again
cjayneb Feb 18, 2022
698fc36
Merge branch 'main' into conf/Testing_SuperLinter
cjayneb Feb 18, 2022
ae05f7b
final lint update for the day
cjayneb Feb 18, 2022
bb46073
Merge branch 'conf/Testing_SuperLinter' of https://github.com/BC-Engi…
cjayneb Feb 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,18 @@ jobs:
SKIP_PREFLIGHT_CHECK: ${{ secrets.SKIP_PREFLIGHT_CHECK }}
run: |
touch .env
echo ACCESS_TOKEN_SECRET="$ACCESS_TOKEN_SECRET" >> .env
echo LOCAL_DATABASE="$LOCAL_DATABASE" >> .env
echo LOCAL_DOCKER_PORT="$LOCAL_DOCKER_PORT" >> .env
echo LOCAL_HOST="$LOCAL_HOST" >> .env
echo LOCAL_PORT="$LOCAL_PORT" >> .env
echo LOCAL_ROOT_PASSWORD="$LOCAL_ROOT_PASSWORD" >> .env
echo LOCAL_USER="$LOCAL_USER" >> .env
echo NODE_ENV="$NODE_ENV" >> .env
echo REFRESH_TOKEN_SECRET="$REFRESH_TOKEN_SECRET" >> .env
echo SKIP_PREFLIGHT_CHECK="$SKIP_PREFLIGHT_CHECK" >> .env
{
echo ACCESS_TOKEN_SECRET="$ACCESS_TOKEN_SECRET"
echo LOCAL_DATABASE="$LOCAL_DATABASE"
echo LOCAL_DOCKER_PORT="$LOCAL_DOCKER_PORT"
echo LOCAL_HOST="$LOCAL_HOST"
echo LOCAL_PORT="$LOCAL_PORT"
echo LOCAL_ROOT_PASSWORD="$LOCAL_ROOT_PASSWORD"
echo LOCAL_USER="$LOCAL_USER"
echo NODE_ENV="$NODE_ENV"
echo REFRESH_TOKEN_SECRET="$REFRESH_TOKEN_SECRET"
echo SKIP_PREFLIGHT_CHECK="$SKIP_PREFLIGHT_CHECK"
} >> .env
- run: npm test

lint:
Expand All @@ -74,4 +76,4 @@ jobs:
VALIDATE_JAVASCRIPT_STANDARD: false
CSS_FILE_NAME: .stylelintrc.json
JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.json
JSCPD_CONFIG_FILE: .jscpd.json
JSCPD_CONFIG_FILE: .jscpd.json
5 changes: 3 additions & 2 deletions .github/workspace/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"plugins": [
"react",
"react-hooks"
Expand All @@ -11,7 +11,8 @@
"react-hooks/exhaustive-deps": "warn"
},
"parserOptions": {
"ecmaVersion": 6,
"ecmaVersion": 8,
"requireConfigFile": false,
"sourceType":"module"
}
}
2 changes: 1 addition & 1 deletion .github/workspace/.jscpd.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"threshold": 0.5
"threshold": 50
}
4 changes: 2 additions & 2 deletions .github/workspace/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "stylelint-config-standard",
"rules": {
"no-missing-end-of-source-newline": "warn",
"value-no-vendor-prefix": "warn"
"no-missing-end-of-source-newline": true,
"value-no-vendor-prefix": true
}
}
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-8.0-community/docker/x86_64/mys
RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql \
&& yum install -y $PACKAGE_URL \
&& yum install -y libpwquality \
&& yum clean all \
&& rm -rf /var/cache/yum/*
RUN mkdir /docker-entrypoint-initdb.d

Expand Down
9 changes: 5 additions & 4 deletions client/public/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
<head>
<meta charset="utf-8">
<title>B&C Engine Web Application</title>
<script type="text/javascript">


</head>
<body>
<script type="text/javascript">
var pathSegmentsToKeep = 0;

var l = window.location;
var l = window.location;
l.replace(
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
l.pathname.split('/').slice(0, 1 + pathSegmentsToKeep).join('/') + '/?/' +
Expand All @@ -17,7 +20,5 @@
);

</script>
</head>
<body>
</body>
</html>
6 changes: 3 additions & 3 deletions client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
<title>B&C Engine</title>
</head>
<body>
<script type="text/javascript">
// This script checks to see if a redirect is present in the query string,
// converts it back into the correct url and adds it to the
Expand All @@ -32,9 +35,6 @@
}
}(window.location))
</script>
<title>B&C Engine</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
Expand Down
35 changes: 17 additions & 18 deletions client/src/App.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
import React from "react";
import Dashboard from "./pages/Dashboard";
import Reports from "./pages/Reports";
import Users from "./pages/Users";
import Manage from "./pages/Manage";
import Login from "./pages/Login";
import { Navigate, Routes, Route, BrowserRouter } from "react-router-dom";
import React from 'react'
import Dashboard from './pages/Dashboard'
import Reports from './pages/Reports'
import Users from './pages/Users'
import Manage from './pages/Manage'
import Login from './pages/Login'
import { Navigate, Routes, Route, BrowserRouter } from 'react-router-dom'


function App() {
function App () {
return (
<div>
{/* Routes to pages */}
<BrowserRouter basename="/">
<BrowserRouter basename='/'>
<Routes>
<Route exact path="/" element={<Navigate replace to="login" />}/>
<Route exact path="/login" element={<Login />} />
<Route exact path="/dashboard" element={<Dashboard />} />
<Route exact path="/reports" element={<Reports />} />
<Route exact path="/users" element={<Users />} />
<Route exact path="/manage" element={<Manage />} />
<Route exact path='/' element={<Navigate replace to='login' />} />
<Route exact path='/login' element={<Login />} />
<Route exact path='/dashboard' element={<Dashboard />} />
<Route exact path='/reports' element={<Reports />} />
<Route exact path='/users' element={<Users />} />
<Route exact path='/manage' element={<Manage />} />
</Routes>
</BrowserRouter>
</div>
);
)
}

export default App;
export default App
32 changes: 16 additions & 16 deletions client/src/components/ConfirmationPopup.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import React from 'react'
import '../styles/index.css'
import { useTranslation } from 'react-i18next';
import { useTranslation } from 'react-i18next'

const DeleteUserPopup = ({ open, prompt, title, onAccept, onClose }) => {
const { t } = useTranslation();
const { t } = useTranslation()

if (!open) return null;
if (!open) return null

return (
<>
<div className="obscureBackground" />
<div className="card popup">
<h4 className="text-center">{prompt} {title}?</h4>
<div className='popup-inner'>
<button className='cancelDeleteUserButton' onClick={onClose}>{t('user.delete.No')}</button>
<button className='deleteUserButton' onClick={onAccept}>{t('user.delete.Yes')}</button>
</div>
</div>
</>
)
return (
<>
<div className='obscure-background' />
<div className='card popup'>
<h4 className='text-center'>{prompt} {title}?</h4>
<div className='popup-inner'>
<button className='cancel-delete-user-button' onClick={onClose}>{t('user.delete.No')}</button>
<button className='delete-user-button' onClick={onAccept}>{t('user.delete.Yes')}</button>
</div>
</div>
</>
)
}

export default DeleteUserPopup
export default DeleteUserPopup
32 changes: 18 additions & 14 deletions client/src/components/DeleteButton.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
import Icon from '@mdi/react'
import { mdiDeleteEmpty, mdiDelete } from '@mdi/js';
import { mdiDeleteEmpty, mdiDelete } from '@mdi/js'

const DeleteButton = ({ onDelete }) => {
return (
<button className="btnDelete btn-delete" onClick={onDelete}>
<Icon path={mdiDelete}
className="mdi mdi-delete"
title="delete Button"
size={1}
horizontal/>
return (
<button className='btnDelete btn-delete' onClick={onDelete}>
<Icon
path={mdiDelete}
className='mdi mdi-delete'
title='delete Button'
size={1}
horizontal
/>

<Icon path={mdiDeleteEmpty}
className="mdi mdi-delete-empty"
title="delete Button empty"
size={1}
horizontal/>
<Icon
path={mdiDeleteEmpty}
className='mdi mdi-delete-empty'
title='delete Button empty'
size={1}
horizontal
/>
</button>
)
)
}

export default DeleteButton
32 changes: 18 additions & 14 deletions client/src/components/EditButton.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
import Icon from '@mdi/react'
import { mdiPencil, mdiPencilOutline } from '@mdi/js';
import { mdiPencil, mdiPencilOutline } from '@mdi/js'

const EditButton = ({ onEdit }) => {
return (
<button className="btnEdit btn-edit" onClick={onEdit}>
<Icon path={mdiPencil}
className="mdi mdi-edit"
title="edit Button"
size={1}
horizontal/>
return (
<button className='btnEdit btn-edit' onClick={onEdit}>
<Icon
path={mdiPencil}
className='mdi mdi-edit'
title='edit Button'
size={1}
horizontal
/>

<Icon path={mdiPencilOutline}
className="mdi mdi-edit-empty"
title="edit Button empty"
size={1}
horizontal/>
<Icon
path={mdiPencilOutline}
className='mdi mdi-edit-empty'
title='edit Button empty'
size={1}
horizontal
/>
</button>
)
)
}

export default EditButton
34 changes: 19 additions & 15 deletions client/src/components/ExportButton.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
import Icon from '@mdi/react'
import { mdiFileExport, mdiFileExportOutline } from '@mdi/js';
import { mdiFileExport, mdiFileExportOutline } from '@mdi/js'

const EditButton = ({ onExport, id, styles, iconColor }) => {
return (
<button id={id} style={styles} className="btnEdit btn-edit" onClick={onExport}>
<Icon path={mdiFileExport}
style={iconColor}
className="mdi mdi-edit"
title="edit Button"
size={1}
horizontal/>
return (
<button id={id} style={styles} className='btnEdit btn-edit' onClick={onExport}>
<Icon
path={mdiFileExport}
style={iconColor}
className='mdi mdi-edit'
title='edit Button'
size={1}
horizontal
/>

<Icon path={mdiFileExportOutline}
className="mdi mdi-edit-empty"
title="edit Button empty"
size={1}
horizontal/>
<Icon
path={mdiFileExportOutline}
className='mdi mdi-edit-empty'
title='edit Button empty'
size={1}
horizontal
/>
</button>
)
)
}

export default EditButton
Loading