Skip to content

Commit

Permalink
feat: add attack paths filters
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed-Hacene committed Dec 17, 2024
1 parent 22696ec commit 12af744
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion frontend/src/lib/utils/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,15 @@ const RESIDUAL_CRITICALITY_FILTER: ListViewFilterConfig = {
alwaysDisplay: true
};

const STAKEHOLDER_FILTER: ListViewFilterConfig = {
component: SelectFilter,
getColumn: (row) => (row.stakeholders?.length ? row.stakeholders.map((t) => t.str) : null),
extraProps: {
defaultOptionName: 'stakeholder'
},
alwaysDisplay: true
};

const FRAMEWORK_FILTER: ListViewFilterConfig = {
component: SelectFilter,
getColumn: (row) => row.framework.ref_id,
Expand Down Expand Up @@ -712,7 +721,11 @@ export const listViewFields: ListViewFieldsConfig = {
},
'attack-paths': {
head: ['is_selected', 'name', 'stakeholders', 'description'],
body: ['is_selected', 'name', 'stakeholders', 'description']
body: ['is_selected', 'name', 'stakeholders', 'description'],
filters: {
is_selected: IS_SELECTED_FILTER,
stakeholders: STAKEHOLDER_FILTER
}
},
'operational-scenarios': {
head: ['is_selected', 'operatingModesDescription', 'threats', 'likelihood'],
Expand Down

0 comments on commit 12af744

Please sign in to comment.