@if (lectureSelected) {
diff --git a/src/main/webapp/app/overview/course-lectures/course-lectures.component.ts b/src/main/webapp/app/overview/course-lectures/course-lectures.component.ts
index b146542679e6..afd7532d3cc8 100644
--- a/src/main/webapp/app/overview/course-lectures/course-lectures.component.ts
+++ b/src/main/webapp/app/overview/course-lectures/course-lectures.component.ts
@@ -4,7 +4,7 @@ import { ActivatedRoute, Router } from '@angular/router';
import { Subscription } from 'rxjs';
import { Lecture } from 'app/entities/lecture.model';
import { CourseStorageService } from 'app/course/manage/course-storage.service';
-import { AccordionGroups, CollapseState, SidebarCardElement, SidebarData } from 'app/types/sidebar';
+import { AccordionGroups, CollapseState, SidebarCardElement, SidebarData, SidebarItemShowAlways } from 'app/types/sidebar';
import { CourseOverviewService } from '../course-overview.service';
const DEFAULT_UNIT_GROUPS: AccordionGroups = {
@@ -23,6 +23,14 @@ const DEFAULT_COLLAPSE_STATE: CollapseState = {
noDate: true,
};
+const DEFAULT_SHOW_ALWAYS: SidebarItemShowAlways = {
+ future: false,
+ current: false,
+ dueSoon: false,
+ past: false,
+ noDate: false,
+};
+
@Component({
selector: 'jhi-course-lectures',
templateUrl: './course-lectures.component.html',
@@ -41,6 +49,7 @@ export class CourseLecturesComponent implements OnInit, OnDestroy {
sidebarLectures: SidebarCardElement[] = [];
isCollapsed: boolean = false;
readonly DEFAULT_COLLAPSE_STATE = DEFAULT_COLLAPSE_STATE;
+ protected readonly DEFAULT_SHOW_ALWAYS = DEFAULT_SHOW_ALWAYS;
constructor(
private courseStorageService: CourseStorageService,
diff --git a/src/main/webapp/app/overview/course-tutorial-groups/course-tutorial-groups.component.html b/src/main/webapp/app/overview/course-tutorial-groups/course-tutorial-groups.component.html
index c6f3864b47b7..a950991b42cd 100644
--- a/src/main/webapp/app/overview/course-tutorial-groups/course-tutorial-groups.component.html
+++ b/src/main/webapp/app/overview/course-tutorial-groups/course-tutorial-groups.component.html
@@ -1,7 +1,13 @@
@if (course) {
-
+
@if (tutorialGroupSelected) {
diff --git a/src/main/webapp/app/overview/course-tutorial-groups/course-tutorial-groups.component.ts b/src/main/webapp/app/overview/course-tutorial-groups/course-tutorial-groups.component.ts
index 5d56558dde63..ed90dd068fb1 100644
--- a/src/main/webapp/app/overview/course-tutorial-groups/course-tutorial-groups.component.ts
+++ b/src/main/webapp/app/overview/course-tutorial-groups/course-tutorial-groups.component.ts
@@ -12,7 +12,7 @@ import { AlertService } from 'app/core/util/alert.service';
import { TutorialGroupFreePeriod } from 'app/entities/tutorial-group/tutorial-group-free-day.model';
import { CourseStorageService } from 'app/course/manage/course-storage.service';
import { TutorialGroupsConfiguration } from 'app/entities/tutorial-group/tutorial-groups-configuration.model';
-import { AccordionGroups, CollapseState, SidebarCardElement, SidebarData, TutorialGroupCategory } from 'app/types/sidebar';
+import { AccordionGroups, CollapseState, SidebarCardElement, SidebarData, SidebarItemShowAlways, TutorialGroupCategory } from 'app/types/sidebar';
import { CourseOverviewService } from '../course-overview.service';
import { cloneDeep } from 'lodash-es';
@@ -28,6 +28,12 @@ const DEFAULT_COLLAPSE_STATE: CollapseState = {
further: true,
};
+const DEFAULT_SHOW_ALWAYS: SidebarItemShowAlways = {
+ registered: false,
+ all: false,
+ further: false,
+};
+
@Component({
selector: 'jhi-course-tutorial-groups',
templateUrl: './course-tutorial-groups.component.html',
@@ -49,6 +55,7 @@ export class CourseTutorialGroupsComponent implements OnInit, OnDestroy {
sortedTutorialGroups: TutorialGroup[] = [];
accordionTutorialGroupsGroups: AccordionGroups = TUTORIAL_UNIT_GROUPS;
readonly DEFAULT_COLLAPSE_STATE = DEFAULT_COLLAPSE_STATE;
+ protected readonly DEFAULT_SHOW_ALWAYS = DEFAULT_SHOW_ALWAYS;
sidebarTutorialGroups: SidebarCardElement[] = [];
constructor(
diff --git a/src/main/webapp/app/shared/sidebar/sidebar-accordion/sidebar-accordion.component.html b/src/main/webapp/app/shared/sidebar/sidebar-accordion/sidebar-accordion.component.html
index 16eb4bc62671..a3ec25c5b6d6 100644
--- a/src/main/webapp/app/shared/sidebar/sidebar-accordion/sidebar-accordion.component.html
+++ b/src/main/webapp/app/shared/sidebar/sidebar-accordion/sidebar-accordion.component.html
@@ -1,5 +1,5 @@
@for (groupKey of Object.keys(groupedData); track groupKey; let i = $index) {
- @if ((groupedData[groupKey].entityData | searchFilter: ['title', 'type'] : searchValue)?.length) {
+ @if ((groupedData[groupKey].entityData | searchFilter: ['title', 'type'] : searchValue)?.length || sidebarItemAlwaysShow()[groupKey]) {
();
@Input() collapseState: CollapseState;
@Input() isFilterActive: boolean = false;
@@ -41,7 +42,7 @@ export class SidebarAccordionComponent implements OnChanges, OnInit {
}
setStoredCollapseState() {
- const storedCollapseState: string | null = sessionStorage.getItem('sidebar.accordion.collapseState.' + this.storageId + '.byCourse.' + this.courseId);
+ const storedCollapseState: string | null = localStorage.getItem('sidebar.accordion.collapseState.' + this.storageId + '.byCourse.' + this.courseId);
if (storedCollapseState) this.collapseState = JSON.parse(storedCollapseState);
}
@@ -68,6 +69,6 @@ export class SidebarAccordionComponent implements OnChanges, OnInit {
toggleGroupCategoryCollapse(groupCategoryKey: string) {
this.collapseState[groupCategoryKey] = !this.collapseState[groupCategoryKey];
- sessionStorage.setItem('sidebar.accordion.collapseState.' + this.storageId + '.byCourse.' + this.courseId, JSON.stringify(this.collapseState));
+ localStorage.setItem('sidebar.accordion.collapseState.' + this.storageId + '.byCourse.' + this.courseId, JSON.stringify(this.collapseState));
}
}
diff --git a/src/main/webapp/app/shared/sidebar/sidebar.component.html b/src/main/webapp/app/shared/sidebar/sidebar.component.html
index d972ad363a29..becdd0a69eda 100644
--- a/src/main/webapp/app/shared/sidebar/sidebar.component.html
+++ b/src/main/webapp/app/shared/sidebar/sidebar.component.html
@@ -79,6 +79,7 @@
[itemSelected]="itemSelected"
[showLeadingIcon]="sidebarData.showAccordionLeadingIcon ?? false"
[channelTypeIcon]="channelTypeIcon"
+ [sidebarItemAlwaysShow]="sidebarItemAlwaysShow()"
[collapseState]="collapseState"
(onUpdateSidebar)="onUpdateSidebar.emit()"
[isFilterActive]="isFilterActive"
diff --git a/src/main/webapp/app/shared/sidebar/sidebar.component.ts b/src/main/webapp/app/shared/sidebar/sidebar.component.ts
index ed42ca7c74af..92ecef01aa1a 100644
--- a/src/main/webapp/app/shared/sidebar/sidebar.component.ts
+++ b/src/main/webapp/app/shared/sidebar/sidebar.component.ts
@@ -3,7 +3,7 @@ import { faFilter, faFilterCircleXmark, faHashtag, faPlusCircle, faSearch, faUse
import { ActivatedRoute, Params } from '@angular/router';
import { Subscription, distinctUntilChanged } from 'rxjs';
import { ProfileService } from '../layouts/profiles/profile.service';
-import { ChannelAccordionShowAdd, ChannelTypeIcons, CollapseState, SidebarCardSize, SidebarData, SidebarTypes } from 'app/types/sidebar';
+import { ChannelAccordionShowAdd, ChannelTypeIcons, CollapseState, SidebarCardSize, SidebarData, SidebarItemShowAlways, SidebarTypes } from 'app/types/sidebar';
import { SidebarEventService } from './sidebar-event.service';
import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
import { cloneDeep } from 'lodash-es';
@@ -35,6 +35,7 @@ export class SidebarComponent implements OnDestroy, OnChanges, OnInit {
@Input() showAddOption?: ChannelAccordionShowAdd;
@Input() channelTypeIcon?: ChannelTypeIcons;
@Input() collapseState: CollapseState;
+ sidebarItemAlwaysShow = input.required();
@Input() showFilter: boolean = false;
inCommunication = input(false);
searchValue = '';
diff --git a/src/main/webapp/app/types/sidebar.ts b/src/main/webapp/app/types/sidebar.ts
index 11575cf18592..6eed6d06cb40 100644
--- a/src/main/webapp/app/types/sidebar.ts
+++ b/src/main/webapp/app/types/sidebar.ts
@@ -25,6 +25,9 @@ export type CollapseState = {
} & (Record | Record | Record | Record);
export type ChannelAccordionShowAdd = Record;
export type ChannelTypeIcons = Record;
+export type SidebarItemShowAlways = {
+ [key: string]: boolean;
+} & (Record | Record | Record | Record);
export interface SidebarData {
groupByCategory: boolean;
diff --git a/src/test/javascript/spec/component/shared/sidebar/sidebar-accordion.component.spec.ts b/src/test/javascript/spec/component/shared/sidebar/sidebar-accordion.component.spec.ts
index 39d8e23eb473..9e7fe5427253 100644
--- a/src/test/javascript/spec/component/shared/sidebar/sidebar-accordion.component.spec.ts
+++ b/src/test/javascript/spec/component/shared/sidebar/sidebar-accordion.component.spec.ts
@@ -53,6 +53,7 @@ describe('SidebarAccordionComponent', () => {
};
component.routeParams = { exerciseId: 3 };
component.collapseState = { current: false, dueSoon: false, past: false, future: true, noDate: true };
+ fixture.componentRef.setInput('sidebarItemAlwaysShow', { current: false, dueSoon: false, past: false, future: false, noDate: false });
fixture.detectChanges();
});