Skip to content

Commit

Permalink
Add first prototype for checkbox fer terms and privacy policy
Browse files Browse the repository at this point in the history
Signed-off-by: anonym-HPI <68286419+anonym-HPI@users.noreply.github.com>
  • Loading branch information
anonym-HPI committed Nov 17, 2023
1 parent e6be4d1 commit 6d7764a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@ <h4 class="modal-title">Übung {{ exerciseId }} beitreten</h4>
[maxlength]="255"
type="text"
/>
<br />
<input
[ngModel]="agreedToTermsAndPrivacyPolicy"
(ngModelChange)="toggleAgreedToTermsAndPrivacyPolicy($event)"
class="form-check-input"
type="checkbox"
data-cy="joinExerciseModalButton"
/>
<p>
Ich stimme den Nutzungsbedingungen und der Datenschutzerklärung zu.
</p>
</div>
<br />

<button
[disabled]="!agreedToTermsAndPrivacyPolicy"
(click)="joinExercise()"
class="btn btn-primary"
data-cy="joinExerciseModalButton"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { ApplicationService } from 'src/app/core/application.service';
export class JoinExerciseModalComponent implements OnDestroy {
public exerciseId!: string;
public clientName = '';
public agreedToTermsAndPrivacyPolicy = false;
/**
* Emits true when the exercise was successfully joined.
* If it completes without emitting a value or emits false, the exercise couldn't be joined.
Expand All @@ -23,6 +24,10 @@ export class JoinExerciseModalComponent implements OnDestroy {
private readonly activeModal: NgbActiveModal
) {}

public toggleAgreedToTermsAndPrivacyPolicy(event: boolean) {
this.agreedToTermsAndPrivacyPolicy = event;
}

public async joinExercise() {
const successfullyJoined = await this.applicationService.joinExercise(
this.exerciseId,
Expand Down

0 comments on commit 6d7764a

Please sign in to comment.