Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lectures: Replace guided mode with status bar edit and create view #9655

Merged
merged 146 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from 144 commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
dc9acd1
Adhere to standard structure in lecture-update.component.ts
florian-glombik Nov 2, 2024
9474b66
Refactor existing component
florian-glombik Nov 2, 2024
1c46b24
Icons needed for test
florian-glombik Nov 2, 2024
504db17
Refactor comment to renamed method
florian-glombik Nov 2, 2024
8292a58
Start adding the status bar
florian-glombik Nov 2, 2024
f3e8b14
Introduce more signals, mark non signals as deprecated
florian-glombik Nov 2, 2024
52bf471
Fix error by adding titleChannelNameComponent child
florian-glombik Nov 2, 2024
2e1a07f
Make all information available on one page (no course set not handled…
florian-glombik Nov 2, 2024
e444f19
Introducing more signals
florian-glombik Nov 2, 2024
91be135
Retrieving form valid from video unit form and get rid of method call…
florian-glombik Nov 2, 2024
166ee38
Retrieving form valid from online unit form and get rid of method cal…
florian-glombik Nov 2, 2024
8ddbd9e
Retrieving form valid from attachment unit form and get rid of method…
florian-glombik Nov 2, 2024
4066e34
Forward unit valid state to status bar
florian-glombik Nov 2, 2024
7f5d8a9
Fixing accessing signals
florian-glombik Nov 2, 2024
35e4778
Fixing statusbar state for units when no unit dialog is open
florian-glombik Nov 2, 2024
b4617c5
Add note for needed changes in lecture-update.component.html
florian-glombik Nov 2, 2024
6998fbd
Use signal instead of subscription
florian-glombik Nov 2, 2024
9b20757
Use signal instead of subscription: video-unit-form.component.ts
florian-glombik Nov 2, 2024
30e6d2d
Use signal instead of subscription: online-unit-form.component.ts
florian-glombik Nov 2, 2024
6671e52
Use signal instead of subscription: attachment-unit-form.component.ts
florian-glombik Nov 2, 2024
e066a2a
Use signals in datepicker
florian-glombik Nov 2, 2024
50ba4c2
Finally using signals in datepicker
florian-glombik Nov 2, 2024
ebce6d5
Fix StatusBar computation of period value
florian-glombik Nov 2, 2024
289b79f
Add comment on adjustment within edit mode
florian-glombik Nov 2, 2024
80862a8
Fix signal call
florian-glombik Nov 6, 2024
3f77061
Make links clickable
florian-glombik Nov 6, 2024
c638460
Use signals for date-time-picker.component.ts
florian-glombik Nov 6, 2024
026a570
Introduce signal for easy retrieval of valid state
florian-glombik Nov 6, 2024
9b954b2
Fix tests for date-time-picker.component.ts
florian-glombik Nov 6, 2024
c9ca46b
Merge remote-tracking branch 'origin/develop' into develop
florian-glombik Nov 8, 2024
956d4e0
Merge branch 'develop' into feature/lectures/add-status-bar
florian-glombik Nov 8, 2024
7848fc5
Place import at same place as before merge to reduce diff
florian-glombik Nov 8, 2024
ad22a0c
Merge remote-tracking branch 'origin/develop' into develop
florian-glombik Nov 8, 2024
3644f68
Merge branch 'develop' into feature/lectures/add-status-bar
florian-glombik Nov 8, 2024
ba2851e
Undo renaming to reduce the potential of merge conflicts and minimize…
florian-glombik Nov 8, 2024
c5f7164
Fix inconsistency of naming in client test description
florian-glombik Nov 8, 2024
d4e13af
Merge branch 'develop' into feature/lectures/add-status-bar
florian-glombik Nov 10, 2024
cce1353
Add section titles and display all steps
florian-glombik Nov 10, 2024
0c08b38
Display all sections
florian-glombik Nov 10, 2024
d525213
Consider date validation in text unit form
florian-glombik Nov 10, 2024
84797cc
Consider date for validity changes
florian-glombik Nov 10, 2024
6c06ff4
Change title based on editing / creating lecture
florian-glombik Nov 10, 2024
2ad54cf
Fix code smell
florian-glombik Nov 10, 2024
2859b69
Fix attachment creation for new lecture
florian-glombik Nov 10, 2024
0f3f54f
Use signal for lecture
florian-glombik Nov 10, 2024
d5b5dd0
Fix attachments within lecture create view
florian-glombik Nov 10, 2024
261b058
Fix console errors
florian-glombik Nov 10, 2024
1a2fe16
Delete lecture on cancel in create mode
florian-glombik Nov 10, 2024
1f7d0b7
Do not display alert when deleting lecture in the background
florian-glombik Nov 10, 2024
8bd8bef
Wait with navigation back to ensure the old lecture is not displayed …
florian-glombik Nov 10, 2024
5ced798
Fix error alert when cancelling the lecture creation
florian-glombik Nov 10, 2024
6b0f8d9
Make sure autogenerated lecture is deleted
florian-glombik Nov 10, 2024
ad394c4
Delete auto generateed lecture
florian-glombik Nov 11, 2024
b3ecf88
Fix lecture unit creation
florian-glombik Nov 11, 2024
efd39e7
Revert changes for auto creating lecture in the background
florian-glombik Nov 20, 2024
3cf28e9
Merge branch 'develop' into feature/lectures/add-status-bar
florian-glombik Nov 20, 2024
f6b54d0
Remove event bus service
florian-glombik Nov 20, 2024
2b3346d
Remove guided mode
florian-glombik Nov 20, 2024
321e7ba
Merge branch 'develop' into feature/lectures/add-status-bar
florian-glombik Nov 25, 2024
6898439
Fix build errors and remove unused component
florian-glombik Nov 25, 2024
ce8b364
Share current state
florian-glombik Nov 26, 2024
d062f0d
On create stay on edit page
florian-glombik Nov 26, 2024
4f7727a
Move the buttons up
florian-glombik Nov 26, 2024
1d32e8b
Scroll to bottom section if lecture is created anew
florian-glombik Nov 26, 2024
bcb180f
Leave TODO
florian-glombik Nov 26, 2024
75e835c
Use a signal in lecture-attachments.component.ts to check whether the…
florian-glombik Nov 27, 2024
eeeb5c1
Revert not needed signal changes
florian-glombik Nov 28, 2024
5654797
Merge attachment name and link
florian-glombik Nov 28, 2024
7a935a6
Fix updating attachment name
florian-glombik Nov 28, 2024
33336de
Use signals for form validation
florian-glombik Nov 28, 2024
e5e8603
Fix tests
florian-glombik Nov 28, 2024
75161cf
Fix tests
florian-glombik Nov 28, 2024
29e12d7
Set notification text
florian-glombik Nov 28, 2024
df1b600
Fix attachments section valid status
florian-glombik Nov 28, 2024
09bad0f
Make attachment section valid if no dialog open
florian-glombik Nov 28, 2024
8b4d0cf
Move lecture to general info
florian-glombik Nov 28, 2024
edc1f27
Disable save button if no changes have been made to title or period s…
florian-glombik Nov 28, 2024
0e04cdd
Enable save button if description was updated
florian-glombik Nov 28, 2024
4b52b4b
Enable save button if date was modified
florian-glombik Nov 28, 2024
4403d25
Unsubscribe on destroy
florian-glombik Nov 28, 2024
2f273da
Add a warning when leaving the page with unsaved changes
florian-glombik Nov 28, 2024
b0f8c4b
Merge branch 'develop' into feature/lectures/add-status-bar
florian-glombik Dec 2, 2024
f519c56
Add modal for closing lecture with unsaved changes
florian-glombik Dec 3, 2024
3dd5ee2
Open modal when unsaved changes to title or period section
florian-glombik Dec 5, 2024
5d66c23
Do not show warning modal when cancel is used
florian-glombik Dec 5, 2024
a0eb465
Pass the information which section contains unsaved changes
florian-glombik Dec 5, 2024
2eeb3c8
Add translations for unsaved changes
florian-glombik Dec 5, 2024
8d4224f
Disable save if attachments / units section is invalid (and therefore…
florian-glombik Dec 5, 2024
55897be
Fix tests
florian-glombik Dec 5, 2024
852e3ca
Fix tests (by adding imports)
florian-glombik Dec 6, 2024
033b00f
Mock more components in tests
florian-glombik Dec 6, 2024
aa1597d
Merge branch 'develop' into feature/lectures/add-status-bar
florian-glombik Dec 6, 2024
af98ddb
Fix client test pre build
florian-glombik Dec 6, 2024
21ec64f
Merge branch 'develop' into feature/lectures/add-status-bar
florian-glombik Dec 13, 2024
d774475
Fix client test
florian-glombik Dec 13, 2024
e370861
Fix client test
florian-glombik Dec 13, 2024
b673ada
Remove unused component
florian-glombik Dec 13, 2024
a1970b5
Remove unused wizard attachment component
florian-glombik Dec 13, 2024
c7aecf2
Rename lecture-units.component.ts (get rid of outdated "wizard" descr…
florian-glombik Dec 13, 2024
73ab801
Adjust folder structure, remove duplicated code and move code to lect…
florian-glombik Dec 13, 2024
223642b
Fix lecture update test
florian-glombik Dec 13, 2024
651b4e3
Fix dismiss warning popping up on save
florian-glombik Dec 13, 2024
b4f6c23
Fix client tests
florian-glombik Dec 14, 2024
afde01e
Remove unused translations
florian-glombik Dec 14, 2024
b4fd92c
Fix pre-build
florian-glombik Dec 14, 2024
857b4e1
Remove unused translations
florian-glombik Dec 14, 2024
7aa82c2
Fix typo
florian-glombik Dec 14, 2024
2c7091a
Remove TODO as discussed with Stephan and Ramona
florian-glombik Dec 14, 2024
5a7a867
Remove unused variable
florian-glombik Dec 14, 2024
cf9114b
Remove unused variable, method, and import
florian-glombik Dec 14, 2024
1184dcc
Use inject instead of constructor
florian-glombik Dec 14, 2024
414377a
Remove should have back button to wizard code
florian-glombik Dec 14, 2024
79ad78e
Fix typo
florian-glombik Dec 14, 2024
7ea1e8d
Re-add accidentally removed canActivate
florian-glombik Dec 14, 2024
d062694
Merge develop
florian-glombik Dec 18, 2024
78d9e36
Remove unused files and rename folder
florian-glombik Dec 18, 2024
17c0c26
Reduce diff and fix client test
florian-glombik Dec 18, 2024
bf71fa1
Remove should initialize test
florian-glombik Dec 18, 2024
ea760c1
Remove empty files
florian-glombik Dec 18, 2024
4bad53f
Reduce diff from imports
florian-glombik Dec 18, 2024
f02aa1d
Reduce diff from imports
florian-glombik Dec 18, 2024
01ba04c
Reduce diff from imports
florian-glombik Dec 18, 2024
a1f4505
Disable save button if no changes to title or description have been made
florian-glombik Dec 18, 2024
c295874
Make constructor easier to read
florian-glombik Dec 18, 2024
ee94d3a
Fix e2e test
florian-glombik Dec 20, 2024
526326e
Address Ramonas feedback
florian-glombik Dec 20, 2024
bae23ff
Address Ramonas feedback (translations)
florian-glombik Dec 20, 2024
8cae9b8
Add tests for updateFormStatusBar
florian-glombik Dec 20, 2024
0b2377b
Merge branch 'develop' into feature/lectures/add-status-bar
florian-glombik Dec 20, 2024
ae76d07
Fix typo in translation key
florian-glombik Dec 20, 2024
638d5d5
Add some spacing before units section
florian-glombik Dec 20, 2024
1f6a252
Merge branch 'develop' into feature/lectures/add-status-bar
florian-glombik Dec 21, 2024
1d6a4e3
Merge branch 'develop' into feature/lectures/add-status-bar
florian-glombik Dec 21, 2024
0430c36
Merge branch 'develop' into feature/lectures/add-status-bar
florian-glombik Dec 22, 2024
12b32d0
Address Ramonas review
florian-glombik Dec 23, 2024
fd3456c
Address Ramonas review
florian-glombik Dec 23, 2024
fb261b8
Address Ramonas review (h1 vs h2)
florian-glombik Dec 23, 2024
4590b28
Merge branch 'develop' into feature/lectures/add-status-bar
florian-glombik Dec 23, 2024
3610375
Remove non-null assertion
florian-glombik Dec 23, 2024
8f58165
Bump coverage
florian-glombik Dec 23, 2024
e734757
Merge branch 'develop' into feature/lectures/add-status-bar
florian-glombik Dec 26, 2024
76abc4e
Merge branch 'develop' into feature/lectures/add-status-bar
florian-glombik Dec 27, 2024
4547d2a
Merge branch 'develop' into feature/lectures/add-status-bar
florian-glombik Jan 2, 2025
d17ecf7
Merge branch 'develop' into feature/lectures/add-status-bar
krusche Jan 5, 2025
03b06d3
Merge branch 'develop' into feature/lectures/add-status-bar
krusche Jan 5, 2025
7166be6
adapt coverage
krusche Jan 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/main/webapp/app/entities/attachment.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@ export class Attachment implements BaseEntity {
lecture?: Lecture;
exercise?: Exercise;
attachmentUnit?: AttachmentUnit;

constructor() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ <h4 class="modal-title" jhiTranslate="artemisApp.lecture.dismissChangesModal.tit
<ul>
@if (hasUnsavedChangesInTitleSection) {
<li>
<span jhiTranslate="artemisApp.lecture.wizardMode.steps.titleStepTitle"></span>
<span jhiTranslate="artemisApp.lecture.sections.title"></span>
</li>
}
@if (hasUnsavedChangesInPeriodSection) {
<li>
<span jhiTranslate="artemisApp.lecture.wizardMode.steps.periodStepTitle"></span>
<span jhiTranslate="artemisApp.lecture.sections.period"></span>
</li>
}
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { CanDeactivateFn } from '@angular/router';
import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
import { LectureUpdateComponent } from 'app/lecture/lecture-update.component';
import { Observable, from, of } from 'rxjs';
import { CloseEditLectureModalComponent } from 'app/lecture/close-edit-lecture-dialog/close-edit-lecture-modal.component';
import { CloseEditLectureModalComponent } from 'app/lecture/close-edit-lecture-modal/close-edit-lecture-modal.component';

export const hasLectureUnsavedChangesGuard: CanDeactivateFn<LectureUpdateComponent> = (component: LectureUpdateComponent): Observable<boolean> => {
if (!component.shouldDisplayDismissWarning || component.isShowingWizardMode) {
if (!component.shouldDisplayDismissWarning) {
return of(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ export class LectureAttachmentsComponent implements OnDestroy {
});

private readonly statusChanges = toSignal(this.form.statusChanges ?? 'INVALID');
isFormValid = computed(() => this.statusChanges() === 'VALID' && this.isFileSelectionValid() && this.datePickerComponent()?.isValid());
isFormValid = computed(
() => !this.attachmentToBeUpdatedOrCreated() || (this.statusChanges() === 'VALID' && this.isFileSelectionValid() && this.datePickerComponent()?.isValid()),
);

constructor() {
effect(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div>
<h2 id="artemisApp.lecture.wizardMode.steps.periodStepTitle"><span jhiTranslate="artemisApp.lecture.wizardMode.steps.periodStepTitle"></span></h2>
<p><span jhiTranslate="artemisApp.lecture.wizardMode.steps.periodStepMessage"></span></p>
<h3 id="artemisApp.lecture.sections.period"><span jhiTranslate="artemisApp.lecture.sections.period"></span></h3>
<p><span jhiTranslate="artemisApp.lecture.sections.periodDescription"></span></p>
<div class="d-flex">
<div class="form-group flex-grow-1">
<jhi-date-time-picker
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core';
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
import { Lecture } from 'app/entities/lecture.model';
import { LectureService } from 'app/lecture/lecture.service';
Expand All @@ -24,6 +24,25 @@ import { IrisSettingsService } from 'app/iris/settings/shared/iris-settings.serv
styleUrls: ['./lecture-unit-management.component.scss'],
})
export class LectureUnitManagementComponent implements OnInit, OnDestroy {
protected readonly faTrash = faTrash;
protected readonly faPencilAlt = faPencilAlt;
protected readonly faEye = faEye;
protected readonly faFileExport = faFileExport;
protected readonly faRepeat = faRepeat;
protected readonly faCheckCircle = faCheckCircle;
protected readonly faSpinner = faSpinner;

protected readonly LectureUnitType = LectureUnitType;
protected readonly ActionType = ActionType;

private readonly activatedRoute = inject(ActivatedRoute);
private readonly router = inject(Router);
private readonly lectureService = inject(LectureService);
private readonly alertService = inject(AlertService);
private readonly profileService = inject(ProfileService);
private readonly irisSettingsService = inject(IrisSettingsService);
protected readonly lectureUnitService = inject(LectureUnitService);

@Input() showCreationCard = true;
@Input() showCompetencies = true;
@Input() emitEditEvents = false;
Expand All @@ -39,14 +58,13 @@ export class LectureUnitManagementComponent implements OnInit, OnDestroy {
updateOrderSubject: Subject<any>;
viewButtonAvailable: Record<number, boolean> = {};

updateOrderSubjectSubscription: Subscription;
navigationEndSubscription: Subscription;
private updateOrderSubjectSubscription: Subscription;
private navigationEndSubscription: Subscription;
private activatedRouteSubscription?: Subscription;
private profileInfoSubscription: Subscription;

readonly LectureUnitType = LectureUnitType;
readonly ActionType = ActionType;
private dialogErrorSource = new Subject<string>();
dialogError$ = this.dialogErrorSource.asObservable();
private profileInfoSubscription: Subscription;
irisEnabled = false;
lectureIngestionEnabled = false;
routerEditLinksBase: { [key: string]: string } = {
Expand All @@ -56,40 +74,13 @@ export class LectureUnitManagementComponent implements OnInit, OnDestroy {
[LectureUnitType.ONLINE]: 'online-units',
};

// Icons
readonly faTrash = faTrash;
readonly faPencilAlt = faPencilAlt;
readonly faEye = faEye;
readonly faFileExport = faFileExport;
readonly faRepeat = faRepeat;
readonly faCheckCircle = faCheckCircle;
readonly faSpinner = faSpinner;

constructor(
private activatedRoute: ActivatedRoute,
private router: Router,
private lectureService: LectureService,
private alertService: AlertService,
public lectureUnitService: LectureUnitService,
private profileService: ProfileService,
private irisSettingsService: IrisSettingsService,
) {}

ngOnDestroy(): void {
this.updateOrder();
this.updateOrderSubjectSubscription.unsubscribe();
this.dialogErrorSource.unsubscribe();
this.navigationEndSubscription.unsubscribe();
this.profileInfoSubscription?.unsubscribe();
}

ngOnInit(): void {
this.navigationEndSubscription = this.router.events.pipe(filter((value) => value instanceof NavigationEnd)).subscribe(() => {
this.loadData();
});

this.updateOrderSubject = new Subject();
this.activatedRoute.parent!.params.subscribe((params) => {
this.activatedRouteSubscription = this.activatedRoute?.parent?.params.subscribe((params) => {
this.lectureId ??= +params['lectureId'];
if (this.lectureId) {
// TODO: the lecture (without units) is already available through the lecture.route.ts resolver, it's not really good that we load it twice
Expand All @@ -103,6 +94,15 @@ export class LectureUnitManagementComponent implements OnInit, OnDestroy {
});
}

ngOnDestroy(): void {
this.updateOrder();
this.updateOrderSubjectSubscription.unsubscribe();
this.dialogErrorSource.unsubscribe();
this.navigationEndSubscription.unsubscribe();
this.profileInfoSubscription?.unsubscribe();
this.activatedRouteSubscription?.unsubscribe();
}

loadData() {
this.isLoading = true;
// TODO: we actually would like to have the lecture with all units! Posts and competencies are not required here
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div>
<h2><span jhiTranslate="artemisApp.lecture.wizardMode.steps.unitsStepTitle"></span></h2>
<p><span jhiTranslate="artemisApp.lecture.wizardMode.steps.unitsStepMessage"></span></p>
<h3><span jhiTranslate="artemisApp.lecture.sections.units"></span></h3>
<p><span jhiTranslate="artemisApp.lecture.sections.unitsDescription"></span></p>
<jhi-lecture-unit-management
[lectureId]="this.lecture.id"
[emitEditEvents]="true"
Expand All @@ -15,9 +15,9 @@ <h2><span jhiTranslate="artemisApp.lecture.wizardMode.steps.unitsStepTitle"></sp
} @else {
<div class="form-group">
@if (!isEditingLectureUnit) {
<h4><span jhiTranslate="artemisApp.lecture.wizardMode.newLectureUnit"></span></h4>
<h4><span jhiTranslate="artemisApp.lecture.newLectureUnit"></span></h4>
} @else {
<h4><span jhiTranslate="artemisApp.lecture.wizardMode.editLectureUnit"></span></h4>
<h4><span jhiTranslate="artemisApp.lecture.editLectureUnit"></span></h4>
}
@if (isTextUnitFormOpen()) {
<jhi-text-unit-form
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Component, Input, OnInit, ViewChild, computed, signal } from '@angular/core';
import { Component, Input, OnInit, ViewChild, computed, signal, viewChild } from '@angular/core';
import { Lecture } from 'app/entities/lecture.model';
import { TextUnit } from 'app/entities/lecture-unit/textUnit.model';
import { VideoUnit } from 'app/entities/lecture-unit/videoUnit.model';
import { OnlineUnit } from 'app/entities/lecture-unit/onlineUnit.model';
import { AttachmentUnit } from 'app/entities/lecture-unit/attachmentUnit.model';
import { TextUnitFormData } from 'app/lecture/lecture-unit/lecture-unit-management/text-unit-form/text-unit-form.component';
import { VideoUnitFormData } from 'app/lecture/lecture-unit/lecture-unit-management/video-unit-form/video-unit-form.component';
import { OnlineUnitFormData } from 'app/lecture/lecture-unit/lecture-unit-management/online-unit-form/online-unit-form.component';
import { AttachmentUnitFormData } from 'app/lecture/lecture-unit/lecture-unit-management/attachment-unit-form/attachment-unit-form.component';
import { TextUnitFormComponent, TextUnitFormData } from 'app/lecture/lecture-unit/lecture-unit-management/text-unit-form/text-unit-form.component';
import { VideoUnitFormComponent, VideoUnitFormData } from 'app/lecture/lecture-unit/lecture-unit-management/video-unit-form/video-unit-form.component';
import { OnlineUnitFormComponent, OnlineUnitFormData } from 'app/lecture/lecture-unit/lecture-unit-management/online-unit-form/online-unit-form.component';
import { AttachmentUnitFormComponent, AttachmentUnitFormData } from 'app/lecture/lecture-unit/lecture-unit-management/attachment-unit-form/attachment-unit-form.component';
import { LectureUnit, LectureUnitType } from 'app/entities/lecture-unit/lectureUnit.model';
import { onError } from 'app/shared/util/global.utils';
import { Attachment, AttachmentType } from 'app/entities/attachment.model';
Expand All @@ -23,15 +23,27 @@ import dayjs from 'dayjs/esm';
import { ActivatedRoute } from '@angular/router';

@Component({
selector: 'jhi-lecture-update-wizard-units',
templateUrl: './lecture-wizard-units.component.html',
selector: 'jhi-lecture-update-units',
templateUrl: './lecture-units.component.html',
})
export class LectureUpdateWizardUnitsComponent implements OnInit {
@Input() currentStep: number;
export class LectureUpdateUnitsComponent implements OnInit {
@Input() lecture: Lecture;

@ViewChild(LectureUnitManagementComponent, { static: false }) unitManagementComponent: LectureUnitManagementComponent;

textUnitForm = viewChild(TextUnitFormComponent);
videoUnitForm = viewChild(VideoUnitFormComponent);
onlineUnitForm = viewChild(OnlineUnitFormComponent);
attachmentUnitForm = viewChild(AttachmentUnitFormComponent);
isUnitConfigurationValid = computed(() => {
return (
(this.textUnitForm()?.isFormValid() || !this.isTextUnitFormOpen()) &&
(this.videoUnitForm()?.isFormValid() || !this.isVideoUnitFormOpen()) &&
(this.onlineUnitForm()?.isFormValid() || !this.isOnlineUnitFormOpen()) &&
(this.attachmentUnitForm()?.isFormValid() || !this.isAttachmentUnitFormOpen())
);
});

isEditingLectureUnit: boolean;
isTextUnitFormOpen = signal<boolean>(false);
isExerciseUnitFormOpen = signal<boolean>(false);
Expand Down
Loading
Loading