Skip to content
This repository was archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
refactor: update Misconfiguration fields on the UI
Browse files Browse the repository at this point in the history
Signed-off-by: András Jáky <[email protected]>
  • Loading branch information
akijakya authored and ramizpolic committed Feb 9, 2024
1 parent df0aafc commit 833e725
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const DetailsContent = ({data}) => {
const MisconfigurationDetails = () => (
<FindingsDetailsPage
backTitle="Misconfigurations"
getTitleData={({findingInfo}) => ({title: findingInfo.testID})}
getTitleData={({findingInfo}) => ({title: findingInfo.id})}
detailsContent={DetailsContent}
/>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const FILTER_SEVERITY_ITEMS = Object.keys(MISCONFIGURATION_SEVERITY_MAP)
const MisconfigurationsTable = () => {
const columns = useMemo(() => [
{
Header: "Test ID",
id: "testId",
sortIds: ["findingInfo.testID"],
accessor: "findingInfo.testID"
Header: "ID",
id: "id",
sortIds: ["findingInfo.id"],
accessor: "findingInfo.id"
},
{
Header: "Severity",
Expand All @@ -25,8 +25,8 @@ const MisconfigurationsTable = () => {
{
Header: "Description",
id: "description",
sortIds: ["findingInfo.testDescription"],
accessor: "findingInfo.testDescription",
sortIds: ["findingInfo.description"],
accessor: "findingInfo.description",
width: 200
},
...getAssetAndScanColumnsConfigList()
Expand All @@ -37,7 +37,7 @@ const MisconfigurationsTable = () => {
columns={columns}
filterType={FILTER_TYPES.FINDINGS_MISCONFIGURATIONS}
filtersConfig={[
{value: "findingInfo.testID", label: "Test ID", operators: [
{value: "findingInfo.id", label: "ID", operators: [
{...OPERATORS.eq, valueItems: [], creatable: true},
{...OPERATORS.ne, valueItems: [], creatable: true},
{...OPERATORS.startswith},
Expand All @@ -48,7 +48,7 @@ const MisconfigurationsTable = () => {
{...OPERATORS.eq, valueItems: FILTER_SEVERITY_ITEMS},
{...OPERATORS.ne, valueItems: FILTER_SEVERITY_ITEMS}
]},
{value: "findingInfo.testDescription", label: "Description", operators: [
{value: "findingInfo.description", label: "Description", operators: [
{...OPERATORS.eq, valueItems: [], creatable: true},
{...OPERATORS.ne, valueItems: [], creatable: true},
{...OPERATORS.startswith},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@ import { MISCONFIGURATION_SEVERITY_MAP } from './utils';

const TabMisconfigurationDetails = ({data}) => {
const {findingInfo, foundOn, invalidatedOn} = data;
const {testID, severity, testDescription, scannerName, scannedPath, remediation, testCategory, message} = findingInfo;
const {id, severity, description, scannerName, location, remediation, category, message} = findingInfo;

return (
<DoublePaneDisplay
leftPaneDisplay={() => (
<>
<TitleValueDisplayRow>
<TitleValueDisplay title="Test ID">{testID}</TitleValueDisplay>
<TitleValueDisplay title="ID">{id}</TitleValueDisplay>
<TitleValueDisplay title="Severity">{MISCONFIGURATION_SEVERITY_MAP[severity]}</TitleValueDisplay>
</TitleValueDisplayRow>
<TitleValueDisplayRow>
<TitleValueDisplay title="Scanner Name">{scannerName}</TitleValueDisplay>
<TitleValueDisplay title="File path">{scannedPath}</TitleValueDisplay>
<TitleValueDisplay title="File path">{location}</TitleValueDisplay>
</TitleValueDisplayRow>
<TitleValueDisplayRow>
<TitleValueDisplay title="Category">{testCategory}</TitleValueDisplay>
<TitleValueDisplay title="Category">{category}</TitleValueDisplay>
<TitleValueDisplay title="Remediation">{remediation}</TitleValueDisplay>
</TitleValueDisplayRow>
<TitleValueDisplayRow>
<TitleValueDisplay title="Message" withOpen defaultOpen>{message}</TitleValueDisplay>
</TitleValueDisplayRow>
<TitleValueDisplayRow>
<TitleValueDisplay title="Description" withOpen defaultOpen>{testDescription}</TitleValueDisplay>
<TitleValueDisplay title="Description" withOpen defaultOpen>{description}</TitleValueDisplay>
</TitleValueDisplayRow>
<FindingsDetailsCommonFields foundOn={foundOn} invalidatedOn={invalidatedOn} />
</>
</>
)}
/>
)
Expand Down

0 comments on commit 833e725

Please sign in to comment.