Skip to content

Commit

Permalink
feat: #149 checking if user is a teacher during registration
Browse files Browse the repository at this point in the history
  • Loading branch information
pablitoo1 committed Nov 18, 2024
1 parent 26322d9 commit 03c2c60
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ describe('DataDownloadComponent', () => {
expect(component).toBeTruthy();
});

it('should toggle vIsDataCollectingActive on button click', () => {
const button = fixture.debugElement.query(By.css('button')).nativeElement;
button.click();
fixture.detectChanges();
});

it('should display "Start collecting data" when vIsDataCollectingActive is false', () => {
fixture.detectChanges();
const button = fixture.debugElement.query(By.css('button')).nativeElement;
Expand Down
116 changes: 60 additions & 56 deletions src/app/user-workflow/register/components/register-form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,70 +48,74 @@ import { CourseEndpointsService } from '@endpoints/course-endpoints.service';
formControlName="email"
placeholder="Type your email"
class="custom-input" />
<span class="w-full text-justify text-xs">
(domain &#64;stud.prz.edu.pl or &#64;prz.edu.pl)
</span>
</div>
<span class="w-full text-justify text-xs">
(as a teacher you don't need to enter the study cycle years, course and
group)
</span>
<div
class="flex flex-wrap flex-col sm:flex-row lg:flex-col xl:flex-row items-start space-y-4 sm:space-y-0 lg:space-y-4 xl:space-y-0 space-x-0 sm:space-x-2 lg:space-x-0 xl:space-x-2">
<div class="flex flex-col w-full sm:w-fit lg:w-full xl:w-fit">
@if (
registerForm.value.email &&
registerForm.value.email.endsWith('@stud.prz.edu.pl')
) {
<div
class="flex flex-wrap flex-col sm:flex-row lg:flex-col xl:flex-row items-start space-y-4 sm:space-y-0 lg:space-y-4 xl:space-y-0 space-x-0 sm:space-x-2 lg:space-x-0 xl:space-x-2">
<div class="flex flex-col w-full sm:w-fit lg:w-full xl:w-fit">
<label
for="studyCycleYearA"
[class.text-red-500]="shouldShowError('studyCycleYearA')"
>Study cycle year</label
>
<input
id="studyCycleYearA"
type="number"
formControlName="studyCycleYearA"
placeholder="Type year A"
class="custom-input"
(input)="validateNumber($event)" />
</div>
<div class="flex flex-col w-full sm:w-fit lg:w-full xl:w-fit">
<label
for="studyCycleYearB"
[class.text-red-500]="shouldShowError('studyCycleYearB')"
>Study cycle year</label
>
<input
id="studyCycleYearB"
type="number"
formControlName="studyCycleYearB"
placeholder="Type year B"
class="custom-input"
(input)="validateNumber($event)" />
</div>
</div>
<div class="flex flex-col space-y-1">
<label
for="studyCycleYearA"
[class.text-red-500]="shouldShowError('studyCycleYearA')"
>Study cycle year</label
for="courseId"
class="text-start"
[class.text-red-500]="shouldShowError('courseId')"
>Course</label
>
<input
id="studyCycleYearA"
type="number"
formControlName="studyCycleYearA"
placeholder="Type year A"
class="custom-input"
(input)="validateNumber($event)" />
<select formControlName="courseId" class="custom-input">
<option [ngValue]="null">No course choosen</option>
@for (course of courseList; track course.id) {
<option [ngValue]="course.id">{{ course.name }}</option>
}
</select>
</div>
<div class="flex flex-col w-full sm:w-fit lg:w-full xl:w-fit">
<div class="flex flex-col space-y-1">
<label
for="studyCycleYearB"
[class.text-red-500]="shouldShowError('studyCycleYearB')"
>Study cycle year</label
for="group"
class="text-start"
[class.text-red-500]="shouldShowError('group')"
>Group</label
>
<input
id="studyCycleYearB"
type="number"
formControlName="studyCycleYearB"
placeholder="Type year B"
class="custom-input"
(input)="validateNumber($event)" />
id="group"
type="text"
formControlName="group"
placeholder="Type your group"
class="custom-input" />
</div>
</div>
<div class="flex flex-col space-y-1">
<label
for="courseId"
class="text-start"
[class.text-red-500]="shouldShowError('courseId')"
>Course</label
>
<select formControlName="courseId" class="custom-input">
<option [ngValue]="null">No course choosen</option>
@for (course of courseList; track course.id) {
<option [ngValue]="course.id">{{ course.name }}</option>
}
</select>
</div>
<div class="flex flex-col space-y-1">
<label
for="group"
class="text-start"
[class.text-red-500]="shouldShowError('group')"
>Group</label
>
<input
id="group"
type="text"
formControlName="group"
placeholder="Type your group"
class="custom-input" />
</div>
}
<div class="flex flex-col space-y-1">
<label for="password" [class.text-red-500]="shouldShowError('password')"
>Password</label
Expand Down

0 comments on commit 03c2c60

Please sign in to comment.