From 024f3de7ca7210d16e39c20f0de063eef8ca06d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20J=C3=A1ky?= Date: Mon, 5 Aug 2024 15:55:30 +0200 Subject: [PATCH 1/7] fix(ui): fitler->filter typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: András Jáky --- ui/src/components/TablePage/index.jsx | 6 ++--- ui/src/context/FiltersProvider.js | 34 +++++++++++++-------------- ui/src/utils/utils.jsx | 8 +++---- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ui/src/components/TablePage/index.jsx b/ui/src/components/TablePage/index.jsx index 81cdb072b..55d5b8aec 100644 --- a/ui/src/components/TablePage/index.jsx +++ b/ui/src/components/TablePage/index.jsx @@ -61,7 +61,7 @@ const TablePage = (props) => { const resetSystemFilter = () => resetSystemFilters(filtersDispatch, systemFilterType || filterType); - const fitlersList = [ + const filtersList = [ ...(!!filters ? [filters] : []), ...(!!tableFilters ? formatFiltersToOdataItems(tableFilters) : []), ...(!!systemFilter ? [systemFilter] : []), @@ -196,8 +196,8 @@ const TablePage = (props) => { filters={{ ...(!!expand ? { $expand: expand } : {}), ...(!!select ? { $select: select } : {}), - ...(fitlersList.length > 0 - ? { $filter: fitlersList.join(" and ") } + ...(filtersList.length > 0 + ? { $filter: filtersList.join(" and ") } : {}), }} noResultsTitle={tableTitle} diff --git a/ui/src/context/FiltersProvider.js b/ui/src/context/FiltersProvider.js index f62c0f22e..7792965f7 100644 --- a/ui/src/context/FiltersProvider.js +++ b/ui/src/context/FiltersProvider.js @@ -33,7 +33,7 @@ const initialState = { initialized: false, }; -const FITLER_ACTIONS = { +const FILTER_ACTIONS = { SET_TABLE_FILTERS_BY_KEY: "SET_TABLE_FILTERS_BY_KEY", SET_SYSTEM_FILTERS_BY_KEY: "SET_SYSTEM_FILTERS_BY_KEY", SET_CUSTOM_FILTERS_BY_KEY: "SET_CUSTOM_FILTERS_BY_KEY", @@ -46,7 +46,7 @@ const FITLER_ACTIONS = { const reducer = (state, action) => { switch (action.type) { - case FITLER_ACTIONS.SET_TABLE_FILTERS_BY_KEY: { + case FILTER_ACTIONS.SET_TABLE_FILTERS_BY_KEY: { const { filterType, filterData } = action.payload; return { @@ -58,7 +58,7 @@ const reducer = (state, action) => { }, }; } - case FITLER_ACTIONS.SET_SYSTEM_FILTERS_BY_KEY: { + case FILTER_ACTIONS.SET_SYSTEM_FILTERS_BY_KEY: { const { filterType, filterData } = action.payload; return { @@ -71,7 +71,7 @@ const reducer = (state, action) => { }, }; } - case FITLER_ACTIONS.SET_CUSTOM_FILTERS_BY_KEY: { + case FILTER_ACTIONS.SET_CUSTOM_FILTERS_BY_KEY: { const { filterType, filterData } = action.payload; return { @@ -83,7 +83,7 @@ const reducer = (state, action) => { }, }; } - case FITLER_ACTIONS.SET_TABLE_PAGE_BY_KEY: { + case FILTER_ACTIONS.SET_TABLE_PAGE_BY_KEY: { const { filterType, pageIndex } = action.payload; return { @@ -94,7 +94,7 @@ const reducer = (state, action) => { }, }; } - case FITLER_ACTIONS.SET_TABLE_SORT_BY_KEY: { + case FILTER_ACTIONS.SET_TABLE_SORT_BY_KEY: { const { filterType, tableSort } = action.payload; return { @@ -105,7 +105,7 @@ const reducer = (state, action) => { }, }; } - case FITLER_ACTIONS.RESET_ALL_FILTERS: { + case FILTER_ACTIONS.RESET_ALL_FILTERS: { return Object.keys(initialState).reduce( (acc, curr) => ({ ...acc, @@ -117,7 +117,7 @@ const reducer = (state, action) => { {}, ); } - case FITLER_ACTIONS.RESET_FILTERS_BY_KEY: { + case FILTER_ACTIONS.RESET_FILTERS_BY_KEY: { const { filterTypes } = action.payload; return { @@ -134,7 +134,7 @@ const reducer = (state, action) => { ), }; } - case FITLER_ACTIONS.INITIALIZE_FILTERS: { + case FILTER_ACTIONS.INITIALIZE_FILTERS: { const { filterType, systemFilterType, @@ -193,33 +193,33 @@ const setFilters = ( ) => dispatch({ type: isSystem - ? FITLER_ACTIONS.SET_SYSTEM_FILTERS_BY_KEY + ? FILTER_ACTIONS.SET_SYSTEM_FILTERS_BY_KEY : isCustom - ? FITLER_ACTIONS.SET_CUSTOM_FILTERS_BY_KEY - : FITLER_ACTIONS.SET_TABLE_FILTERS_BY_KEY, + ? FILTER_ACTIONS.SET_CUSTOM_FILTERS_BY_KEY + : FILTER_ACTIONS.SET_TABLE_FILTERS_BY_KEY, payload: { filterType: type, filterData: filters }, }); const setPage = (dispatch, { type, pageIndex }) => dispatch({ - type: FITLER_ACTIONS.SET_TABLE_PAGE_BY_KEY, + type: FILTER_ACTIONS.SET_TABLE_PAGE_BY_KEY, payload: { filterType: type, pageIndex }, }); const setSort = (dispatch, { type, tableSort }) => dispatch({ - type: FITLER_ACTIONS.SET_TABLE_SORT_BY_KEY, + type: FILTER_ACTIONS.SET_TABLE_SORT_BY_KEY, payload: { filterType: type, tableSort }, }); const resetAllFilters = (dispatch) => - dispatch({ type: FITLER_ACTIONS.RESET_ALL_FILTERS }); + dispatch({ type: FILTER_ACTIONS.RESET_ALL_FILTERS }); const resetFilters = (dispatch, filterTypes) => dispatch({ - type: FITLER_ACTIONS.RESET_FILTERS_BY_KEY, + type: FILTER_ACTIONS.RESET_FILTERS_BY_KEY, payload: { filterTypes }, }); const resetSystemFilters = (dispatch, type) => setFilters(dispatch, { type, filters: {}, isSystem: true }); const initializeFilters = (dispatch, filtersData) => - dispatch({ type: FITLER_ACTIONS.INITIALIZE_FILTERS, payload: filtersData }); + dispatch({ type: FILTER_ACTIONS.INITIALIZE_FILTERS, payload: filtersData }); export { FiltersProvider, diff --git a/ui/src/utils/utils.jsx b/ui/src/utils/utils.jsx index 3dd4b7a7e..e644cd489 100644 --- a/ui/src/utils/utils.jsx +++ b/ui/src/utils/utils.jsx @@ -143,10 +143,10 @@ export const getVulnerabilitiesColumnConfigItem = (props) => { export const findingsColumnsFiltersConfig = Object.values(FINDINGS_MAPPING).map( ({ totalKey, title }) => { - const fitlerKey = `summary.${totalKey}`; + const filterKey = `summary.${totalKey}`; return { - value: fitlerKey, + value: filterKey, label: title, isNumber: true, operators: [ @@ -162,10 +162,10 @@ export const findingsColumnsFiltersConfig = Object.values(FINDINGS_MAPPING).map( export const vulnerabilitiesCountersColumnsFiltersConfig = Object.values( VULNERABILITY_SEVERITY_ITEMS, ).map(({ totalKey, title }) => { - const fitlerKey = `summary.totalVulnerabilities.${totalKey}`; + const filterKey = `summary.totalVulnerabilities.${totalKey}`; return { - value: fitlerKey, + value: filterKey, label: `${title} vulnerabilities`, isNumber: true, operators: [ From 7d48e153450468510174ed5abab59821896f755f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20J=C3=A1ky?= Date: Mon, 5 Aug 2024 16:02:10 +0200 Subject: [PATCH 2/7] fix(ui): vulnerabiity->vulnerability typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: András Jáky --- ui/src/components/SeverityDisplay/index.jsx | 4 ++-- ui/src/components/VulnerabilitiesDisplay/index.jsx | 6 +++--- ui/src/layout/AssetScans/TabAssetScanDetails.jsx | 4 ++-- ui/src/layout/Dashboard/FindingsImpactWidget/index.jsx | 6 +++--- ui/src/layout/Dashboard/FindingsTrendsWidget/index.jsx | 4 ++-- ui/src/layout/Dashboard/RiskiestAssetsWidget/index.jsx | 6 +++--- ui/src/layout/Dashboard/RiskiestRegionsWidget/index.jsx | 4 ++-- ui/src/layout/Findings/index.jsx | 4 ++-- .../Findings/FindingsSystemFilterLinks/index.jsx | 6 +++--- ui/src/utils/systemConsts.js | 4 ++-- ui/src/utils/utils.jsx | 4 ++-- 11 files changed, 26 insertions(+), 26 deletions(-) diff --git a/ui/src/components/SeverityDisplay/index.jsx b/ui/src/components/SeverityDisplay/index.jsx index 22d330347..05d9c9ff0 100644 --- a/ui/src/components/SeverityDisplay/index.jsx +++ b/ui/src/components/SeverityDisplay/index.jsx @@ -1,7 +1,7 @@ import React from "react"; import Icon from "components/Icon"; import { toCapitalized } from "utils/utils"; -import { VULNERABIITY_FINDINGS_ITEM } from "utils/systemConsts"; +import { VULNERABILITY_FINDINGS_ITEM } from "utils/systemConsts"; import "./severity-display.scss"; @@ -25,7 +25,7 @@ const SeverityDisplay = ({ severity, score }) => {
{score}
) : ( diff --git a/ui/src/components/VulnerabilitiesDisplay/index.jsx b/ui/src/components/VulnerabilitiesDisplay/index.jsx index eea323f0d..c3e75d850 100644 --- a/ui/src/components/VulnerabilitiesDisplay/index.jsx +++ b/ui/src/components/VulnerabilitiesDisplay/index.jsx @@ -2,7 +2,7 @@ import React from "react"; import { TooltipWrapper } from "components/Tooltip"; import Icon from "components/Icon"; import { SEVERITY_ITEMS } from "components/SeverityDisplay"; -import { VULNERABIITY_FINDINGS_ITEM } from "utils/systemConsts"; +import { VULNERABILITY_FINDINGS_ITEM } from "utils/systemConsts"; import { formatNumber } from "utils/utils"; import COLORS from "utils/scss_variables.module.scss"; @@ -61,7 +61,7 @@ const TooltipContentDisplay = ({ total, counters }) => ( ({ totalKey, color }) => (
@@ -119,7 +119,7 @@ const VulnerabilitiesDisplay = ({ highestSeverity, total, counters }) => { color: vulnerabilitiesColor, title: vulnerabilitiesTitle, icon: vulnerabilitiesIcon, - } = VULNERABIITY_FINDINGS_ITEM; + } = VULNERABILITY_FINDINGS_ITEM; return (
diff --git a/ui/src/layout/AssetScans/TabAssetScanDetails.jsx b/ui/src/layout/AssetScans/TabAssetScanDetails.jsx index 75ddc9975..1f24f0a89 100644 --- a/ui/src/layout/AssetScans/TabAssetScanDetails.jsx +++ b/ui/src/layout/AssetScans/TabAssetScanDetails.jsx @@ -11,7 +11,7 @@ import { WrappingTextBoxWithEllipsis } from "components/WrappingTextBoxWithEllip import { ROUTES, FINDINGS_MAPPING, - VULNERABIITY_FINDINGS_ITEM, + VULNERABILITY_FINDINGS_ITEM, } from "utils/systemConsts"; import { formatDate, calculateDuration } from "utils/utils"; import { SCANS_PATHS } from "layout/Scans"; @@ -23,7 +23,7 @@ const BORDER_COLOR = COLORS["color-grey-lighter"]; const STATUS_DISPLAY_ITEMS = [ { dataKey: "sbom", title: "SBOM" }, - VULNERABIITY_FINDINGS_ITEM, + VULNERABILITY_FINDINGS_ITEM, ...Object.values(FINDINGS_MAPPING).filter( ({ value }) => value !== FINDINGS_MAPPING.PACKAGES.value, ), diff --git a/ui/src/layout/Dashboard/FindingsImpactWidget/index.jsx b/ui/src/layout/Dashboard/FindingsImpactWidget/index.jsx index d4d1da121..c11494b35 100644 --- a/ui/src/layout/Dashboard/FindingsImpactWidget/index.jsx +++ b/ui/src/layout/Dashboard/FindingsImpactWidget/index.jsx @@ -3,18 +3,18 @@ import SeverityWithCvssDisplay from "components/SeverityWithCvssDisplay"; import { getHigestVersionCvssData, formatNumber } from "utils/utils"; import { FINDINGS_MAPPING, - VULNERABIITY_FINDINGS_ITEM, + VULNERABILITY_FINDINGS_ITEM, APIS, } from "utils/systemConsts"; import FindingsTabsWidget from "../FindingsTabsWidget"; const FINDINGS_ITEMS = [ - VULNERABIITY_FINDINGS_ITEM, + VULNERABILITY_FINDINGS_ITEM, ...Object.values(FINDINGS_MAPPING), ]; const TABS_COLUMNS_MAPPING = { - [VULNERABIITY_FINDINGS_ITEM.dataKey]: { + [VULNERABILITY_FINDINGS_ITEM.dataKey]: { headerItems: ["Name", "Severity"], bodyItems: [ { dataKey: "vulnerability.vulnerabilityName" }, diff --git a/ui/src/layout/Dashboard/FindingsTrendsWidget/index.jsx b/ui/src/layout/Dashboard/FindingsTrendsWidget/index.jsx index fe7dbcdfb..1a25acef9 100644 --- a/ui/src/layout/Dashboard/FindingsTrendsWidget/index.jsx +++ b/ui/src/layout/Dashboard/FindingsTrendsWidget/index.jsx @@ -16,7 +16,7 @@ import DropdownSelect from "components/DropdownSelect"; import { APIS, FINDINGS_MAPPING, - VULNERABIITY_FINDINGS_ITEM, + VULNERABILITY_FINDINGS_ITEM, } from "utils/systemConsts"; import { formatDate } from "utils/utils"; import WidgetWrapper from "../WidgetWrapper"; @@ -28,7 +28,7 @@ import COLORS from "utils/scss_variables.module.scss"; import "./findings-trends-widget.scss"; const WIDGET_FINDINGS_ITEMS = [ - VULNERABIITY_FINDINGS_ITEM, + VULNERABILITY_FINDINGS_ITEM, ...Object.values(FINDINGS_MAPPING), ]; diff --git a/ui/src/layout/Dashboard/RiskiestAssetsWidget/index.jsx b/ui/src/layout/Dashboard/RiskiestAssetsWidget/index.jsx index 9124ce7ab..c2ad429f3 100644 --- a/ui/src/layout/Dashboard/RiskiestAssetsWidget/index.jsx +++ b/ui/src/layout/Dashboard/RiskiestAssetsWidget/index.jsx @@ -4,14 +4,14 @@ import VulnerabilitiesDisplay, { } from "components/VulnerabilitiesDisplay"; import { APIS, - VULNERABIITY_FINDINGS_ITEM, + VULNERABILITY_FINDINGS_ITEM, FINDINGS_MAPPING, } from "utils/systemConsts"; import { formatNumber } from "utils/utils"; import FindingsTabsWidget from "../FindingsTabsWidget"; const FINDINGS_ITEMS = [ - VULNERABIITY_FINDINGS_ITEM, + VULNERABILITY_FINDINGS_ITEM, ...Object.values(FINDINGS_MAPPING).filter( ({ value }) => value !== FINDINGS_MAPPING.PACKAGES.value, ), @@ -30,7 +30,7 @@ const RiskiestAssetsWidget = ({ className }) => ( { dataKey: "assetInfo.type" }, { customDisplay: ({ count, assetInfo, ...props }) => { - if (selectedId === VULNERABIITY_FINDINGS_ITEM.dataKey) { + if (selectedId === VULNERABILITY_FINDINGS_ITEM.dataKey) { const counters = Object.values(VULNERABILITY_SEVERITY_ITEMS).reduce( (acc, curr) => { const { totalKey, countKey } = curr; diff --git a/ui/src/layout/Dashboard/RiskiestRegionsWidget/index.jsx b/ui/src/layout/Dashboard/RiskiestRegionsWidget/index.jsx index 6f82a85cd..3a5dec25c 100644 --- a/ui/src/layout/Dashboard/RiskiestRegionsWidget/index.jsx +++ b/ui/src/layout/Dashboard/RiskiestRegionsWidget/index.jsx @@ -15,7 +15,7 @@ import Loader from "components/Loader"; import { APIS, FINDINGS_MAPPING, - VULNERABIITY_FINDINGS_ITEM, + VULNERABILITY_FINDINGS_ITEM, } from "utils/systemConsts"; import { BoldText, formatNumber } from "utils/utils"; import WidgetWrapper from "../WidgetWrapper"; @@ -28,7 +28,7 @@ import "./reskiest-regions-widget.scss"; const BAR_STACK_ID = 1; const WIDGET_FINDINGS_ITEMS = [ - VULNERABIITY_FINDINGS_ITEM, + VULNERABILITY_FINDINGS_ITEM, ...Object.values(FINDINGS_MAPPING).filter( ({ value }) => value !== FINDINGS_MAPPING.PACKAGES.value, ), diff --git a/ui/src/layout/Findings/index.jsx b/ui/src/layout/Findings/index.jsx index f5475aff3..e99f21fd9 100644 --- a/ui/src/layout/Findings/index.jsx +++ b/ui/src/layout/Findings/index.jsx @@ -3,7 +3,7 @@ import { useLocation } from "react-router-dom"; import TabbedPage from "components/TabbedPage"; import { FINDINGS_MAPPING, - VULNERABIITY_FINDINGS_ITEM, + VULNERABILITY_FINDINGS_ITEM, ROUTES, } from "utils/systemConsts"; import Vulnerabilities from "./Vulnerabilities"; @@ -20,7 +20,7 @@ const FINDINGS_TAB_ITEMS = { path: "vulnerabilities", title: "Vulnerabilities", component: Vulnerabilities, - findingsType: VULNERABIITY_FINDINGS_ITEM.value, + findingsType: VULNERABILITY_FINDINGS_ITEM.value, }, EXPLOITS: { id: "exploits", diff --git a/ui/src/layout/detail-displays/Findings/FindingsSystemFilterLinks/index.jsx b/ui/src/layout/detail-displays/Findings/FindingsSystemFilterLinks/index.jsx index f9f215231..b75e53002 100644 --- a/ui/src/layout/detail-displays/Findings/FindingsSystemFilterLinks/index.jsx +++ b/ui/src/layout/detail-displays/Findings/FindingsSystemFilterLinks/index.jsx @@ -4,7 +4,7 @@ import Button from "components/Button"; import Icon from "components/Icon"; import { FINDINGS_MAPPING, - VULNERABIITY_FINDINGS_ITEM, + VULNERABILITY_FINDINGS_ITEM, } from "utils/systemConsts"; import { formatNumber } from "utils/utils"; import { getFindingsAbsolutePathByFindingType } from "layout/Findings"; @@ -30,10 +30,10 @@ const FindingsSystemFilterLinks = ({ }) => (
See other findings:
- {[VULNERABIITY_FINDINGS_ITEM, ...Object.values(FINDINGS_MAPPING)].map( + {[VULNERABILITY_FINDINGS_ITEM, ...Object.values(FINDINGS_MAPPING)].map( ({ value, totalKey, title, icon }) => { const LinkTitle = - VULNERABIITY_FINDINGS_ITEM.value === value + VULNERABILITY_FINDINGS_ITEM.value === value ? `${formatNumber(totalVulnerabilitiesCount)} ${title}` : `${!!findingsSummary ? formatNumber(findingsSummary[totalKey] || 0) : 0} ${title}`; diff --git a/ui/src/utils/systemConsts.js b/ui/src/utils/systemConsts.js index 2c7dc1382..80cdd3d34 100644 --- a/ui/src/utils/systemConsts.js +++ b/ui/src/utils/systemConsts.js @@ -82,8 +82,8 @@ export const FINDINGS_MAPPING = { }, }; -export const VULNERABIITY_FINDINGS_ITEM = { - value: "VULNERABIITIES", +export const VULNERABILITY_FINDINGS_ITEM = { + value: "VULNERABILITIES", dataKey: "vulnerabilities", typeKey: "VULNERABILITY", title: "Vulnerabilities", diff --git a/ui/src/utils/utils.jsx b/ui/src/utils/utils.jsx index e644cd489..3c21709e7 100644 --- a/ui/src/utils/utils.jsx +++ b/ui/src/utils/utils.jsx @@ -4,7 +4,7 @@ import CVSS from "@turingpointde/cvss.js"; import { isEmpty, orderBy } from "lodash"; import { FINDINGS_MAPPING, - VULNERABIITY_FINDINGS_ITEM, + VULNERABILITY_FINDINGS_ITEM, } from "utils/systemConsts"; import IconWithTooltip from "components/IconWithTooltip"; import VulnerabilitiesDisplay, { @@ -106,7 +106,7 @@ export const getVulnerabilitiesColumnConfigItem = (props) => { const { tableTitle, withAssetPrefix = false } = props; const prefix = withAssetPrefix ? "asset." : ""; const { title: vulnerabilitiesTitle, icon: vulnerabilitiesIcon } = - VULNERABIITY_FINDINGS_ITEM; + VULNERABILITY_FINDINGS_ITEM; return { Header: ( From 21987a4d47666712d27294d8418098eb935be64b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20J=C3=A1ky?= Date: Mon, 5 Aug 2024 16:04:16 +0200 Subject: [PATCH 3/7] fix(ui): mappping->mapping typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: András Jáky --- ui/src/components/ProgressBar/index.jsx | 8 ++++---- ui/src/components/ScanProgressBar/index.jsx | 20 +++++++++---------- .../TabVulnerabilityDetails.jsx | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ui/src/components/ProgressBar/index.jsx b/ui/src/components/ProgressBar/index.jsx index 97e88b8fb..344bd61fb 100644 --- a/ui/src/components/ProgressBar/index.jsx +++ b/ui/src/components/ProgressBar/index.jsx @@ -7,7 +7,7 @@ import COLORS from "utils/scss_variables.module.scss"; import "./progress-bar.scss"; -export const STATUS_MAPPPING = { +export const STATUS_MAPPING = { IN_PROGRESS: { value: "IN_PROGRESS", color: COLORS["color-main"] }, SUCCESS: { value: "SUCCESS", @@ -33,7 +33,7 @@ export const STATUS_MAPPPING = { }; const ProgressBar = ({ - status = STATUS_MAPPPING.IN_PROGRESS.value, + status = STATUS_MAPPING.IN_PROGRESS.value, itemsCompleted = 0, itemsLeft = 0, width = "100%", @@ -43,13 +43,13 @@ const ProgressBar = ({ }) => { const totalItems = itemsCompleted + itemsLeft; const percent = - status === STATUS_MAPPPING.IN_PROGRESS.value + status === STATUS_MAPPING.IN_PROGRESS.value ? !!totalItems ? Math.round((itemsCompleted / totalItems) * 100) : 0 : 100; - const { icon, color, iconColor } = STATUS_MAPPPING[status]; + const { icon, color, iconColor } = STATUS_MAPPING[status]; const progressIconColor = iconColor || color; const IconComponent = !!message ? IconWithTooltip : Icon; diff --git a/ui/src/components/ScanProgressBar/index.jsx b/ui/src/components/ScanProgressBar/index.jsx index f9c3e7725..eaade1df3 100644 --- a/ui/src/components/ScanProgressBar/index.jsx +++ b/ui/src/components/ScanProgressBar/index.jsx @@ -1,5 +1,5 @@ import React from "react"; -import ProgressBar, { STATUS_MAPPPING } from "components/ProgressBar"; +import ProgressBar, { STATUS_MAPPING } from "components/ProgressBar"; import ErrorMessageDisplay from "components/ErrorMessageDisplay"; import "./scan-progress-bar.scss"; @@ -17,49 +17,49 @@ const SCAN_STATES_AND_REASONS_MAPPINGS = [ { ...SCAN_STATES.Pending, reason: "Created", - status: STATUS_MAPPPING.IN_PROGRESS.value, + status: STATUS_MAPPING.IN_PROGRESS.value, }, { ...SCAN_STATES.Discovered, reason: "AssetsDiscovered", - status: STATUS_MAPPPING.IN_PROGRESS.value, + status: STATUS_MAPPING.IN_PROGRESS.value, }, { ...SCAN_STATES.InProgress, reason: "AssetScansRunning", - status: STATUS_MAPPPING.IN_PROGRESS.value, + status: STATUS_MAPPING.IN_PROGRESS.value, }, { ...SCAN_STATES.Failed, reason: "Cancellation", - status: STATUS_MAPPPING.STOPPED.value, + status: STATUS_MAPPING.STOPPED.value, }, { ...SCAN_STATES.Failed, reason: "Timeout", - status: STATUS_MAPPPING.ERROR.value, + status: STATUS_MAPPING.ERROR.value, errorTitle: "Scan has been timed out", }, { ...SCAN_STATES.Failed, reason: "AssetScanFailed", - status: STATUS_MAPPPING.ERROR.value, + status: STATUS_MAPPING.ERROR.value, errorTitle: "Some of the elements were failed to be scanned", }, { ...SCAN_STATES.Done, reason: "NothingToScan", - status: STATUS_MAPPPING.SUCCESS.value, + status: STATUS_MAPPING.SUCCESS.value, }, { ...SCAN_STATES.Done, reason: "Success", - status: STATUS_MAPPPING.SUCCESS.value, + status: STATUS_MAPPING.SUCCESS.value, }, { ...SCAN_STATES.Aborted, reason: "Cancellation", - status: STATUS_MAPPPING.STOPPED.value, + status: STATUS_MAPPING.STOPPED.value, }, ]; diff --git a/ui/src/layout/Findings/Vulnerabilities/TabVulnerabilityDetails.jsx b/ui/src/layout/Findings/Vulnerabilities/TabVulnerabilityDetails.jsx index c62114d29..fbbcb441d 100644 --- a/ui/src/layout/Findings/Vulnerabilities/TabVulnerabilityDetails.jsx +++ b/ui/src/layout/Findings/Vulnerabilities/TabVulnerabilityDetails.jsx @@ -5,7 +5,7 @@ import TitleValueDisplay, { } from "components/TitleValueDisplay"; import DoublePaneDisplay from "components/DoublePaneDisplay"; import Title from "components/Title"; -import ProgressBar, { STATUS_MAPPPING } from "components/ProgressBar"; +import ProgressBar, { STATUS_MAPPING } from "components/ProgressBar"; import SeverityDisplay from "components/SeverityDisplay"; import SeverityWithCvssDisplay from "components/SeverityWithCvssDisplay"; import { getHigestVersionCvssData } from "utils/utils"; @@ -27,7 +27,7 @@ const ScoreBar = ({ score }) => { return ( Date: Mon, 5 Aug 2024 16:09:15 +0200 Subject: [PATCH 4/7] fix(ui): chnage->change typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: András Jáky --- ui/src/components/Table/index.jsx | 8 ++++---- ui/src/components/TablePage/index.jsx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/src/components/Table/index.jsx b/ui/src/components/Table/index.jsx index a8c165135..307349381 100644 --- a/ui/src/components/Table/index.jsx +++ b/ui/src/components/Table/index.jsx @@ -26,7 +26,7 @@ const Table = (props) => { const { columns, defaultSortBy, - onSortChnage, + onSortChange, onLineClick, paginationItemsName, url, @@ -50,10 +50,10 @@ const Table = (props) => { const prevSortBy = usePrevious(sortBy); useEffect(() => { - if (!!onSortChnage && !isEqual(prevSortBy, sortBy)) { - onSortChnage(sortBy); + if (!!onSortChange && !isEqual(prevSortBy, sortBy)) { + onSortChange(sortBy); } - }, [prevSortBy, sortBy, onSortChnage]); + }, [prevSortBy, sortBy, onSortChange]); const defaultColumn = React.useMemo( () => ({ diff --git a/ui/src/components/TablePage/index.jsx b/ui/src/components/TablePage/index.jsx index 55d5b8aec..de70e5a6c 100644 --- a/ui/src/components/TablePage/index.jsx +++ b/ui/src/components/TablePage/index.jsx @@ -207,7 +207,7 @@ const TablePage = (props) => { setPage(filtersDispatch, { type: filterType, pageIndex }) } defaultSortBy={isEmpty(tableSort) ? initialSortBy : tableSort} - onSortChnage={(tableSort) => + onSortChange={(tableSort) => setSort(filtersDispatch, { type: filterType, tableSort }) } showCustomEmptyDisplay={isEmpty(tableFilters)} From 81e6f0479b8942b2a0923e20b8045371d6de1610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20J=C3=A1ky?= Date: Mon, 5 Aug 2024 16:12:58 +0200 Subject: [PATCH 5/7] fix(ui): higest->highest typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: András Jáky --- ui/src/layout/Dashboard/FindingsImpactWidget/index.jsx | 4 ++-- .../Findings/Vulnerabilities/TabVulnerabilityDetails.jsx | 4 ++-- .../layout/Findings/Vulnerabilities/VulnerabilitiesTable.jsx | 4 ++-- ui/src/utils/utils.jsx | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ui/src/layout/Dashboard/FindingsImpactWidget/index.jsx b/ui/src/layout/Dashboard/FindingsImpactWidget/index.jsx index c11494b35..f6204c4f4 100644 --- a/ui/src/layout/Dashboard/FindingsImpactWidget/index.jsx +++ b/ui/src/layout/Dashboard/FindingsImpactWidget/index.jsx @@ -1,6 +1,6 @@ import React from "react"; import SeverityWithCvssDisplay from "components/SeverityWithCvssDisplay"; -import { getHigestVersionCvssData, formatNumber } from "utils/utils"; +import { getHighestVersionCvssData, formatNumber } from "utils/utils"; import { FINDINGS_MAPPING, VULNERABILITY_FINDINGS_ITEM, @@ -22,7 +22,7 @@ const TABS_COLUMNS_MAPPING = { customDisplay: ({ vulnerability }) => { const { severity, cvss, vulnerabilityName } = vulnerability || {}; const { score, severity: cvssSeverity } = - getHigestVersionCvssData(cvss); + getHighestVersionCvssData(cvss); return ( { metrics, exploitabilityScore, impactScore, - } = getHigestVersionCvssData(cvss); + } = getHighestVersionCvssData(cvss); const { S = {}, AV = {}, diff --git a/ui/src/layout/Findings/Vulnerabilities/VulnerabilitiesTable.jsx b/ui/src/layout/Findings/Vulnerabilities/VulnerabilitiesTable.jsx index bef02247e..1a5d68f53 100644 --- a/ui/src/layout/Findings/Vulnerabilities/VulnerabilitiesTable.jsx +++ b/ui/src/layout/Findings/Vulnerabilities/VulnerabilitiesTable.jsx @@ -4,7 +4,7 @@ import SeverityWithCvssDisplay, { SEVERITY_ITEMS, } from "components/SeverityWithCvssDisplay"; import { OPERATORS } from "components/Filter"; -import { getHigestVersionCvssData, toCapitalized } from "utils/utils"; +import { getHighestVersionCvssData, toCapitalized } from "utils/utils"; import { getScanColumnsConfigList } from "layout/Findings/utils"; import { FILTER_TYPES } from "context/FiltersProvider"; import FindingsTablePage from "../FindingsTablePage"; @@ -31,7 +31,7 @@ const VulnerabilitiesTable = () => { Cell: ({ row }) => { const { id, findingInfo } = row.original; const { severity, cvss } = findingInfo || {}; - const cvssScoreData = getHigestVersionCvssData(cvss); + const cvssScoreData = getHighestVersionCvssData(cvss); return ( export const getScanName = ({ name, startTime }) => `${name} ${formatDate(startTime)}`; -export const getHigestVersionCvssData = (cvssData) => { +export const getHighestVersionCvssData = (cvssData) => { if (isEmpty(cvssData)) { return {}; } From 79f64bccfd98664b784c8be900bab9bb736cc6bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20J=C3=A1ky?= Date: Mon, 5 Aug 2024 16:14:20 +0200 Subject: [PATCH 6/7] fix(ui): custome->custom typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: András Jáky --- ui/src/components/ProgressBar/index.jsx | 4 ++-- .../Findings/Vulnerabilities/TabVulnerabilityDetails.jsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/src/components/ProgressBar/index.jsx b/ui/src/components/ProgressBar/index.jsx index 344bd61fb..95039a6e4 100644 --- a/ui/src/components/ProgressBar/index.jsx +++ b/ui/src/components/ProgressBar/index.jsx @@ -39,7 +39,7 @@ const ProgressBar = ({ width = "100%", message = null, messageTooltipId = null, - customeTitle, + customTitle, }) => { const totalItems = itemsCompleted + itemsLeft; const percent = @@ -65,7 +65,7 @@ const ProgressBar = ({
{!icon ? (
- {!!customeTitle ? customeTitle : `${percent}%`} + {!!customTitle ? customTitle : `${percent}%`}
) : ( { itemsCompleted={score} itemsLeft={10 - score} width="130px" - customeTitle={score} + customTitle={score} /> ); }; From 4d78486560459a81f7dbe2fcb63eaa19c65fb03b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20J=C3=A1ky?= Date: Mon, 5 Aug 2024 17:38:27 +0200 Subject: [PATCH 7/7] fix(ui): typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: András Jáky --- ui/src/layout/AssetScans/TabAssetScanDetails.jsx | 2 +- ui/src/layout/Dashboard/RiskiestRegionsWidget/index.jsx | 2 +- ...eskiest-regions-widget.scss => riskiest-regions-widget.scss} | 0 ui/src/layout/Findings/FindingsTablePage.jsx | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename ui/src/layout/Dashboard/RiskiestRegionsWidget/{reskiest-regions-widget.scss => riskiest-regions-widget.scss} (100%) diff --git a/ui/src/layout/AssetScans/TabAssetScanDetails.jsx b/ui/src/layout/AssetScans/TabAssetScanDetails.jsx index 1f24f0a89..f0d0ef8e9 100644 --- a/ui/src/layout/AssetScans/TabAssetScanDetails.jsx +++ b/ui/src/layout/AssetScans/TabAssetScanDetails.jsx @@ -35,7 +35,7 @@ const StatusDisplay = ({ state, errors }) => (
{!isEmpty(errors) && ( - + {errors.map((error, index) => (
{error}
))} diff --git a/ui/src/layout/Dashboard/RiskiestRegionsWidget/index.jsx b/ui/src/layout/Dashboard/RiskiestRegionsWidget/index.jsx index 3a5dec25c..f2c8d1e5e 100644 --- a/ui/src/layout/Dashboard/RiskiestRegionsWidget/index.jsx +++ b/ui/src/layout/Dashboard/RiskiestRegionsWidget/index.jsx @@ -24,7 +24,7 @@ import FindingsFilters from "../FindingsFilters"; import COLORS from "utils/scss_variables.module.scss"; -import "./reskiest-regions-widget.scss"; +import "./riskiest-regions-widget.scss"; const BAR_STACK_ID = 1; const WIDGET_FINDINGS_ITEMS = [ diff --git a/ui/src/layout/Dashboard/RiskiestRegionsWidget/reskiest-regions-widget.scss b/ui/src/layout/Dashboard/RiskiestRegionsWidget/riskiest-regions-widget.scss similarity index 100% rename from ui/src/layout/Dashboard/RiskiestRegionsWidget/reskiest-regions-widget.scss rename to ui/src/layout/Dashboard/RiskiestRegionsWidget/riskiest-regions-widget.scss diff --git a/ui/src/layout/Findings/FindingsTablePage.jsx b/ui/src/layout/Findings/FindingsTablePage.jsx index f6fa46654..e312ac522 100644 --- a/ui/src/layout/Findings/FindingsTablePage.jsx +++ b/ui/src/layout/Findings/FindingsTablePage.jsx @@ -65,7 +65,7 @@ const FindingsTablePage = ({ />