diff --git a/src/lib/components/templates/Profile.svelte b/src/lib/components/templates/Profile.svelte index b241604..7ec864a 100644 --- a/src/lib/components/templates/Profile.svelte +++ b/src/lib/components/templates/Profile.svelte @@ -74,6 +74,31 @@ You should have received a copy of the GNU Affero General Public License along w }) .flat(1); }; + + /* Since I group commits by date and project I need to create a structure. */ + const groupCommitsByDateAndProject = function (commitsMap) { + const groupByDateAndProject = {}; + commitsMap + // Some commits couldn't be fetched from Vervis + .filter((commit) => Boolean(commit.id)) + .forEach((commit) => { + const { committed, context } = commit; + + // Ensure key exists + if (!groupByDateAndProject[committed]) { + groupByDateAndProject[committed] = {}; + } + + // Ensure Array exists + if (!groupByDateAndProject[committed][context]) { + groupByDateAndProject[committed][context] = []; + } + + groupByDateAndProject[committed][context].push(commit); + }); + + return groupByDateAndProject; + };
@@ -199,86 +224,93 @@ You should have received a copy of the GNU Affero General Public License along w