-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d1e755e
commit d903d16
Showing
14 changed files
with
308 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import * as React from "react"; | ||
import Box from "@mui/material/Box"; | ||
import Tabs, { tabsClasses } from "@mui/material/Tabs"; | ||
import { TabForMoi } from "./TabForMoi"; | ||
|
||
export default function ScrollableTabsButtonVisibleML({ | ||
filter, | ||
setFilter | ||
}: any) { | ||
const [value, setValue] = React.useState(0); | ||
const handleChange = (event: React.SyntheticEvent, newValue: number) => { | ||
setValue(newValue); | ||
}; | ||
return ( | ||
<Box | ||
sx={{ | ||
flexGrow: 1, | ||
maxWidth: "100%", | ||
mx: { xs: 2, lg: 3 } | ||
}} | ||
pt={1} | ||
> | ||
<Tabs | ||
value={value} | ||
onChange={handleChange} | ||
variant="scrollable" | ||
scrollButtons | ||
aria-label="visible arrows tabs example" | ||
sx={{ | ||
[`& .${tabsClasses.scrollButtons}`]: { | ||
"&.Mui-disabled": { opacity: 0.3 } | ||
}, | ||
height: "43px" | ||
}} | ||
style={{ backgroundColor: "white" }} | ||
> | ||
<TabForMoi filter={filter} setFilter={setFilter} /> | ||
</Tabs> | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import * as React from "react"; | ||
import Tab from "@mui/material/Tab"; | ||
import { SecurityDomain } from "./filter/riskAnalysis"; | ||
import { ModelType } from "./filter/ModelType"; | ||
|
||
export function TabForMoi({ filter, setFilter }: any) { | ||
return ( | ||
<> | ||
<Tab | ||
style={{ | ||
margin: "0", | ||
padding: "0", | ||
backgroundColor: "white", | ||
borderRadius: "1", | ||
paddingRight: "12px", | ||
minWidth: "302px" | ||
}} | ||
label={<ModelType filter={filter} setFilter={setFilter} />} | ||
/> | ||
<Tab | ||
style={{ | ||
margin: "0", | ||
padding: "0", | ||
backgroundColor: "white", | ||
borderRadius: "1", | ||
paddingRight: "12px", | ||
minWidth: "302px" | ||
}} | ||
label={<SecurityDomain filter={filter} setFilter={setFilter} />} | ||
/> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import * as React from "react"; | ||
import FormControl from "@mui/material/FormControl"; | ||
import MenuItem from "@mui/material/MenuItem"; | ||
import OutlinedInput from "@mui/material/OutlinedInput"; | ||
import Select, { SelectChangeEvent } from "@mui/material/Select"; | ||
import { Theme, useTheme } from "@mui/material/styles"; | ||
|
||
const names = [ | ||
"Classic", | ||
"LLM" | ||
]; | ||
|
||
function getStyles(name: string, personName: readonly string[], theme: Theme) { | ||
return { | ||
fontWeight: | ||
personName.indexOf(name) === -1 | ||
? theme.typography.fontWeightRegular | ||
: theme.typography.fontWeightMedium | ||
}; | ||
} | ||
|
||
export function ModelType({ filter, setFilter }: any) { | ||
const theme = useTheme(); | ||
const [personName, setPersonName] = React.useState<string[]>([]); | ||
const handleChange1 = (event: SelectChangeEvent<typeof personName>) => { | ||
const { | ||
target: { value } | ||
} = event; | ||
setPersonName( | ||
// On autofill we get a stringified value. | ||
typeof value === "string" ? value.split(",") : value | ||
); | ||
}; | ||
if (personName?.[0] !== filter.ModelType) { | ||
filter.ModelType = personName?.[0]; | ||
setFilter({ ...filter }); | ||
} | ||
return ( | ||
<div style={{ width: "100%", backgroundColor: (!personName?.[0] || personName?.[0] === 'Model Type') ? "white" : "lightgreen" }}> | ||
<FormControl sx={{ width: "100%" }}> | ||
<Select | ||
multiple={false} | ||
displayEmpty | ||
value={personName} | ||
onChange={handleChange1} | ||
input={<OutlinedInput />} | ||
renderValue={(selected) => { | ||
if (selected.length === 0) { | ||
return <>Model Type</>; | ||
} | ||
return selected.join(", "); | ||
}} | ||
style={{ height: "35px" }} | ||
> | ||
<MenuItem value="Model Type"> | ||
<>All</> | ||
</MenuItem> | ||
{names.map((name) => ( | ||
<MenuItem | ||
key={name} | ||
value={name} | ||
style={getStyles(name, personName, theme)} | ||
> | ||
{name} | ||
</MenuItem> | ||
))} | ||
</Select> | ||
</FormControl> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export const filterCheck = { | ||
"Model Type": true, | ||
"Risk Analysis": true | ||
}; | ||
|
||
export const riskAnalysis = { | ||
"SAST": "SAST", | ||
"Fuzz Test": "Fuzz Test", | ||
"Unanalyzed": "Unanalyzed" | ||
}; | ||
|
||
export const modelType = { | ||
"Classic": "Classic", | ||
"LLM": "LLM" | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import * as React from "react"; | ||
import FormControl from "@mui/material/FormControl"; | ||
import MenuItem from "@mui/material/MenuItem"; | ||
import OutlinedInput from "@mui/material/OutlinedInput"; | ||
import Select, { SelectChangeEvent } from "@mui/material/Select"; | ||
import { Theme, useTheme } from "@mui/material/styles"; | ||
// import { selectedFilterData } from "./mapFilterData"; | ||
|
||
const names = [ | ||
"SAST", | ||
"Fuzz Test", | ||
"Unanalyzed" | ||
]; | ||
|
||
function getStyles(name: string, personName: readonly string[], theme: Theme) { | ||
return { | ||
fontWeight: | ||
personName.indexOf(name) === -1 | ||
? theme.typography.fontWeightRegular | ||
: theme.typography.fontWeightMedium | ||
}; | ||
} | ||
|
||
export function SecurityDomain({ filter, setFilter }: any) { | ||
const theme = useTheme(); | ||
const [personName, setPersonName] = React.useState<string[]>([]); | ||
const handleChange1 = (event: SelectChangeEvent<typeof personName>) => { | ||
const { | ||
target: { value } | ||
} = event; | ||
setPersonName( | ||
// On autofill we get a stringified value. | ||
typeof value === "string" ? value.split(",") : value | ||
); | ||
}; | ||
if (personName?.[0] !== filter.RiskAnalysis) { | ||
filter.RiskAnalysis = personName?.[0]; | ||
setFilter({ ...filter }); | ||
} | ||
return ( | ||
<div | ||
style={{ | ||
width: "100%", | ||
backgroundColor: | ||
!personName?.[0] || personName?.[0] === "Risk Analysis" | ||
? "white" | ||
: "lightgreen" | ||
}} | ||
> | ||
<FormControl sx={{ width: "100%" }}> | ||
<Select | ||
multiple={false} | ||
displayEmpty | ||
value={personName} | ||
onChange={handleChange1} | ||
input={<OutlinedInput />} | ||
renderValue={(selected) => { | ||
if (selected.length === 0) { | ||
return <>Risk Analysis</>; | ||
} | ||
return selected.join(", "); | ||
}} | ||
style={{ height: "35px" }} | ||
> | ||
<MenuItem value="Risk Analysis"> | ||
<>All</> | ||
</MenuItem> | ||
{names.map((name) => ( | ||
<MenuItem | ||
key={name} | ||
value={name} | ||
style={getStyles(name, personName, theme)} | ||
> | ||
{name} | ||
</MenuItem> | ||
))} | ||
</Select> | ||
</FormControl> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.