Skip to content

Commit

Permalink
Merge pull request #109 from sinfo/add-check-to-activities
Browse files Browse the repository at this point in the history
fix: add activities check
  • Loading branch information
PMax5 authored Feb 25, 2024
2 parents 0b5abaa + 93ecfbd commit a4bf888
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,7 @@ <h5 style="margin-left: 5%;" [innerHTML]="'reservations.warning' | translate"></
<div class="btn-group-vertical" role="group">
<button class="btn btn-primary" type="button" (click)="makeReservation(confirmReservationPopup)"
[innerHTML]="'reservations.submit' | translate"
*ngIf="latestReservation
&& latestReservation.issued === undefined
&& (latestReservation.stands.length === credentials.participationDays || availability.venue.stands.length === 0 || latestReservation.stands === undefined)">Submit
reservation</button>
*ngIf="isReadyToSubmit()">Submit reservation</button>

<button *ngIf="showAllReservations" class="btn btn-primary" type="button"
(click)="alternateShowAllReservations()" [innerHTML]=" 'reservations.current' | translate">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,13 @@ export class CompanyReservationsComponent implements OnInit, OnDestroy {
act.isInArray(this.latestReservation.activities) && this.latestReservation.isConfirmed();
}

private isReadyToSubmit() {
return this.latestReservation
&& this.latestReservation.issued === undefined
&& this.credentials.activities.every(act => this.latestReservation.activities.find(e => act === e.kind) !== undefined)
&& (this.latestReservation.stands.length === this.credentials.participationDays || this.availability.venue.stands.length === 0 || this.latestReservation.stands === undefined);
}

private makeReservation(content) {
const contiguous: boolean = this.latestReservation.daysAreContiguous();
const same_stand: boolean = this.latestReservation.standIsSame();
Expand Down

0 comments on commit a4bf888

Please sign in to comment.