Skip to content

Commit

Permalink
feat: add a filter on current and residual risk levels on risk scenar…
Browse files Browse the repository at this point in the history
…ios (#1442)

* freat: current/residual criticality filters for risk scenarios

* fix: created correct filter

* fix: minor fix
  • Loading branch information
Axxiar authored Jan 28, 2025
1 parent bb7c019 commit 73570ee
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion frontend/src/lib/utils/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,24 @@ const ENTITY_FILTER: ListViewFilterConfig = {
alwaysDisplay: true
};

const CURRENT_LEVEL_FILTER: ListViewFilterConfig = {
component: SelectFilter,
getColumn: (row) => row.current_level.name,
extraProps: {
defaultOptionName: 'current_level'
},
alwaysDisplay: true
};

const RESIDUAL_LEVEL_FILTER: ListViewFilterConfig = {
component: SelectFilter,
getColumn: (row) => row.residual_level.name,
extraProps: {
defaultOptionName: 'residual_level'
},
alwaysDisplay: true
};

const CURRENT_CRITICALITY_FILTER: ListViewFilterConfig = {
component: SelectFilter,
getColumn: (row) => row.current_criticality.toString(),
Expand Down Expand Up @@ -458,7 +476,9 @@ export const listViewFields: ListViewFieldsConfig = {
treatment: { ...TREATMENT_FILTER, alwaysDisplay: true },
risk_assessment: RISK_ASSESSMENT_FILTER,
threats: THREAT_FILTER,
assets: ASSET_FILTER
assets: ASSET_FILTER,
current_level: CURRENT_LEVEL_FILTER,
residual_level: RESIDUAL_LEVEL_FILTER
}
},
'risk-acceptances': {
Expand Down

0 comments on commit 73570ee

Please sign in to comment.