Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit c254dee

Browse files
committed
Did some qol
1 parent f77a618 commit c254dee

6 files changed

Lines changed: 17 additions & 2 deletions

File tree

EEDU-Frontend/src/app/common/selection-input/selection-input.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
[(ngModel)]="currentValue"
3636
[placeholder]="placeholder()"
3737
[matAutocomplete]="complete"
38+
[disabled]="accessibleValues().length == 1"
3839
(blur)="onTouched()"
3940
/>
4041
}

EEDU-Frontend/src/app/user/authentication/credentials/credential-password/credential-password-verify-form/credential-password-verify-form.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class CredentialPasswordVerifyFormComponent extends AbstractCredentialVer
4040

4141
protected override errorMessage(error: number): string {
4242

43-
if (error == 403) {
43+
if (error == 401) {
4444
return 'Either the username or the password is incorrect.'
4545
}
4646
return super.errorMessage(error);

EEDU-Frontend/src/app/user/courses/classroom/create-class-room-dialog/create-class-room-dialog.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
<general-selection-input
2020
[values]="teacher"
21+
[disabled]="teacher.length === 1"
2122
formControlName="tutor"
2223
label="Select Tutor"
2324
placeholder="Enter the tutor you wish to set for this class">

EEDU-Frontend/src/app/user/courses/classroom/create-class-room-dialog/create-class-room-dialog.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,14 @@ export class CreateClassRoomDialogComponent extends AbstractCreateEntity {
3737
) {
3838
super(service, dialogRef, formBuilder, "Create Classroom");
3939

40-
userService.fetchAll.subscribe((user: UserModel[]): void => { this._users = user; });
40+
userService.fetchAll.subscribe((user: UserModel[]): void => {
41+
this._users = user;
42+
const tutor: readonly UserModel[] = this.teacher;
43+
if(tutor.length === 1)
44+
{
45+
this.form.get('tutor')?.setValue(tutor[0]);
46+
}
47+
});
4148
this._courseService.ownCourses$.subscribe((course: CourseModel[]): void => { this._courses = course; });
4249
}
4350

EEDU-Frontend/src/app/user/courses/create-course-dialog/create-course-dialog.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
<general-selection-input
2525
[values]="teacher"
26+
[disabled]="teacher.length === 1"
2627
formControlName="teacher"
2728
label="Teacher">
2829
</general-selection-input>

EEDU-Frontend/src/app/user/courses/create-course-dialog/create-course-dialog.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ export class CreateCourseDialogComponent extends AbstractCreateEntity {
3434

3535
this._userService.fetchAllReduced.subscribe((users: ReducedUserModel[]): void => {
3636
this._users = users;
37+
const teacher: readonly ReducedUserModel[] = this.teacher;
38+
if(teacher.length === 1)
39+
{
40+
this.form.get('teacher')?.setValue(teacher[0]);
41+
}
3742
});
3843

3944
this.subjects = this._subjectService.value;

0 commit comments

Comments
 (0)