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
2 changes: 1 addition & 1 deletion DSL/Resql/analytics/POST/chat-quality-overview.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WITH latest_per_base AS (
ORDER BY c.base_id, c.updated DESC
)
SELECT
DATE_TRUNC(:period, lp.ended) AS time,
DATE_TRUNC(:period, lp.ended AT TIME ZONE :timezone) AT TIME ZONE :timezone AS time,
COUNT(DISTINCT lp.base_id) AS total,
COUNT(DISTINCT cm_theme.chat_base_id) AS themes,
COUNT(DISTINCT cm_quality.chat_base_id) AS response_quality,
Expand Down
4 changes: 4 additions & 0 deletions DSL/Ruuter/analytics/POST/chats/quality-overview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ declaration:
- field: showTest
type: boolean
description: "Body field 'showTest'"
- field: timezone
type: string
description: "Body field 'timezone'"

check_for_required_parameters:
switch:
Expand All @@ -40,6 +43,7 @@ post_chart_data:
period: ${incoming.body.period}
urls: ${incoming.body.urls}
showTest: ${incoming.body.showTest}
timezone: ${incoming.body.timezone}
result: chart_result

assign_chart_data:
Expand Down
3 changes: 2 additions & 1 deletion GUI/src/pages/ChatsPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ const ChatsPage: React.FC = () => {
let result: ChartData = { chartData: [], colors: [] };
try {
const response = await request<
Readonly<{ start_date: string; end_date: string; period: string; urls: (string | null)[]; showTest: boolean }>,
Readonly<{ start_date: string; end_date: string; period: string; urls: (string | null)[]; showTest: boolean; timezone: string }>,
{
response: [
{ time: string; total: number; themes: number; responseQuality: number; followUp: number }[],
Expand All @@ -361,6 +361,7 @@ const ChatsPage: React.FC = () => {
period: config.groupByPeriod || 'day',
urls: getDomainsArray(),
showTest: getShowTestData(),
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
},
});
const chartRows = response.response[0] ?? [];
Expand Down
Loading