Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing UI changes #637

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/node_modules
/.pnp
.pnp.js
/dist

# testing
/coverage
Expand Down
5 changes: 5 additions & 0 deletions custom.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module '*.png';
declare module '*.jpg';
declare module '*.jpeg';
declare module '*.gif';
declare module '*.svg';
19,429 changes: 5,544 additions & 13,885 deletions package-lock.json

Large diffs are not rendered by default.

27 changes: 19 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,16 @@
"react-dom": "^18.2.0",
"react-leader-line": "^1.0.5",
"react-router-dom": "6.10.0",
"react-scripts": "^5.0.1",
"simplebar-react": "^3.2.4",
"typescript": "^4.9.5",
"web-vitals": "3.3.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build && cp build/index.html build/404.html",
"start": "webpack serve --mode development",
"build": "webpack --mode production",
"predeploy": "npm run build",
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
"lint:fix": "eslint --fix \"src/**/*.{js,jsx,ts,tsx}\"",
"deploy": "gh-pages -d build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"deploy": "gh-pages -d build"
},
"eslintConfig": {
"extends": [
Expand All @@ -68,16 +64,21 @@
]
},
"devDependencies": {
"@babel/core": "^7.24.9",
"@babel/preset-env": "^7.24.8",
"@babel/preset-react": "^7.24.7",
"@react-native-community/eslint-config": "^3.2.0",
"@testing-library/react": "^14.0.0",
"@types/chroma-js": "^2.4.3",
"@types/file-loader": "^5.0.4",
"@types/jest": "^27.5.2",
"@types/lodash": "^4.14.195",
"@types/node": "^16.18.89",
"@types/numeral": "^2.0.2",
"@types/react-dom": "^18.2.15",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"css-loader": "^7.1.2",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ft-flow": "^3.0.7",
Expand All @@ -88,6 +89,16 @@
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-standard": "^5.0.0",
"prettier": "^3.2.5"
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.6.0",
"json-loader": "^0.5.7",
"prettier": "^3.2.5",
"style-loader": "^4.0.0",
"ts-loader": "^9.5.1",
"typescript": "^5.5.3",
"url-loader": "^4.1.1",
"webpack": "^5.93.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.4"
}
}
8 changes: 1 addition & 7 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.png" />
<link rel="shortcut icon" href="./favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#1A73E8" />
<link
rel="apple-touch-icon"
sizes="76x76"
href="%PUBLIC_URL%/apple-icon.png"
/>
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>BeSLighthouse</title>
<link
rel="stylesheet"
Expand Down
3 changes: 2 additions & 1 deletion src/apiDetailsConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"gitLabUrl": "",
"token": ""
},
"activeTool": "github"
"activeTool": "gitlab",
"version": "0.19.0"
}
3 changes: 0 additions & 3 deletions src/components/Charts/PieChart/SeverityLevels/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@ import { fNumber } from "../../../../utils/formatNumber";

function SeverityLevels({ chartColors, chartData }: any) {
const theme = useTheme();
// console.log("chartData="+JSON.stringify(chartData));

const chartLabels = chartData.map((i: { label: any }) => i.label);
const chartSeries = chartData.map((i: { value: any }) => i.value);
// console.log("chartLabels="+JSON.stringify(chartLabels));
// console.log("chartSeries="+JSON.stringify(chartSeries));

const chartOptions = useChart({
colors: chartColors,
Expand Down
9 changes: 9 additions & 0 deletions src/components/Navbars/DefaultNavbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import breakpoints from "../../../assets/theme/base/breakpoints";
import MKButton from "../../../components/MKButton";
import DefaultNavbarMobile from "./DefaultNavbarMobile";

import jsonData from '../../../apiDetailsConfig.json';

function DefaultNavbar({
brand,
routes,
Expand Down Expand Up @@ -505,6 +507,13 @@ function DefaultNavbar({
>
{ brand }
</MKTypography>
<MKTypography
fontWeight="bold"
color={ light ? "white" : "dark" }
style={ { display: "flex", fontSize: "0.675rem" } }
>
Version: { jsonData.version }
</MKTypography>
</MKBox>
<MKBox
color="inherit"
Expand Down
81 changes: 15 additions & 66 deletions src/pages/BesVersionHistory/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@ import Card from "@mui/material/Card";
import { useParams } from "react-router-dom";
import { projectOfInterestData } from "../../utils/ProjectOfInterestData";
import { MenuItem, Select, Tooltip } from "@mui/material";
// import { makeStyles } from "@mui/styles";
import MKBox from "../../components/MKBox";
import MKTypography from "../../components/MKTypography";
import AssessmentReport from "./AssessmentReport";
import AssessmentAnalytics from "./AssessmentAnalytics";
import routes from "../../routes";
import { getEnvPathStatus } from "../../utils/fatchJsonReport";
import ApartmentIcon from '@mui/icons-material/Apartment';
import DownloadIcon from '@mui/icons-material/Download';
import Button from '@mui/material/Button';
import Backdrop from '@mui/material/Backdrop';
import Box from '@mui/material/Box';
import Modal from '@mui/material/Modal';
import Fade from '@mui/material/Fade';
import { projectTags } from "./tags";
import DefaultNavbar from "../../components/Navbars/DefaultNavbar";
import MKButton from "../../components/MKButton";
import { Science } from "@mui/icons-material";

export const osspoiMasterAndSummary = async (
setData: any,
Expand All @@ -43,23 +42,6 @@ export const getResponse = async (name: string) => {
return res;
};

// const useStyles: any = makeStyles(() => ({
// select: {
// minWidth: "calc(3rem + 0.5vw)",
// "& .css-11u53oe-MuiSelect-select-MuiInputBase-input-MuiOutlinedInput-input.MuiSelect-select":
// {
// padding: "4px"
// },
// "& .css-11u53oe-MuiSelect-select-MuiInputBase-input-MuiOutlinedInput-input.css-11u53oe-MuiSelect-select-MuiInputBase-input-MuiOutlinedInput-input.css-11u53oe-MuiSelect-select-MuiInputBase-input-MuiOutlinedInput-input":
// {
// padding: "4px"
// },
// "& .css-qiwgdb.css-qiwgdb.css-qiwgdb": {
// padding: "4px"
// }
// }
// }));

// Style for Modal
const envPlaybookModalStyle = {
position: 'absolute' as 'absolute',
Expand Down Expand Up @@ -376,77 +358,44 @@ function BesVersionHistory() {
title="Open source Assurance Provider"
style={ { fontSize: "15px", fontWeight: "normal" } }
>
OSAP: &nbsp;
OASP: &nbsp;
</MKTypography>
{ /* Tooltip is used to provide the title for the icon */ }
<Tooltip title="Organization">
<Science />
</Tooltip>
<MKTypography
variant="h6"
fontWeight="regular"
style={ { fontSize: "15px" } }
style={ { fontSize: "15px", paddingLeft: "2px" } }
>
{ item.owner.login }
</MKTypography>
{ /* The osap icon is given inside MKTypography for handling its css */ }
<MKTypography
fontWeight="regular"
color="text"
style={ {
position: "relative",
// paddingLeft: "3px",
bottom: "3px"
} }>
{ /* {item.owner["type"] === "Organization" && (<IconButton aria-label="add" title="Organization">
</IconButton> ) */ }
{ /* Tooltip is used to provide the title for the icon */ }
<Tooltip title="Organization">

<ApartmentIcon />
</Tooltip>

{ /* {findOSAP(item)} */ }
{ /* <Icon component={ApartmentIcon} style={{ fontSize: "large" }} title="Organization" /> */ }
</MKTypography>
</Grid>
<Grid
item
xs={ 6 }
md={ 3 }
style={ { display: "flex", paddingTop: "12px", position: "relative", bottom: "7px" } }
>
{ /* <MKTypography
variant="h6"
fontWeight="bold"
textTransform="capitalize"
style={{ fontSize: "15px" }}
> */ }
<Button
<MKButton
// onClick={ downloadJson }
variant="gradient"
color="info"
size="small"
title="Download Assessment Summary Report"
endIcon={ <i className="fa fa-download" /> }
disabled
endIcon={
<DownloadIcon
style={ {
color: "black"
} }
/> }
style={ {
fontSize: "15px",
color: "black",
right: "16px",
fontWeight: "normal"
} }>
>
OSAR
</Button>

</MKButton>
</Grid>
<Grid
item
xs={ 6 }
md={ 3 }
style={ { display: "flex", paddingTop: "12px", position: "relative", bottom: "7px" } }
>

<ModalForEnvsAndPlaybook />

</Grid>
</Grid>
</Card>
Expand Down
18 changes: 9 additions & 9 deletions src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@ import * as React from "react";
// @mui icons
import GitHubIcon from "@mui/icons-material/GitHub";
import Icon from "@mui/material/Icon";
import HomeIcon from '@mui/icons-material/Home';
import ModelOfInterest from "./pages/ModelOfInterest";
import VulnerabilityOfInterest from "./pages/VulnerabilityOfInterest";
import ProjectOfInterest from "./pages/ProjectOfInterest";
import { AddModerator } from "@mui/icons-material";

const routes = [
{
name: "Be-Secure",
key: "github",
icon: <HomeIcon fontSize="medium" />,
href: "https://be-secure.github.io/Be-Secure/"
},
{
name: "Projects Of Interest",
key: "Project-of-Interest",
Expand All @@ -39,9 +33,15 @@ const routes = [
{
name: "github",
key: "github",
icon: <GitHubIcon />,
icon: <GitHubIcon fontSize="small"/>,
href: "https://github.com/Be-Secure/BeSLighthouse"
}
},
{
name: "Be-Secure",
key: "github",
icon: <AddModerator fontSize="small" />,
href: "https://be-secure.github.io/Be-Secure/"
},
];

export default routes;
25 changes: 6 additions & 19 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"module": "commonjs",
"strict": true,
"jsx": "react",
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
"resolveJsonModule": true
},
"include": [
"src"
]
"include": ["src", "webpack.config.js", "custom.d.ts"]
}
5 changes: 5 additions & 0 deletions tsconfig.webpack.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "./tsconfig.json",
"include": ["webpack.config.js"]
}

Loading
Loading