diff --git a/ui/src/components/ProgressBar/index.jsx b/ui/src/components/ProgressBar/index.jsx index 97e88b8fb..95039a6e4 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,23 +33,23 @@ export const STATUS_MAPPPING = { }; const ProgressBar = ({ - status = STATUS_MAPPPING.IN_PROGRESS.value, + status = STATUS_MAPPING.IN_PROGRESS.value, itemsCompleted = 0, itemsLeft = 0, width = "100%", message = null, messageTooltipId = null, - customeTitle, + customTitle, }) => { 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; @@ -65,7 +65,7 @@ const ProgressBar = ({ {!icon ? (
- {!!customeTitle ? customeTitle : `${percent}%`} + {!!customTitle ? customTitle : `${percent}%`}
) : ( {
{score}
) : ( 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 81cdb072b..de70e5a6c 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} @@ -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)} 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/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/layout/AssetScans/TabAssetScanDetails.jsx b/ui/src/layout/AssetScans/TabAssetScanDetails.jsx index 75ddc9975..f0d0ef8e9 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, ), @@ -35,7 +35,7 @@ const StatusDisplay = ({ state, errors }) => (
{!isEmpty(errors) && ( - + {errors.map((error, index) => (
{error}
))} diff --git a/ui/src/layout/Dashboard/FindingsImpactWidget/index.jsx b/ui/src/layout/Dashboard/FindingsImpactWidget/index.jsx index d4d1da121..f6204c4f4 100644 --- a/ui/src/layout/Dashboard/FindingsImpactWidget/index.jsx +++ b/ui/src/layout/Dashboard/FindingsImpactWidget/index.jsx @@ -1,20 +1,20 @@ import React from "react"; import SeverityWithCvssDisplay from "components/SeverityWithCvssDisplay"; -import { getHigestVersionCvssData, formatNumber } from "utils/utils"; +import { getHighestVersionCvssData, 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" }, @@ -22,7 +22,7 @@ const TABS_COLUMNS_MAPPING = { customDisplay: ({ vulnerability }) => { const { severity, cvss, vulnerabilityName } = vulnerability || {}; const { score, severity: cvssSeverity } = - getHigestVersionCvssData(cvss); + getHighestVersionCvssData(cvss); return ( 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..f2c8d1e5e 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"; @@ -24,11 +24,11 @@ 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 = [ - VULNERABIITY_FINDINGS_ITEM, + VULNERABILITY_FINDINGS_ITEM, ...Object.values(FINDINGS_MAPPING).filter( ({ value }) => value !== FINDINGS_MAPPING.PACKAGES.value, ), 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 = ({ />
diff --git a/ui/src/layout/Findings/Vulnerabilities/TabVulnerabilityDetails.jsx b/ui/src/layout/Findings/Vulnerabilities/TabVulnerabilityDetails.jsx index c62114d29..f72ce65c9 100644 --- a/ui/src/layout/Findings/Vulnerabilities/TabVulnerabilityDetails.jsx +++ b/ui/src/layout/Findings/Vulnerabilities/TabVulnerabilityDetails.jsx @@ -5,10 +5,10 @@ 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"; +import { getHighestVersionCvssData } from "utils/utils"; import LinksDisplay from "layout/Findings/LinkesDisplay"; import ScoreTag from "./ScoreTag"; import { FindingsDetailsCommonFields } from "../utils"; @@ -27,11 +27,11 @@ const ScoreBar = ({ score }) => { return ( ); }; @@ -56,7 +56,7 @@ const TabVulnerabilityDetails = ({ data }) => { 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 ( (
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 3dd4b7a7e..ab6c019f2 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, { @@ -47,7 +47,7 @@ export const formatNumber = (value) => export const getScanName = ({ name, startTime }) => `${name} ${formatDate(startTime)}`; -export const getHigestVersionCvssData = (cvssData) => { +export const getHighestVersionCvssData = (cvssData) => { if (isEmpty(cvssData)) { return {}; } @@ -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: ( @@ -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: [