Skip to content

Commit

Permalink
revert checkbox for agreement as it seems to not be needed
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 18, 2023
1 parent e8bbb85 commit 0d183be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,14 @@ <h4 class="modal-title">Übung {{ exerciseId }} beitreten</h4>
type="text"
/>
<br />
<input
[ngModel]="agreedToTermsAndPrivacyPolicy"
(ngModelChange)="toggleAgreedToTermsAndPrivacyPolicy($event)"
class="form-check-input"
type="checkbox"
data-cy="joinExerciseModalButton"
/>
<p>
Ich stimme den
<a href="/about/terms" target="_blank">Nutzungsbedingungen</a> und
der
<a href="/about/privacy" target="_blank">Datenschutzerklärung</a>
zu.
</p>
Mit dem beitreten der Übung stimmen Sie den
<a href="/about/terms" target="_blank">Nutzungsbedingungen</a> und der
<a href="/about/privacy" target="_blank">Datenschutzerklärung</a>
zu.
</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 @@ -3,7 +3,6 @@ import { Component } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { Subject } from 'rxjs';
import { ApplicationService } from 'src/app/core/application.service';
import { MessageService } from 'src/app/core/messages/message.service';

@Component({
selector: 'app-join-exercise-modal',
Expand All @@ -13,7 +12,6 @@ import { MessageService } from 'src/app/core/messages/message.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 @@ -22,29 +20,16 @@ export class JoinExerciseModalComponent implements OnDestroy {

constructor(
private readonly applicationService: ApplicationService,
private readonly activeModal: NgbActiveModal,
private readonly messageService: MessageService
private readonly activeModal: NgbActiveModal
) {}

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

public async joinExercise() {
if (this.agreedToTermsAndPrivacyPolicy) {
const successfullyJoined =
await this.applicationService.joinExercise(
this.exerciseId,
this.clientName
);
this.exerciseJoined$.next(successfullyJoined);
this.activeModal.close();
} else {
this.messageService.postMessage({
title: 'Fehler: Bedinungen nicht zugestimmt',
color: 'warning',
});
}
const successfullyJoined = await this.applicationService.joinExercise(
this.exerciseId,
this.clientName
);
this.exerciseJoined$.next(successfullyJoined);
this.activeModal.close();
}

public close() {
Expand Down

0 comments on commit 0d183be

Please sign in to comment.