Skip to content

Commit b90cf0e

Browse files
fix(audit): show column title in hint sidebar title (Issue #2109) (#2159)
1 parent 57ac21e commit b90cf0e

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

apps/ai-dial-admin/src/constants/grid-columns/configs.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,19 @@ export const numericColumn: Partial<ColDef> = {
2222
filterValueGetter: (params) => numberValueFormatter(params.data[params.colDef.field || '']),
2323
};
2424

25-
export const priceColumn: Partial<ColDef> = {
26-
...numericColumn,
27-
headerComponentParams: {
28-
innerHeaderComponent: HeaderWithHintButton,
29-
innerHeaderComponentParams: {
30-
hintText:
31-
'The calculated price is an approximation. Since different models, applications, and configurations may have varying token usage and processing costs, it’s not possible to determine the exact final price in advance. \n' +
32-
'The estimate gives you a general idea of expected costs, but the actual price may differ depending on how the chat unfolds (e.g., message length, complexity, model type, or additional features used).',
33-
hintTitle: 'Total Price',
25+
export const priceColumn = (title: string): Partial<ColDef> => {
26+
return {
27+
...numericColumn,
28+
headerComponentParams: {
29+
innerHeaderComponent: HeaderWithHintButton,
30+
innerHeaderComponentParams: {
31+
hintText:
32+
'The calculated price is an approximation. Since different models, applications, and configurations may have varying token usage and processing costs, it’s not possible to determine the exact final price in advance. \n' +
33+
'The estimate gives you a general idea of expected costs, but the actual price may differ depending on how the chat unfolds (e.g., message length, complexity, model type, or additional features used).',
34+
hintTitle: title,
35+
},
3436
},
35-
},
36-
valueFormatter: ({ value }) => `$${priceValueFormatter(value)}`,
37-
filterValueGetter: (params) => priceValueFormatter(params.data[params.colDef.field || '']),
37+
valueFormatter: ({ value }) => `$${priceValueFormatter(value)}`,
38+
filterValueGetter: (params) => priceValueFormatter(params.data[params.colDef.field || '']),
39+
};
3840
};

apps/ai-dial-admin/src/constants/grid-columns/grid-columns.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,13 +362,13 @@ export const USAGE_LOG_TRACES_COLUMNS: ColDef[] = [
362362
headerName: 'Deployment Price',
363363
minWidth: 180,
364364
hide: false,
365-
...priceColumn,
365+
...priceColumn('Deployment Price'),
366366
},
367367
{
368368
field: 'price',
369369
headerName: 'Total Price',
370370
hide: false,
371-
...priceColumn,
371+
...priceColumn('Total Price'),
372372
},
373373
{
374374
field: 'number_request_messages',
@@ -418,7 +418,7 @@ export const USAGE_LOG_CONVERSATIONS_COLUMNS: ColDef[] = [
418418
field: 'deployment_price',
419419
headerName: 'Total Price',
420420
hide: false,
421-
...priceColumn,
421+
...priceColumn('Total Price'),
422422
},
423423
{
424424
field: 'number_request_messages',

0 commit comments

Comments
 (0)