Compare commits

...

2 Commits

Author SHA1 Message Date
sumit_chaturvedi
c7fdb19b48 docs: changelog update 2025-08-12 11:03:47 +05:30
sumit_chaturvedi
4bf796eef9 chore(ui): update connection filter labels to connected/disconnected 2025-08-12 10:56:00 +05:30
4 changed files with 37 additions and 19 deletions

View File

@@ -12,6 +12,7 @@ All notable changes to the **Prowler UI** are documented in this file.
### 🔄 Changed
- Disable `See Compliance` button until scan completes [(#8487)](https://github.com/prowler-cloud/prowler/pull/8487)
- Cloud providers page connection filter labels from `true/false` to `connected/disconnected` [(#8505)](https://github.com/prowler-cloud/prowler/pull/8505)
### 🐞 Fixed
- DataTable column headers set to single-line [(#8480)](https://github.com/prowler-cloud/prowler/pull/8480)

View File

@@ -6,6 +6,12 @@ export const filterProviders = [
key: "connected",
labelCheckboxGroup: "Connection",
values: ["false", "true"],
valueLabelMapping: [
{
false: { label: "Disconnected" },
true: { label: "Connected" },
},
],
},
{
key: "provider__in",

View File

@@ -196,6 +196,8 @@ export const CustomDropdownFilter = ({
(entity as ScanEntity).providerInfo?.uid ||
value
);
} else if ("label" in entity) {
return entity.label;
} else {
return (
(entity as ProviderEntity).alias ||
@@ -207,6 +209,32 @@ export const CustomDropdownFilter = ({
[filter.valueLabelMapping],
);
const renderEntity = (entity: FilterEntity | undefined, value: string) => {
if (!entity) return value;
if (isScanEntity(entity as ScanEntity)) {
return <ComplianceScanInfo scan={entity as ScanEntity} />;
}
const maybeProvider = entity as ProviderEntity;
if ("provider" in maybeProvider) {
return (
<EntityInfoShort
cloudProvider={maybeProvider.provider}
entityAlias={maybeProvider.alias ?? undefined}
entityId={maybeProvider.uid}
hideCopyButton
/>
);
}
if ("label" in entity) {
return <span>{entity.label}</span>;
}
return value;
};
return (
<div className="flex w-full flex-col gap-2">
<Popover
@@ -319,24 +347,7 @@ export const CustomDropdownFilter = ({
key={value}
value={value}
>
{entity ? (
isScanEntity(entity as ScanEntity) ? (
<ComplianceScanInfo scan={entity as ScanEntity} />
) : (
<EntityInfoShort
cloudProvider={
(entity as ProviderEntity).provider
}
entityAlias={
(entity as ProviderEntity).alias ?? undefined
}
entityId={(entity as ProviderEntity).uid}
hideCopyButton
/>
)
) : (
value
)}
{renderEntity(entity, value)}
</Checkbox>
);
})}

View File

@@ -1,7 +1,7 @@
import { ProviderEntity } from "./providers";
import { ScanEntity } from "./scans";
export type FilterEntity = ProviderEntity | ScanEntity;
export type FilterEntity = ProviderEntity | ScanEntity | { label: string };
export interface FilterOption {
key: string;