diff --git a/client/src/app/components/labels-from-items/labels-from-items.tsx b/client/src/app/components/labels-from-items/labels-from-items.tsx index d152ea9413..d0069a1a48 100644 --- a/client/src/app/components/labels-from-items/labels-from-items.tsx +++ b/client/src/app/components/labels-from-items/labels-from-items.tsx @@ -36,16 +36,17 @@ export function LabelsFromItems({ noneMessage?: string; }): JSX.Element { const { t } = useTranslation(); - - if (items?.length ?? 0 === 0) { - return
{noneMessage || t("terms.none")}
; + console.log("items", items); + + // Check if items is not undefined and has length greater than 0 + if (items && items.length > 0) { + return ( + + {items.map((item, index) => ( + {item.name} + ))} + + ); } - - return ( - - {items?.map((item, index) => ( - {item.name} - ))} - - ); + return
{noneMessage || t("terms.none")}
; } diff --git a/client/src/app/pages/applications/applications-table-assessment/applications-table-assessment.tsx b/client/src/app/pages/applications/applications-table-assessment/applications-table-assessment.tsx index 9602e1d191..ce716b58c9 100644 --- a/client/src/app/pages/applications/applications-table-assessment/applications-table-assessment.tsx +++ b/client/src/app/pages/applications/applications-table-assessment/applications-table-assessment.tsx @@ -274,6 +274,35 @@ export const ApplicationsTable: React.FC = () => { }) + "...", getItemValue: (item) => item?.name || "", }, + { + key: "archetype", + title: t("terms.archetype"), + type: FilterType.multiselect, + placeholderText: + t("actions.filterBy", { + what: t("terms.archetype").toLowerCase(), + }) + "...", + getItemValue: (item) => { + const archetypeNames = item?.archetypes + ?.map((archetype) => archetype.name) + .join(""); + return archetypeNames || ""; + }, + selectOptions: [ + ...new Set( + applications + .flatMap( + (application) => + application?.archetypes?.map((archetype) => archetype.name) + ) + .filter(Boolean) + ), + ].map((archetypeName) => ({ + key: archetypeName, + value: archetypeName, + })), + logicOperator: "OR", + }, { key: "description", title: t("terms.description"),