Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 17 additions & 19 deletions frontend/package-lock.json

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

4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
"d3-shape": "^3.2.0",
"dagre": "^0.8.5",
"dayjs": "^1.11.23",
"i18next": "^26.4.0",
"i18next": "^27.1.1",
"motion": "^14.9.0",
"react": "^19.2.5",
"react-dom": "^19.3.0",
"react-i18next": "^17.0.14",
"react-i18next": "^18.0.0",
"react-router-dom": "^7.18.4",
"sql-formatter": "^15.8.2",
"tailwind-merge": "^3.6.0",
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/common/NotificationBell.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { TFunction } from 'i18next';
import { useState } from 'react';
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import { useNavigate } from 'react-router-dom';
Expand Down Expand Up @@ -175,7 +176,7 @@

function renderMessage(
item: UserNotification,
t: (key: string, options?: Record<string, unknown>) => string,
t: TFunction,
): string {
const payload: UserNotificationPayload = item.payload ?? {};
const datasource = payload.datasource ?? '—';
Expand Down Expand Up @@ -353,7 +354,7 @@
}
}

export function routeForNotification(item: UserNotification): string | null {

Check warning on line 357 in frontend/src/components/common/NotificationBell.tsx

View workflow job for this annotation

GitHub Actions / Frontend

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components
// #622 escalations and nudges are the only event types raised for BOTH queries and API
// requests, so unlike every branch below them the event name alone does not say which queue the
// recipient needs — `api_request_id` does. Without this check a stalled API request would send
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ declare module 'i18next' {
interface CustomTypeOptions {
defaultNS: 'translation';
resources: { translation: typeof en };
returnEmptyString: true;
}
}
1 change: 1 addition & 0 deletions frontend/src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ i18n.use(initReactI18next).init({
lng: persistedLanguage,
fallbackLng: 'en',
interpolation: { escapeValue: false },
returnEmptyString: true,
});

export default i18n;
7 changes: 5 additions & 2 deletions frontend/src/pages/queries/buildTimelineStages.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { TFunction } from 'i18next';
import { describe, expect, it } from 'vitest';
import { buildTimelineStages } from './buildTimelineStages';
import type {
Expand All @@ -8,8 +9,10 @@ import type {
} from '@/types/api';

// Echoes the key plus its interpolation, so tests assert the shape without pinning English copy.
const t = (key: string, options?: Record<string, unknown>) =>
options ? `${key}:${Object.entries(options).map(([k, v]) => `${k}=${String(v)}`).join(',')}` : key;
const t = ((key: string, options?: Record<string, unknown>) =>
options
? `${key}:${Object.entries(options).map(([k, v]) => `${k}=${String(v)}`).join(',')}`
: key) as unknown as TFunction;

function reviewer(id: string, displayName: string | null, email: string) {
return { id, email, display_name: displayName as string };
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/queries/buildTimelineStages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import type { TimelineStage } from '@/components/review/ApprovalTimeline';
import type { QueryDetail, ReviewDecisionDetail } from '@/types/api';
import { fmtDate, fmtNum } from '@/utils/dateFormat';
import { userDisplay } from '@/utils/userDisplay';
import type { TFunction } from 'i18next';

/** i18next's `t`, narrowed to what this builder needs — key plus optional interpolation. */
type Translate = (key: string, options?: Record<string, unknown>) => string;
type Translate = TFunction;

export function buildTimelineStages(
query: QueryDetail,
Expand Down
Loading