Skip to content

Commit

Permalink
sort audit pages in page distributions in report
Browse files Browse the repository at this point in the history
  • Loading branch information
bellangerq committed Nov 27, 2024
1 parent 4c1fb11 commit 4bdee0e
Showing 1 changed file with 41 additions and 41 deletions.
82 changes: 41 additions & 41 deletions confiture-rest-api/src/audits/audit.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -879,56 +879,56 @@ export class AuditService {
technologies: audit.technologies
},

pageDistributions: [audit.transverseElementsPage, ...audit.pages].map(
(p) => ({
name: p.name,
compliant: {
raw: results.filter(
pageDistributions: [
audit.transverseElementsPage,
...sortBy(audit.pages, "order")
].map((p) => ({
name: p.name,
compliant: {
raw: results.filter(
(r) =>
r.pageId === p.id && r.status === CriterionResultStatus.COMPLIANT
).length,
percentage:
(results.filter(
(r) =>
r.pageId === p.id &&
r.status === CriterionResultStatus.COMPLIANT
).length,
percentage:
(results.filter(
(r) =>
r.pageId === p.id &&
r.status === CriterionResultStatus.COMPLIANT
).length /
totalCriteriaCount) *
100
},
notApplicable: {
raw: results.filter(
).length /
totalCriteriaCount) *
100
},
notApplicable: {
raw: results.filter(
(r) =>
r.pageId === p.id &&
r.status === CriterionResultStatus.NOT_APPLICABLE
).length,
percentage:
(results.filter(
(r) =>
r.pageId === p.id &&
r.status === CriterionResultStatus.NOT_APPLICABLE
).length,
percentage:
(results.filter(
(r) =>
r.pageId === p.id &&
r.status === CriterionResultStatus.NOT_APPLICABLE
).length /
totalCriteriaCount) *
100
},
notCompliant: {
raw: results.filter(
).length /
totalCriteriaCount) *
100
},
notCompliant: {
raw: results.filter(
(r) =>
r.pageId === p.id &&
r.status === CriterionResultStatus.NOT_COMPLIANT
).length,
percentage:
(results.filter(
(r) =>
r.pageId === p.id &&
r.status === CriterionResultStatus.NOT_COMPLIANT
).length,
percentage:
(results.filter(
(r) =>
r.pageId === p.id &&
r.status === CriterionResultStatus.NOT_COMPLIANT
).length /
totalCriteriaCount) *
100
}
})
),
).length /
totalCriteriaCount) *
100
}
})),

resultDistribution: {
compliant: {
Expand Down

0 comments on commit 4bdee0e

Please sign in to comment.