add changes
This commit is contained in:
@@ -73,12 +73,14 @@ export class AdminService {
|
||||
readonly isLoadingUsers = signal<boolean>(false);
|
||||
readonly usersError = signal<string | null>(null);
|
||||
readonly usersPagination = signal<{
|
||||
currentPage: number;
|
||||
totalPages: number;
|
||||
totalUsers: number;
|
||||
limit: number;
|
||||
hasNext: boolean;
|
||||
hasPrev: boolean;
|
||||
|
||||
currentPage: number;
|
||||
totalPages: number;
|
||||
totalItems: number;
|
||||
itemsPerPage: number;
|
||||
hasNextPage: boolean;
|
||||
hasPreviousPage: boolean;
|
||||
|
||||
} | null>(null);
|
||||
readonly currentUserFilters = signal<UserListParams>({});
|
||||
|
||||
@@ -95,18 +97,18 @@ export class AdminService {
|
||||
|
||||
// Computed signals - Statistics
|
||||
readonly hasStats = computed(() => this.adminStatsState() !== null);
|
||||
readonly totalUsers = computed(() => this.adminStatsState()?.totalUsers ?? 0);
|
||||
readonly activeUsers = computed(() => this.adminStatsState()?.activeUsers ?? 0);
|
||||
readonly totalQuizSessions = computed(() => this.adminStatsState()?.totalQuizSessions ?? 0);
|
||||
readonly totalQuestions = computed(() => this.adminStatsState()?.totalQuestions ?? 0);
|
||||
readonly averageScore = computed(() => this.adminStatsState()?.averageQuizScore ?? 0);
|
||||
readonly totalUsers = computed(() => this.adminStatsState()?.users.total ?? 0);
|
||||
readonly activeUsers = computed(() => this.adminStatsState()?.users.active ?? 0);
|
||||
readonly totalQuizSessions = computed(() => this.adminStatsState()?.quizzes.totalSessions ?? 0);
|
||||
readonly totalQuestions = computed(() => this.adminStatsState()?.content.totalQuestions ?? 0);
|
||||
readonly averageScore = computed(() => this.adminStatsState()?.quizzes.averageScore ?? 0);
|
||||
|
||||
// Computed signals - Guest Analytics
|
||||
readonly hasAnalytics = computed(() => this.guestAnalyticsState() !== null);
|
||||
readonly totalGuestSessions = computed(() => this.guestAnalyticsState()?.totalGuestSessions ?? 0);
|
||||
readonly activeGuestSessions = computed(() => this.guestAnalyticsState()?.activeGuestSessions ?? 0);
|
||||
readonly conversionRate = computed(() => this.guestAnalyticsState()?.conversionRate ?? 0);
|
||||
readonly avgQuizzesPerGuest = computed(() => this.guestAnalyticsState()?.averageQuizzesPerGuest ?? 0);
|
||||
readonly totalGuestSessions = computed(() => this.guestAnalyticsState()?.overview.totalGuestSessions ?? 0);
|
||||
readonly activeGuestSessions = computed(() => this.guestAnalyticsState()?.overview.activeGuestSessions ?? 0);
|
||||
readonly conversionRate = computed(() => this.guestAnalyticsState()?.overview.conversionRate ?? 0);
|
||||
readonly avgQuizzesPerGuest = computed(() => this.guestAnalyticsState()?.quizActivity.avgQuizzesPerGuest ?? 0);
|
||||
|
||||
// Computed signals - Guest Settings
|
||||
readonly hasSettings = computed(() => this.guestSettingsState() !== null);
|
||||
@@ -116,7 +118,7 @@ export class AdminService {
|
||||
|
||||
// Computed signals - User Management
|
||||
readonly hasUsers = computed(() => this.adminUsersState().length > 0);
|
||||
readonly totalUsersCount = computed(() => this.usersPagination()?.totalUsers ?? 0);
|
||||
readonly totalUsersCount = computed(() => this.usersPagination()?.totalItems ?? 0);
|
||||
readonly currentPage = computed(() => this.usersPagination()?.currentPage ?? 1);
|
||||
readonly totalPages = computed(() => this.usersPagination()?.totalPages ?? 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user