Skip to content

Commit

Permalink
Neue Version 1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sansan88 committed Jun 20, 2024
1 parent 5bb0488 commit cf6f4f5
Show file tree
Hide file tree
Showing 13 changed files with 147 additions and 149 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId "app.myclub.defaultapp"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 36
versionName "1.5.0"
versionCode 38
versionName "1.5.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down
8 changes: 4 additions & 4 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = App/AppDebug.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 36;
CURRENT_PROJECT_VERSION = 38;
DEVELOPMENT_TEAM = U7DQUX87VS;
INFOPLIST_FILE = App/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = myclub;
Expand All @@ -399,7 +399,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.5.0;
MARKETING_VERSION = 1.5.2;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = app.myclub.default;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -416,7 +416,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = App/AppRelease.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 36;
CURRENT_PROJECT_VERSION = 38;
DEVELOPMENT_TEAM = U7DQUX87VS;
INFOPLIST_FILE = App/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = myclub;
Expand All @@ -426,7 +426,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.5.0;
MARKETING_VERSION = 1.5.2;
PRODUCT_BUNDLE_IDENTIFIER = app.myclub.default;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "myclub",
"version": "1.5.0",
"version": "1.5.2",
"author": "liitu consulting gmbh",
"homepage": "https://my-club.app/",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<ion-icon name="close" size="small"></ion-icon>
</ion-fab-button>
</ion-fab>
<capacitor-google-map #map *ngIf="game.location && game.latitude && game.longitude"></capacitor-google-map>
<capacitor-google-map #map *ngIf="game.latitude && game.longitude"></capacitor-google-map>
<ion-list [inset]="true">

<ion-item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from "@angular/core";
import {
ModalController,
NavController,
// NavController,
NavParams,
ToastController,
} from "@ionic/angular";
Expand All @@ -27,7 +27,7 @@ import { User } from "@angular/fire/auth";
import { catchError, map, switchMap, take, tap } from "rxjs/operators";
import { UserProfileService } from "src/app/services/firebase/user-profile.service";
import { environment } from "src/environments/environment";
import { ActivatedRoute } from "@angular/router";
// import { ActivatedRoute } from "@angular/router";
import { TranslateService } from "@ngx-translate/core";
import { LineupPage } from "../lineup/lineup.page";
import { Profile } from "src/app/models/user";
Expand Down Expand Up @@ -111,105 +111,88 @@ export class ChampionshipDetailPage implements OnInit {
}
}
// ng

getGame(teamId: string, gameId: string) {
return this.authService.getUser$().pipe(
take(1),
tap((user) => {
this.setMap();
this.user = user;
if (!user) {
console.log("No user found");
throw new Error("User not found");
}
if (!user) throw new Error("User not found");
}),
switchMap(() => this.championshipService.getTeamGameRef(teamId, gameId)),
switchMap((game) => {
if (!game) return of(null);
// Get both attendees and team members in parallel
return combineLatest([
this.championshipService.getTeamGameAttendeesRef(teamId, gameId),
this.fbService.getTeamMemberRefs(teamId)
]).pipe(
/*return this.championshipService
.getTeamGameAttendeesRef(teamId, gameId)
.pipe(
switchMap((attendees) => {*/
switchMap(([attendees, teamMembers]) => {
if (attendees.length === 0) {
// If no attendees, return event data immediately
return of({
...game,
attendees: [],
attendeeListTrue: [],
attendeeListFalse: [],
status: null,
});
}
const attendeeProfiles$ = attendees.map((attendee) =>
this.userProfileService.getUserProfileById(attendee.id).pipe(
take(1),
map((profile) => ({ ...profile, ...attendee })), // Combine attendee object with profile
catchError(() =>
of({
...attendee,
firstName: "Unknown",
lastName: "Unknown",
})
)
)
);
// Fetch profiles for all club members
const teamMemberProfiles$ = teamMembers.map(member =>
this.userProfileService.getUserProfileById(member.id).pipe(
take(1),
catchError(() => of({ ...member, firstName: "Unknown", lastName: "Unknown" }))
)

// Fetch all team members first
return this.fbService.getTeamMemberRefs(teamId).pipe(
switchMap(teamMembers => {
const teamMemberProfiles$ = teamMembers.map(member =>
this.userProfileService.getUserProfileById(member.id).pipe(
take(1),
catchError(err => {
console.log(`Failed to fetch profile for team member ${member.id}:`, err);
return of({ ...member, firstName: "Unknown", lastName: "Unknown", status: null });
})
)
);
//return forkJoin(attendeeProfiles$).pipe(
//map((attendeesWithDetails) => {
return combineLatest([forkJoin(attendeeProfiles$), forkJoin(teamMemberProfiles$)]).pipe(
map(([attendeesWithDetails, teamMembersWithDetails]) => {
// Find the attendee that matches the current user's ID
const userAttendee = attendeesWithDetails.find(
(att) => att.id === this.user.uid
);
// Fetch all attendees next
return forkJoin(teamMemberProfiles$).pipe(
switchMap(teamMembersWithDetails => {
// Fetch all game attendees next
return this.championshipService.getTeamGameAttendeesRef(teamId, gameId).pipe(
map(attendees => {
const attendeeDetails = attendees.map(attendee => {
const detail = teamMembersWithDetails.find(member => member.id === attendee.id);
return detail ? { ...detail, status: attendee.status } : null;
}).filter(item => item !== null);

// If userAttendee is undefined, status will default to null
const status = userAttendee ? userAttendee.status : null;
const attendeeListTrue = attendeeDetails.filter(att => att.status === true);
const attendeeListFalse = attendeeDetails.filter(att => att.status === false);
const respondedIds = new Set(attendeeDetails.map(att => att.id));
const unrespondedMembers = teamMembersWithDetails.filter(member => !respondedIds.has(member.id));

// Determine members who have not responded
const respondedIds = new Set(attendeesWithDetails.map(att => att.id));
const unrespondedMembers = teamMembersWithDetails.filter(member => !respondedIds.has(member.id));
const userAttendee = attendeeDetails.find(att => att.id === this.user.uid);
const status = userAttendee ? userAttendee.status : null;

return {
...game,
attendees: attendeesWithDetails,
attendeeListTrue: attendeesWithDetails.filter(
(e) => e.status === true
),
attendeeListFalse: attendeesWithDetails.filter(
(e) => e.status === false
),
unrespondedMembers: unrespondedMembers,
status: status, // use the variable set above
};
})
);
}),
catchError(() =>
of({
...game,
attendees: [],
attendeeListTrue: [],
attendeeListFalse: [],
unrespondedMembers: [],
status: null,
})
)
);
return {
...game,
attendees: attendeeDetails,
attendeeListTrue,
attendeeListFalse,
unrespondedMembers,
status,
};
}),
catchError(err => {
console.error("Error fetching attendees:", err);
return of({
...game,
attendees: [],
attendeeListTrue: [],
attendeeListFalse: [],
unrespondedMembers: teamMembers,
status: null
});
})
);
}),
);
}),
catchError(err => {
console.error("Error fetching team members:", err);
return of({
...game,
attendees: [],
attendeeListTrue: [],
attendeeListFalse: [],
unrespondedMembers: [],
status: null
});
})
);
}),
catchError((err) => {
console.error("Error in getTrainingWithAttendees:", err);
catchError(err => {
console.error("Error in getGameWithAttendees:", err);
return of(null);
})
);
Expand Down Expand Up @@ -378,3 +361,4 @@ export class ChampionshipDetailPage implements OnInit {
}
}
}

2 changes: 1 addition & 1 deletion src/app/pages/profile/profile.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
<ion-label>
{{"profile.push__message__activate" | translate}}
</ion-label>
<ion-note *ngIf="userProfile.settingsPush" color="medium"> {{"profile.push__message__deactivate" |
<ion-note class="ion-text-wrap" *ngIf="userProfile.settingsPush" color="medium"> {{"profile.push__message__deactivate" |
translate}}</ion-note>

</ion-toggle>
Expand Down
Loading

0 comments on commit cf6f4f5

Please sign in to comment.