feat: refine match game detail ux
This commit is contained in:
1 parent
747adfcb11
commit
0434a5db66
9 files changed
+156
-206
No files matched your search
@@ -33,6 +33,7 @@ function record(matchId: mongoose.Types.ObjectId): InternalRecord {
|
||||
gameDuration: 1_800,
|
||||
userId: new mongoose.Types.ObjectId().toString(),
|
||||
summonerName: 'Player',
|
||||
tagLine: 'KR1',
|
||||
profileIconId: 1,
|
||||
teamIndex: 1,
|
||||
side: 'blue',
|
||||
@@ -186,7 +187,7 @@ describe('CommunityStatsService', () => {
|
||||
});
|
||||
expect(matchStatsService.buildAndUpsert).not.toHaveBeenCalled();
|
||||
expect(cacheService.setDetail).toHaveBeenCalledWith(
|
||||
expect.stringContaining(':r2:'),
|
||||
expect.stringContaining(':r3:'),
|
||||
response,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -36,7 +36,7 @@ const DEFAULT_LIST_LIMIT = 20;
|
||||
const MAX_LIST_LIMIT = 50;
|
||||
const MAX_MATCH_SCAN = 300;
|
||||
const MIN_HIGHLIGHT_GAMES = 5;
|
||||
const MATCH_DETAIL_RESPONSE_CACHE_VERSION = 2;
|
||||
const MATCH_DETAIL_RESPONSE_CACHE_VERSION = 3;
|
||||
|
||||
interface CommunityStatsContext {
|
||||
community: CommunityDocument;
|
||||
@@ -248,6 +248,7 @@ export class CommunityStatsService {
|
||||
participants: team.participants.map((record) => ({
|
||||
userId: record.userId,
|
||||
summonerName: record.summonerName,
|
||||
tagLine: record.tagLine,
|
||||
teamIndex: record.teamIndex,
|
||||
side: record.side,
|
||||
teamPosition: record.teamPosition,
|
||||
@@ -1027,6 +1028,7 @@ function isCompleteMatchDetailResponse(
|
||||
Array.isArray(team.bans) &&
|
||||
team.participants.every(
|
||||
(participant) =>
|
||||
typeof participant.tagLine === 'string' &&
|
||||
Array.isArray(participant.itemBuild) &&
|
||||
Array.isArray(participant.skillBuild),
|
||||
),
|
||||
|
||||
@@ -145,6 +145,7 @@ export interface InternalMatchDetailResponse {
|
||||
participants: Array<{
|
||||
userId: string | null;
|
||||
summonerName: string;
|
||||
tagLine: string;
|
||||
teamIndex: number;
|
||||
side: TeamSide;
|
||||
teamPosition: string;
|
||||
|
||||
@@ -325,6 +325,7 @@ export class MatchStatsFragmentBuilder {
|
||||
rawParticipant?.riotIdGameName ??
|
||||
rawParticipant?.summonerName ??
|
||||
'Unknown',
|
||||
tagLine: snapshot?.tagLine ?? rawParticipant?.riotIdTagLine ?? '',
|
||||
profileIconId: snapshot?.profileIconId ?? 0,
|
||||
teamIndex: participant.teamIndex,
|
||||
side: participant.side,
|
||||
|
||||
@@ -114,7 +114,7 @@ describe('MatchStatsService', () => {
|
||||
scheduledAt,
|
||||
gameCreationMin: 1_000,
|
||||
gameCreationMax: 2_000,
|
||||
builderVersion: 8,
|
||||
builderVersion: 9,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -4,7 +4,7 @@ import type {
|
||||
} from '../global/database/schema';
|
||||
import type { InternalMatchCardView } from './community-stats.types';
|
||||
|
||||
export const MATCH_STATS_BUILDER_VERSION = 8;
|
||||
export const MATCH_STATS_BUILDER_VERSION = 9;
|
||||
|
||||
export type InternalRecord = MatchStatsRecord;
|
||||
export type InternalGameDetail = MatchStatsGameDetail;
|
||||
|
||||
@@ -711,6 +711,7 @@ export interface MatchStatsRecord {
|
||||
gameDuration: number;
|
||||
userId: string;
|
||||
summonerName: string;
|
||||
tagLine: string;
|
||||
profileIconId: number;
|
||||
teamIndex: number;
|
||||
side: TeamSide;
|
||||
|
||||
Reference in new issue
Block a user