|
|
@@ -6,6 +6,13 @@ import { Registration } from '../registration';
|
|
|
import { AuthService } from '@auth0/auth0-angular';
|
|
|
import { combineLatest, take } from 'rxjs';
|
|
|
|
|
|
+interface RegistrationModel {
|
|
|
+ readonly name: string;
|
|
|
+ readonly yes: boolean;
|
|
|
+ readonly no: boolean;
|
|
|
+ readonly maybe: boolean;
|
|
|
+}
|
|
|
+
|
|
|
@Component({
|
|
|
selector: 'app-event-view',
|
|
|
templateUrl: './event-view.component.html',
|
|
|
@@ -16,7 +23,7 @@ export class EventViewComponent {
|
|
|
public eventId: string = '';
|
|
|
|
|
|
public event: GroupEvent | null = null;
|
|
|
- public registrations: Array<Registration> = [];
|
|
|
+ public registrations: Array<RegistrationModel> = [];
|
|
|
|
|
|
public registrationStates = RegistrationStateItems;
|
|
|
|
|
|
@@ -37,7 +44,14 @@ export class EventViewComponent {
|
|
|
const currentRegistrationIndex = registrations.findIndex(r => r.owner?.userId === user?.sub);
|
|
|
|
|
|
this.currentState = (currentRegistrationIndex >= 0 ? registrations.splice(currentRegistrationIndex, 1)[0] : null)?.status ?? RegistrationState.Unknown;
|
|
|
- this.registrations = registrations;
|
|
|
+ this.registrations = registrations
|
|
|
+ .filter(r => r.status !== RegistrationState.Unknown)
|
|
|
+ .map(r => ({
|
|
|
+ name: r.owner?.displayName ?? '',
|
|
|
+ yes: r.status === RegistrationState.Yes,
|
|
|
+ no: r.status === RegistrationState.No,
|
|
|
+ maybe: r.status === RegistrationState.Maybe,
|
|
|
+ }));
|
|
|
});
|
|
|
}
|
|
|
|