diff --git a/frontend/messages/ar.json b/frontend/messages/ar.json index e7c14d304..8ff33880a 100644 --- a/frontend/messages/ar.json +++ b/frontend/messages/ar.json @@ -145,6 +145,7 @@ "justification": "التبرير", "parentFolder": "المجلد الرئيسي", "contentType": "نوع المحتوى", + "objectType": "نوع الكائن", "type": "النوع", "lcStatus": "حالة LC", "internalReference": "المرجع الداخلي", diff --git a/frontend/messages/de.json b/frontend/messages/de.json index 16dba3009..ba2b3b7d3 100644 --- a/frontend/messages/de.json +++ b/frontend/messages/de.json @@ -156,6 +156,7 @@ "justification": "Begründung", "parentFolder": "Übergeordneter Ordner", "contentType": "Inhaltstyp", + "objectType": "Objekttyp", "type": "Typ", "lcStatus": "Status", "internalReference": "Interne Referenz", diff --git a/frontend/messages/en.json b/frontend/messages/en.json index 6d71c79a4..8fc225019 100644 --- a/frontend/messages/en.json +++ b/frontend/messages/en.json @@ -157,6 +157,7 @@ "justification": "Justification", "parentFolder": "Parent folder", "contentType": "Content type", + "objectType": "Object type", "type": "Type", "lcStatus": "Status", "internalReference": "Internal reference", diff --git a/frontend/messages/es.json b/frontend/messages/es.json index df0cc23e1..3ab1f6881 100644 --- a/frontend/messages/es.json +++ b/frontend/messages/es.json @@ -156,6 +156,7 @@ "justification": "Justificación", "parentFolder": "Carpeta principal", "contentType": "Tipo de contenido", + "objectType": "abcdef", "type": "Tipo", "lcStatus": "Estado", "internalReference": "Referencia interna", diff --git a/frontend/messages/fr.json b/frontend/messages/fr.json index 64c376308..5155a3894 100644 --- a/frontend/messages/fr.json +++ b/frontend/messages/fr.json @@ -156,6 +156,7 @@ "justification": "Justification", "parentFolder": "Domaine parent", "contentType": "Type de contenu", + "objectType": "Type d'objet", "type": "Type", "lcStatus": "Statut", "internalReference": "Référence interne", diff --git a/frontend/messages/hi.json b/frontend/messages/hi.json index 9effdf8e8..f1db6f897 100644 --- a/frontend/messages/hi.json +++ b/frontend/messages/hi.json @@ -154,6 +154,7 @@ "justification": "औचित्य", "parentFolder": "अभिभावक फ़ोल्डर", "contentType": "सामग्री प्रकार", + "objectType": "ऑब्जेक्ट प्रकार", "type": "प्रकार", "lcStatus": "स्थिति", "internalReference": "आंतरिक संदर्भ", diff --git a/frontend/messages/it.json b/frontend/messages/it.json index 1f5981730..c425d66ea 100644 --- a/frontend/messages/it.json +++ b/frontend/messages/it.json @@ -156,6 +156,7 @@ "justification": "Giustificazione", "parentFolder": "Cartella principale", "contentType": "Tipo di contenuto", + "objectType": "Tipo di oggetto", "type": "Tipo", "lcStatus": "Stato", "internalReference": "Riferimento interno", diff --git a/frontend/messages/nl.json b/frontend/messages/nl.json index 73a343c28..462af7c6b 100644 --- a/frontend/messages/nl.json +++ b/frontend/messages/nl.json @@ -156,6 +156,7 @@ "justification": "Rechtvaardiging", "parentFolder": "Bovenliggende map", "contentType": "Inhoudstype", + "objectType": "Objecttype", "type": "Type", "lcStatus": "Status", "internalReference": "Interne referentie", diff --git a/frontend/messages/pl.json b/frontend/messages/pl.json index 7047be37e..d1112f001 100644 --- a/frontend/messages/pl.json +++ b/frontend/messages/pl.json @@ -156,6 +156,7 @@ "justification": "Uzasadnienie", "parentFolder": "Folder nadrzędny", "contentType": "Rodzaj treści", + "objectType": "Typ obiektu", "type": "Typ", "lcStatus": "Status LC", "internalReference": "Referencja wewnętrzna", diff --git a/frontend/messages/pt.json b/frontend/messages/pt.json index 9f4836ab8..e72d39de5 100644 --- a/frontend/messages/pt.json +++ b/frontend/messages/pt.json @@ -156,6 +156,7 @@ "justification": "Justificativa", "parentFolder": "Pasta pai", "contentType": "Tipo de conteúdo", + "objectType": "Tipo de objeto", "type": "Tipo", "lcStatus": "Status", "internalReference": "Referência interna", diff --git a/frontend/messages/ro.json b/frontend/messages/ro.json index 4a5226b39..1a1522311 100644 --- a/frontend/messages/ro.json +++ b/frontend/messages/ro.json @@ -152,6 +152,7 @@ "justification": "Justificare", "parentFolder": "Dosar părinte", "contentType": "Tip conținut", + "objectType": "Tipul obiectului", "type": "Tip", "lcStatus": "Stare LC", "internalReference": "Referință internă", diff --git a/frontend/messages/ur.json b/frontend/messages/ur.json index a3020efaf..973b9d377 100644 --- a/frontend/messages/ur.json +++ b/frontend/messages/ur.json @@ -154,6 +154,7 @@ "justification": "جواز", "parentFolder": "مرکزی فولڈر", "contentType": "مواد کی قسم", + "objectType": "آبجیکٹ کی قسم", "type": "قسم", "lcStatus": "حیثیت", "internalReference": "داخلی حوالہ", diff --git a/frontend/src/lib/utils/table.ts b/frontend/src/lib/utils/table.ts index e3bc7eb21..2e5994eb2 100644 --- a/frontend/src/lib/utils/table.ts +++ b/frontend/src/lib/utils/table.ts @@ -227,6 +227,31 @@ const OWNER_FILTER: ListViewFilterConfig = { } }; */ +const LIBRARY_TYPE_FILTER = { + component: SelectFilter, + getColumn: (row) => { + const overviewKeys = new Set(row.overview.map((overviewRow) => overviewRow.split(':')[0])); + const libraryDatatypeSet = new Set([ + 'framework', + 'risk_matrix', + 'threats', + 'requirement_mapping_set', + 'reference_controls' + ]); + const datatypes = [...libraryDatatypeSet].filter((datatype) => overviewKeys.has(datatype)); + return datatypes; + }, + extraProps: { + defaultOptionName: 'objectType', + optionLabels: { + reference_controls: 'referenceControls', + requirement_mapping_set: 'requirementMappingSet', + risk_matrix: 'riskMatrix' + } + }, + alwaysDisplay: true +}; + export const listViewFields: ListViewFieldsConfig = { folders: { head: ['name', 'description', 'parentDomain'], @@ -409,8 +434,8 @@ export const listViewFields: ListViewFieldsConfig = { body: ['provider', 'name', 'description', 'locales', 'overview'], filters: { locales: LANGUAGE_FILTER, - provider: PROVIDER_FILTER_FOR_LIBRARIES - // has_risk_matrix: HAS_RISK_MATRIX_FILTER + provider: PROVIDER_FILTER_FOR_LIBRARIES, + objectType: LIBRARY_TYPE_FILTER } }, 'loaded-libraries': { @@ -418,7 +443,8 @@ export const listViewFields: ListViewFieldsConfig = { body: ['provider', 'name', 'description', 'locales', 'overview'], filters: { locales: LANGUAGE_FILTER, - provider: PROVIDER_FILTER_FOR_LIBRARIES + provider: PROVIDER_FILTER_FOR_LIBRARIES, + objectType: LIBRARY_TYPE_FILTER } }, 'sso-settings': {