Skip to content

Commit

Permalink
Merge branch 'KelvinTegelaar:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
BNWEIN authored Aug 18, 2023
2 parents ccd17a1 + 3161517 commit 2df9209
Show file tree
Hide file tree
Showing 42 changed files with 27,521 additions and 14,635 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ PORT=3000
CHOKIDAR_USEPOLLING=true
BROWSER=none
GENERATE_SOURCEMAP=false
WDS_SOCKET_PORT=0
WDS_SOCKET_PORT=3000
23 changes: 0 additions & 23 deletions .vscode/cert.crt

This file was deleted.

28 changes: 0 additions & 28 deletions .vscode/key.key

This file was deleted.

25 changes: 8 additions & 17 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,30 @@
"cwd": "${file}"
},
{
"command": "npm run start-api",
"name": "Run emulator",
"command": "npm run start-swa",
"name": "Run Emulator",
"request": "launch",
"type": "node-terminal"
},
{
"command": "npm start",
"name": "Run frontend",
"name": "Run Frontend",
"request": "launch",
"type": "node-terminal",
"preLaunchTask": "RunAllTasks",
"preLaunchTask": "Run All Tasks",
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"]
},
{
"name": "Launch Edge",
"type": "chrome",
"request": "launch",
"type": "pwa-msedge",
"url": "https://localhost:4280",
"webRoot": "${workspaceFolder}"
},
{
"name": "Attach to Edge",
"port": 9222,
"request": "attach",
"type": "pwa-msedge",
"urlFilter": "https://localhost:4280/*",
"webRoot": "${workspaceFolder}"
"name": "Launch Chrome Debugger",
"url": "http://localhost:4280"
}
],
"compounds": [
{
"name": "Launch it all 🚀",
"configurations": ["Run frontend", "Run emulator"]
"configurations": ["Run Frontend", "Run Emulator"]
}
]
}
10 changes: 5 additions & 5 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"version": "2.0.0",
"tasks": [
{
"label": "RunAllTasks",
"dependsOn": ["RunAPI", "RunAzurite"]
"label": "Run All Tasks",
"dependsOn": ["Run API", "Run Azurite"]
},
{
"label": "RunAzurite",
"label": "Run Azurite",
"type": "shell",
"command": "azurite",
"command": "azurite --location ../",
"isBackground": true,
"problemMatcher": {
"pattern": [
Expand All @@ -27,7 +27,7 @@
}
},
{
"label": "RunAPI",
"label": "Run API",
"type": "shell",
"command": "func start --verbose",
"isBackground": true,
Expand Down
15 changes: 9 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"test": "react-scripts test",
"test:cov": "npm test -- --coverage --watchAll=false",
"test:debug": "react-scripts --inspect-brk test --runInBand",
"start-api": "swa start --ssl --ssl-cert ./.vscode/cert.crt --ssl-key ./.vscode/key.key --swa-config-location .vscode http://localhost:3000 --api-location http://localhost:7071",
"start-swa": "swa start --swa-config-location .vscode http://127.0.0.1:3000 --api-location http://localhost:7071",
"prepare": "husky install"
},
"config": {
Expand Down Expand Up @@ -92,13 +92,13 @@
"prettier": "2.4.1",
"react-scripts": "^5.0.0",
"redux-immutable-state-invariant": "^2.1.0",
"sass": "^1.44",
"sass": "^1.64.2",
"stylelint": "^14.3.0",
"stylelint-config-sass-guidelines": "^9.0.1",
"stylelint-order": "^5.0.0"
},
"engines": {
"node": "16",
"node": "18",
"npm": ">=7"
}
}
2 changes: 1 addition & 1 deletion public/version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.8.0
4.0.1
7 changes: 6 additions & 1 deletion src/_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const _nav = [
},
{
component: CNavItem,
name: 'Scheduled Alerts',
name: 'Alerts Configuration',
to: '/tenant/administration/alertsqueue',
},
{
Expand All @@ -156,6 +156,11 @@ const _nav = [
name: 'Application Approval',
to: '/tenant/administration/appapproval',
},
{
component: CNavItem,
name: 'Geo IP Lookup',
to: '/tenant/tools/geoiplookup',
},
{
component: CNavItem,
name: 'Tenant Lookup',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/netfriends.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 29 additions & 13 deletions src/components/forms/RFFComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
CFormSwitch,
CFormTextarea,
CSpinner,
CTooltip,
} from '@coreui/react'
import Select from 'react-select'
import AsyncSelect from 'react-select/async'
Expand Down Expand Up @@ -75,9 +76,14 @@ RFFCFormCheck.propTypes = {
...sharedPropTypes,
}

function ConditionWrapper({ condition, wrapper, children }) {
return condition ? wrapper(children) : children
}

export const RFFCFormSwitch = ({
name,
label,
helpText,
sublabel,
className = 'mb-3',
validate,
Expand All @@ -86,26 +92,36 @@ export const RFFCFormSwitch = ({
return (
<Field name={name} type="checkbox" validate={validate}>
{({ meta, input }) => (
<div className={className}>
<CFormSwitch
{...input}
// @todo revisit this, only shows green when checked
valid={!meta.error && meta.touched && validate}
invalid={meta.error && meta.touched && validate}
disabled={disabled}
id={name}
label={label}
/>
{input.value && <RFFCFormFeedback meta={meta} />}
<sub>{sublabel}</sub>
</div>
<ConditionWrapper
condition={helpText}
wrapper={(children) => (
<CTooltip placement="left" content={helpText}>
{children}
</CTooltip>
)}
>
<div className={className}>
<CFormSwitch
{...input}
// @todo revisit this, only shows green when checked
valid={!meta.error && meta.touched && validate}
invalid={meta.error && meta.touched && validate}
disabled={disabled}
id={name}
label={label}
/>
{input.value && <RFFCFormFeedback meta={meta} />}
<sub>{sublabel}</sub>
</div>
</ConditionWrapper>
)}
</Field>
)
}

RFFCFormSwitch.propTypes = {
...sharedPropTypes,
helpText: PropTypes.string,
}

export const RFFCFormInput = ({
Expand Down
8 changes: 6 additions & 2 deletions src/components/layout/AppFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { Link } from 'react-router-dom'
import huntressLogo from 'src/assets/images/huntress_teal.png'
import dattoLogo from 'src/assets/images/datto.png'
import rewstLogo from 'src/assets/images/rewst.png'

import netfriends from 'src/assets/images/netfriends.png'
//todo: Add darkmode detection and change logos accordingly.
const AppFooter = () => {
return (
<CFooter className="d-flex justify-content-between align-items-center">
Expand All @@ -18,7 +19,10 @@ const AppFooter = () => {
<CImage src={dattoLogo} alt="Datto" />
</CLink>{' '}
<CLink href="https://rewst.io/">
<CImage src={rewstLogo} alt="Datto" />
<CImage src={rewstLogo} alt="Rewst" />
</CLink>
<CLink href="https://netfriends.com">
<CImage src={netfriends} alt="Netfriends" />
</CLink>
</p>
</div>
Expand Down
7 changes: 6 additions & 1 deletion src/components/tables/CellBoolean.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
faExclamationCircle,
} from '@fortawesome/free-solid-svg-icons'
import { CellBadge } from 'src/components/tables'
import { CBadge } from '@coreui/react'

const IconWarning = () => <FontAwesomeIcon icon={faExclamationCircle} className="text-warning" />
const IconError = () => <FontAwesomeIcon icon={faTimesCircle} className="text-danger" />
Expand Down Expand Up @@ -37,6 +38,9 @@ export default function CellBoolean({
noDataIsFalse = false,
}) {
let normalized = cell
if (cell === 'FAILED') {
return <CBadge color="danger">Failed. Check Logs</CBadge>
}
if (typeof cell === 'boolean') {
normalized = cell
} else if (typeof cell === 'string') {
Expand All @@ -52,7 +56,8 @@ export default function CellBoolean({
cell.toLowerCase() === 'fail' ||
cell.toLowerCase() === 'default' ||
cell.toLowerCase() === 'false' ||
cell.toLowerCase() === 'noncompliant'
cell.toLowerCase() === 'noncompliant' ||
cell.toLowerCase() === 'disabled'
) {
normalized = false
}
Expand Down
6 changes: 6 additions & 0 deletions src/components/tables/CellGenericFormat.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,14 @@ export const cellGenericFormatter =
return CellBoolean({ cell, warning, reverse, colourless, noDataIsFalse })
}
if (typeof cell === 'string') {
if (cell.toLowerCase() === 'failed') {
return <CBadge color="danger">{CellTip('Failed to retrieve from API')}</CBadge>
}
return CellTip(cell)
}
if (typeof cell === 'number') {
return <CBadge color="info">{CellTip(cell)}</CBadge>
}
if (Array.isArray(cell) || typeof cell === 'object') {
return CellTip(JSON.stringify(cell))
}
Expand Down
Loading

0 comments on commit 2df9209

Please sign in to comment.