Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental: Add requirements assessment special page #626

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@
"partial": "Partial",
"noResultFound": "No result found",
"filters": "Filters",
"advanced": "Advanced",
"notApplicableScore": "You cannot score if the requirement assessment is not applicable",
"maturity": "Maturity",
"progress": "Progress",
Expand Down
1 change: 1 addition & 0 deletions frontend/messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@
"partial": "Partielle",
"noResultFound": "Aucun résultat trouvé",
"filters": "Filtres",
"advanced": "Avancé",
"notApplicableScore": "Vous ne pouvez pas scorer si l'évaluation des exigences n'est pas applicable",
"maturity": "Maturité",
"progress": "Progression",
Expand Down
11 changes: 10 additions & 1 deletion frontend/src/lib/components/SideBar/navData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ export const navData = {
}
]
},

{
name: 'extra',
items: [
Expand Down Expand Up @@ -191,6 +190,16 @@ export const navData = {
permissions: ['change_globalsettings']
}
]
},
{
name: 'advanced',
items: [
{
name: 'requirementAssessments',
fa_icon: 'fa-solid fa-cogs',
href: '/requirement-assessments'
}
]
}
]
};
1 change: 1 addition & 0 deletions frontend/src/lib/utils/locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export function localItems(): LocalItems {
compliance: m.compliance(),
organization: m.organization(),
extra: m.extra(),
advanced: m.advanced(),
analytics: m.analytics(),
calendar: m.calendar(),
threats: m.threats(),
Expand Down
25 changes: 24 additions & 1 deletion frontend/src/lib/utils/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,24 @@ const STATUS_FILTER: ListViewFilterConfig = {
alwaysDisplay: true
};

const RESULT_FILTER: ListViewFilterConfig = {
component: SelectFilter,
getColumn: (row) => row.meta.result,
extraProps: {
defaultOptionName: 'result'
},
alwaysDisplay: true
};

const AUDIT_FILTER: ListViewFilterConfig = {
component: SelectFilter,
getColumn: (row) => row.meta.compliance_assessment.str,
extraProps: {
defaultOptionName: 'complianceAssessment'
},
alwaysDisplay: true
};

const TREATMENT_FILTER: ListViewFilterConfig = {
// I could make a function just make the code less repeatitive and long for nothing
component: SelectFilter,
Expand Down Expand Up @@ -356,7 +374,12 @@ export const listViewFields: ListViewFieldsConfig = {
'requirement-assessments': {
head: ['name', 'description', 'complianceAssessment'],
body: ['name', 'description', 'compliance_assessment'],
breadcrumb_link_disabled: true
breadcrumb_link_disabled: true,
filters: {
status: STATUS_FILTER,
result: RESULT_FILTER,
audit: AUDIT_FILTER
}
},
evidences: {
head: ['name', 'file', 'size', 'description'],
Expand Down
Loading