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-count-only-chatbot.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ csa_ids AS (
)
)
SELECT
DATE_TRUNC(:period, lp.ended) AS time,
DATE_TRUNC(:period, lp.ended AT TIME ZONE :timezone) AT TIME ZONE :timezone AS time,
COUNT(*) AS count
FROM latest_per_base lp
WHERE (:showTest = TRUE OR lp.test = FALSE)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH latest_per_base AS (
SELECT DISTINCT ON (c.base_id)
DATE_TRUNC(:period, c.ended) AS time,
DATE_TRUNC(:period, c.ended AT TIME ZONE :timezone) AT TIME ZONE :timezone AS time,
c.base_id,
c.test,
c.end_user_url,
Expand Down
2 changes: 1 addition & 1 deletion DSL/Resql/analytics/POST/chat-count-with-csa.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WHERE c.status = 'ENDED'
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(*) AS count
FROM latest_per_base lp
WHERE (:showTest = TRUE OR lp.test = FALSE)
Expand Down
7 changes: 7 additions & 0 deletions DSL/Ruuter/analytics/POST/chats/total-count.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ declaration:
- field: showTest
type: boolean
description: "Body field 'showTest'"
- field: timezone
type: string
description: "Body field 'timezone'"

check_for_body:
switch:
Expand All @@ -40,6 +43,7 @@ extract_request_data:
period: ${incoming.body.period}
urls: ${incoming.body.urls}
showTest: ${incoming.body.showTest}
timezone: ${incoming.body.timezone}

check_for_required_parameters:
switch:
Expand Down Expand Up @@ -72,6 +76,7 @@ byk:
end: ${end}
urls: ${urls}
showTest: ${showTest}
timezone: ${timezone}
result: results

assign_byk:
Expand All @@ -98,6 +103,7 @@ csa:
end: ${end}
urls: ${urls}
showTest: ${showTest}
timezone: ${timezone}
result: results

assign_csa:
Expand All @@ -124,6 +130,7 @@ total:
end: ${end}
urls: ${urls}
showTest: ${showTest}
timezone: ${timezone}
result: results

assign_total:
Expand Down
3 changes: 2 additions & 1 deletion GUI/src/util/api-response-handler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export const fetchChartDataWithSubOptions = async (url: string, config: any, sub
period: config?.groupByPeriod ?? 'day',
options: config?.options.join(',') ?? '',
urls: config?.urls,
showTest: config?.showTest ?? true
showTest: config?.showTest ?? true,
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
},
});

Expand Down
Loading