Skip to content

Commit

Permalink
work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangroese committed Jul 20, 2024
1 parent fe8c160 commit d14530e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
<h3 style="text-align: center" class="appointment-title">
{{ appointment.name }} - {{ appointment.startTime | date : 'dd.MM.yy' : 'locale(de)' }}
</h3>
<button
[label]="getSendNotificationLabel()"
[pTooltip]="'appointments.SEND_NOTIFICATION_TOOLTIP' | translate"
*ngIf="!isNew && formGroup.pristine"
(click)="onSendNotification($event)"
pButton
class="p-button-outlined p-button-secondary p-mr-3"
type="button"
icon="pi pi-envelope"
></button>
<p-steps [(activeIndex)]="activeIndex" [model]="items" [readonly]="false" (activeIndexChange)="onActiveIndexChange($event)"></p-steps>
<div [ngSwitch]="activeIndex">
<ng-container *ngSwitchCase="0">
Expand Down Expand Up @@ -177,7 +187,7 @@ <h3 style="text-align: center" class="appointment-title">
class="p-mr-3"
></button>
<button
[label]="'appointments.SEND_NOTIFICATION' | translate"
[label]="getSendNotificationLabel()"
[pTooltip]="'appointments.SEND_NOTIFICATION_TOOLTIP' | translate"
*ngIf="!isNew && formGroup.pristine"
(click)="onSendNotification($event)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ export class EditAppointmentComponent implements OnInit {

participationTableItems: ParticipationTableItem[] = [];
columns: any[] = [];
filteredDataCount: number;
filteredDataCount: number = 0;
totalParticipationCount: number = 0;

constructor(
public ref: DynamicDialogRef,
Expand Down Expand Up @@ -212,9 +213,19 @@ export class EditAppointmentComponent implements OnInit {
this.venueOptions = this.venues?.map((v) => this.mapVenueToSelectItem(v));
this.setRooms(this.appointment.venueId);
this.ready = true;

// Check if appointment.participations is loaded
console.log('Appointment Participations:', this.appointment.participations);

Check warning on line 218 in src/app/features/appointments/edit-appointment/edit-appointment.component.ts

View workflow job for this annotation

GitHub Actions / build (18.17.x)

Unexpected console statement

// Calculate totalParticipationCount
this.calculateTotalParticipationCount();
});
}

private calculateTotalParticipationCount() {
this.totalParticipationCount = this.appointment.participations?.length || 0;
}

onSubmit(continueToNextStep: boolean): void {
if (this.formGroup.invalid || this.formGroup.pristine) {
return;
Expand Down Expand Up @@ -272,6 +283,10 @@ export class EditAppointmentComponent implements OnInit {

this.mapParticipations();
this.ready = true;

this.calculateTotalParticipationCount();
// Check if appointment.participations is loaded
console.log('Appointment Participations:', this.appointment.participations);

Check warning on line 289 in src/app/features/appointments/edit-appointment/edit-appointment.component.ts

View workflow job for this annotation

GitHub Actions / build (18.17.x)

Unexpected console statement
}
},
() => (this.ready = true)
Expand Down Expand Up @@ -453,7 +468,7 @@ export class EditAppointmentComponent implements OnInit {
}

onTableFiltered(event: any): void {
this.filteredDataCount = event.filteredValue.length;
this.filteredDataCount = event.filteredValue ? event.filteredValue.length : 0;
}

onResultChanged(item: ParticipationTableItem, event: any): void {
Expand Down Expand Up @@ -627,4 +642,9 @@ export class EditAppointmentComponent implements OnInit {
},
});
}
getSendNotificationLabel(): string {
return `${this.translate.instant('appointments.SEND_NOTIFICATION')} (${this.totalParticipationCount}) (${this.translate.instant(
'appointments.PARTICIPANTS'
)})`;
}
}

0 comments on commit d14530e

Please sign in to comment.