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 f458635 commit c31a0d2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,21 @@ <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 @@ -36,6 +37,10 @@ export class JoinExerciseModalComponent implements OnDestroy {
this.activeModal.close();
}

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

ngOnDestroy() {
this.exerciseJoined$.complete();
}
Expand Down

0 comments on commit c31a0d2

Please sign in to comment.