From 5d265e4b4831e431c1feb8c56d07f8e1931b4b9c Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Fri, 25 Oct 2024 01:53:25 +0300 Subject: [PATCH] fix: combine typeOfOccupation --- src/components/schedule/table/table.component.html | 8 +++++--- src/components/schedule/table/table.component.ts | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/schedule/table/table.component.html b/src/components/schedule/table/table.component.html index ad828ed..853717e 100644 --- a/src/components/schedule/table/table.component.html +++ b/src/components/schedule/table/table.component.html @@ -51,10 +51,12 @@
{{ elementData["discipline"] }}
@for (typeOfOccupation of elementData["typeOfOccupations"]; track $index) { - @if ($index !== 0) { -
+ @if ($index === 0 && elementData["typeOfOccupations"][$index - 1] !== typeOfOccupation) { + @if ($index !== 0) { +
+ } +
({{ typeOfOccupation }})
} -
({{ typeOfOccupation }})
} diff --git a/src/components/schedule/table/table.component.ts b/src/components/schedule/table/table.component.ts index 5b5ad93..7a75bc0 100644 --- a/src/components/schedule/table/table.component.ts +++ b/src/components/schedule/table/table.component.ts @@ -89,7 +89,7 @@ export class TableComponent implements OnChanges { ); const groupedData = filteredData.reduce((acc, item) => { - const key = `${item.lectureHalls}-${item.campus}-${item.discipline}-${item.professors.join(', ')}-${item.isExcludedWeeks}-${item.weeks?.join(', ') || ''}`; + const key = `${item.typeOfOccupations.join(', ')}-${item.lectureHalls}-${item.campus}-${item.discipline}-${item.professors.join(', ')}-${item.isExcludedWeeks}-${item.weeks?.join(', ') || ''}`; if (!acc[key]) acc[key] = {...item, groups: [item.group]}; else