From f73b94d4531cc3afb2fb73bc2d044fd8d14b93c5 Mon Sep 17 00:00:00 2001 From: Alexandre Monney Date: Fri, 13 Dec 2024 11:57:13 +0100 Subject: [PATCH] feat(orga): WIP Co-authored-by: Vincent Hardouin --- orga/app/components/statistics/index.gjs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/orga/app/components/statistics/index.gjs b/orga/app/components/statistics/index.gjs index 501ede62c47..51d461d76e2 100644 --- a/orga/app/components/statistics/index.gjs +++ b/orga/app/components/statistics/index.gjs @@ -39,6 +39,22 @@ export default class Statistics extends Component { return this.analysisByTubes.slice(start, end); } + get analysisByDomains() { + return this.analysisByTubes.reduce((acc, line) => { + const domain = line.domaine; + if (acc[domain]) { + acc[domain].push(line); + } else { + acc[domain] = [line]; + } + return acc; + }, {}); + } + + get domainsName() { + return Object.keys(this.analysisByDomains); + } +