mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-01-25 02:08:11 +00:00
feat(ui): add new findings table (#9699)
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
import { IntegrationType } from "../types/integrations";
|
||||
|
||||
// Documentation URLs
|
||||
export const DOCS_URLS = {
|
||||
FINDINGS_ANALYSIS:
|
||||
"https://docs.prowler.com/user-guide/tutorials/prowler-app#step-8:-analyze-the-findings",
|
||||
} as const;
|
||||
|
||||
export const getProviderHelpText = (provider: string) => {
|
||||
switch (provider) {
|
||||
case "aws":
|
||||
|
||||
@@ -5,46 +5,6 @@ import {
|
||||
ProviderType,
|
||||
} from "@/types/providers";
|
||||
|
||||
/**
|
||||
* Maps overview provider filters to findings page provider filters.
|
||||
* Converts provider_id__in to provider__in and removes provider_type__in
|
||||
* since provider__in is more specific.
|
||||
*/
|
||||
export const mapProviderFiltersForFindings = (
|
||||
params: URLSearchParams,
|
||||
): void => {
|
||||
const providerIds = params.get("filter[provider_id__in]");
|
||||
if (providerIds) {
|
||||
params.delete("filter[provider_id__in]");
|
||||
params.delete("filter[provider_type__in]");
|
||||
params.set("filter[provider__in]", providerIds);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Maps overview provider filters to findings page provider filters (object version).
|
||||
* Converts provider_id__in to provider__in and removes provider_type__in
|
||||
* since provider__in is more specific.
|
||||
*/
|
||||
export const mapProviderFiltersForFindingsObject = <
|
||||
T extends Record<string, unknown>,
|
||||
>(
|
||||
filters: T,
|
||||
): T => {
|
||||
const result = { ...filters };
|
||||
const providerIdKey = "filter[provider_id__in]";
|
||||
const providerTypeKey = "filter[provider_type__in]";
|
||||
const providerKey = "filter[provider__in]";
|
||||
|
||||
if (providerIdKey in result) {
|
||||
result[providerKey as keyof T] = result[providerIdKey as keyof T];
|
||||
delete result[providerIdKey as keyof T];
|
||||
delete result[providerTypeKey as keyof T];
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
export const extractProviderUIDs = (
|
||||
providersData: ProvidersApiResponse,
|
||||
): string[] => {
|
||||
|
||||
Reference in New Issue
Block a user