diff --git a/src/components/loading-indicator/loading-indicator.component.html b/src/components/loading-indicator/loading-indicator.component.html
new file mode 100644
index 0000000..87083ed
--- /dev/null
+++ b/src/components/loading-indicator/loading-indicator.component.html
@@ -0,0 +1,7 @@
+@if (loading) {
+
+} @else {
+
+}
diff --git a/src/components/loading-indicator/loading-indicator.component.ts b/src/components/loading-indicator/loading-indicator.component.ts
new file mode 100644
index 0000000..8ec20ad
--- /dev/null
+++ b/src/components/loading-indicator/loading-indicator.component.ts
@@ -0,0 +1,20 @@
+import {Component, EventEmitter, Input, Output} from '@angular/core';
+import {DataSpinnerComponent} from "@component/data-spinner/data-spinner.component";
+import {MatIcon} from "@angular/material/icon";
+import {MatButton, MatFabButton} from "@angular/material/button";
+
+@Component({
+ selector: 'app-loading-indicator',
+ standalone: true,
+ imports: [
+ DataSpinnerComponent,
+ MatButton,
+ MatIcon,
+ MatFabButton
+ ],
+ templateUrl: './loading-indicator.component.html'
+})
+export class LoadingIndicatorComponent {
+ @Input() loading: boolean = true;
+ @Output() retryFunction: EventEmitter = new EventEmitter();
+}
diff --git a/src/components/schedule-tabs/schedule-tabs-group/schedule-tabs-group.component.html b/src/components/schedule-tabs/schedule-tabs-group/schedule-tabs-group.component.html
index 7149905..c2d88b9 100644
--- a/src/components/schedule-tabs/schedule-tabs-group/schedule-tabs-group.component.html
+++ b/src/components/schedule-tabs/schedule-tabs-group/schedule-tabs-group.component.html
@@ -5,30 +5,31 @@
Факультет
-
+
@for (faculty of faculties | async; track $index) {
{{ faculty.name }}
} @empty {
-
+
}
-
+
Курс
-
+
@for (course of courseNumbers | async; track $index) {
{{ course }}
} @empty {
-
+
}
@@ -39,13 +40,14 @@
Группа
-
+
@for (group of filteredGroups | async; track $index) {
{{ group.name }}
} @empty {
-
+
}
diff --git a/src/components/schedule-tabs/schedule-tabs-group/schedule-tabs-group.component.ts b/src/components/schedule-tabs/schedule-tabs-group/schedule-tabs-group.component.ts
index 073e08d..6f4508d 100644
--- a/src/components/schedule-tabs/schedule-tabs-group/schedule-tabs-group.component.ts
+++ b/src/components/schedule-tabs/schedule-tabs-group/schedule-tabs-group.component.ts
@@ -1,29 +1,31 @@
import {Component, EventEmitter, Input, Output, ViewChild} from '@angular/core';
import {MatExpansionModule, MatExpansionPanel} from "@angular/material/expansion";
-import {DataSpinnerComponent} from "@component/data-spinner/data-spinner.component";
import {MatChipListboxChange, MatChipsModule} from '@angular/material/chips';
import {FormControl, ReactiveFormsModule} from "@angular/forms";
import {AsyncPipe} from "@angular/common";
import {map, Observable, of} from "rxjs";
import {FacultyResponse} from "@model/facultyResponse";
import {GroupResponse} from "@model/groupResponse";
+import {LoadingIndicatorComponent} from "@component/loading-indicator/loading-indicator.component";
@Component({
selector: 'app-schedule-tabs-group',
standalone: true,
imports: [
MatExpansionModule,
- DataSpinnerComponent,
MatChipsModule,
ReactiveFormsModule,
+ LoadingIndicatorComponent,
AsyncPipe
],
templateUrl: './schedule-tabs-group.component.html',
styleUrl: './schedule-tabs-group.component.css'
})
+
export class ScheduleTabsGroupComponent {
- protected facultiesId: number | null = null;
+ protected facultyId: number | null = null;
protected courseNumber: number | null = null;
+
protected filteredGroups: Observable = of([]);
protected courseNumbers: Observable = of([]);
protected groups: Observable = of([]);
@@ -35,8 +37,12 @@ export class ScheduleTabsGroupComponent {
@ViewChild('groupPanel') groupPanel!: MatExpansionPanel;
@Input() faculties: Observable = of([]);
+ @Input() facultiesLoaded: boolean | null = false;
+ @Output() facultiesLoadRetry: EventEmitter = new EventEmitter();
+ @Input() groupsLoaded: boolean | null = false;
+ @Output() groupsLoadRetry: EventEmitter = new EventEmitter();
- @Input() set groupsSet(data: Observable) {
+ @Input() set setGroups(data: Observable) {
this.groups = data;
this.courseNumbers = this.groups.pipe(
map(data => data.map(g => g.courseNumber)),
@@ -48,23 +54,23 @@ export class ScheduleTabsGroupComponent {
@Output() groupSelected = new EventEmitter();
@Output() facultySelected = new EventEmitter();
- protected selectedFaculty(event: MatChipListboxChange) {
+ protected chooseFaculty(event: MatChipListboxChange) {
this.courseNumber = null;
this.groups = of([]);
this.chipGroup.reset();
this.chipCourse.reset();
if (event.value === undefined || event.value === null) {
- this.facultiesId = null;
+ this.facultyId = null;
return;
}
- this.facultiesId = event.value;
+ this.facultyId = event.value;
this.courseNumberPanel.open();
- this.facultySelected.emit(this.facultiesId!);
+ this.facultySelected.emit(this.facultyId!);
}
- protected selectCourseNumber(event: MatChipListboxChange) {
+ protected chooseCourseNumber(event: MatChipListboxChange) {
this.filteredGroups = of([]);
this.chipGroup.reset();
@@ -79,7 +85,7 @@ export class ScheduleTabsGroupComponent {
this.filteredGroups = of(data.filter(g => g.courseNumber === this.courseNumber)));
}
- protected selectGroup(event: MatChipListboxChange) {
+ protected chooseGroup(event: MatChipListboxChange) {
if (event.value === undefined || event.value === null)
return;
diff --git a/src/components/schedule-tabs/schedule-tabs-lecture-hall/schedule-tabs-lecture-hall.component.html b/src/components/schedule-tabs/schedule-tabs-lecture-hall/schedule-tabs-lecture-hall.component.html
index c4a98d3..b132e17 100644
--- a/src/components/schedule-tabs/schedule-tabs-lecture-hall/schedule-tabs-lecture-hall.component.html
+++ b/src/components/schedule-tabs/schedule-tabs-lecture-hall/schedule-tabs-lecture-hall.component.html
@@ -5,13 +5,13 @@
Кампус
-
+
@for (campus of campuses | async; track $index) {
{{ campus.codeName }}
} @empty {
-
+
}
@@ -22,13 +22,13 @@
Кабинет
-
+
@for (lectureHall of lectureHalls | async; track $index) {
{{ lectureHall.name }}
} @empty {
-
+
}
diff --git a/src/components/schedule-tabs/schedule-tabs-lecture-hall/schedule-tabs-lecture-hall.component.ts b/src/components/schedule-tabs/schedule-tabs-lecture-hall/schedule-tabs-lecture-hall.component.ts
index 29eed08..3072c5a 100644
--- a/src/components/schedule-tabs/schedule-tabs-lecture-hall/schedule-tabs-lecture-hall.component.ts
+++ b/src/components/schedule-tabs/schedule-tabs-lecture-hall/schedule-tabs-lecture-hall.component.ts
@@ -1,23 +1,23 @@
import {Component, EventEmitter, Input, Output, ViewChild} from '@angular/core';
import {AsyncPipe} from "@angular/common";
-import {DataSpinnerComponent} from "@component/data-spinner/data-spinner.component";
import {MatAccordion, MatExpansionModule, MatExpansionPanel} from "@angular/material/expansion";
import {MatChipListboxChange, MatChipsModule} from "@angular/material/chips";
import {Observable, of} from "rxjs";
import {CampusBasicInfoResponse} from "@model/campusBasicInfoResponse";
import {FormControl, ReactiveFormsModule} from "@angular/forms";
import {LectureHallResponse} from "@model/lectureHallResponse";
+import {LoadingIndicatorComponent} from "@component/loading-indicator/loading-indicator.component";
@Component({
selector: 'app-schedule-tabs-lecture-hall',
standalone: true,
imports: [
MatChipsModule,
- DataSpinnerComponent,
MatExpansionModule,
AsyncPipe,
ReactiveFormsModule,
- MatAccordion
+ MatAccordion,
+ LoadingIndicatorComponent
],
templateUrl: './schedule-tabs-lecture-hall.component.html',
styleUrl: './schedule-tabs-lecture-hall.component.css'
@@ -29,12 +29,16 @@ export class ScheduleTabsLectureHallComponent {
@ViewChild('lecturePanel') lecturePanel!: MatExpansionPanel;
@Input() campuses: Observable = of([]);
+ @Input() campusesLoaded: boolean | null = false;
+ @Output() campusesLoadRetry: EventEmitter = new EventEmitter();
@Input() lectureHalls: Observable = of([]);
+ @Input() lectureHallsLoaded: boolean | null = false;
+ @Output() lectureHallsLoadRetry: EventEmitter = new EventEmitter();
@Output() campusSelected = new EventEmitter();
@Output() lectureHallSelected = new EventEmitter();
- protected selectedCampus(event: MatChipListboxChange) {
+ protected chooseCampus(event: MatChipListboxChange) {
this.chipLecture.reset();
if (event.value === undefined || event.value === null) {
@@ -49,7 +53,7 @@ export class ScheduleTabsLectureHallComponent {
this.campusSelected.emit(this.campusId!);
}
- protected selectedLectureHall(event: MatChipListboxChange) {
+ protected chooseLectureHall(event: MatChipListboxChange) {
if (event.value === undefined || event.value === null)
return;
diff --git a/src/components/schedule-tabs/schedule-tabs-other/schedule-tabs-other.component.html b/src/components/schedule-tabs/schedule-tabs-other/schedule-tabs-other.component.html
index a6e5bfc..9c7b0b5 100644
--- a/src/components/schedule-tabs/schedule-tabs-other/schedule-tabs-other.component.html
+++ b/src/components/schedule-tabs/schedule-tabs-other/schedule-tabs-other.component.html
@@ -1,31 +1,34 @@
-
+