feat: download insights raw data as csv#11645
Conversation
CAL-2347 /insights: be able to access raw data via csv api endpoint
same as metabase, it would be great if you can copy the link to the real-time raw data as a csv: |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
|
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link to collect XP and win prizes! |
| "u"."username" AS "username" | ||
| FROM "Booking" | ||
| LEFT JOIN "EventType" et ON "Booking"."eventTypeId" = et.id | ||
| LEFT JOIN users u ON u.id = "Booking"."userId"; |
There was a problem hiding this comment.
Removed unused membership left join here and added new users to get user->email and username
| }); | ||
|
|
||
| const csvAsString = objectToCsv(csvData); | ||
| const downloadAs = `Insights-${dayjs(startDate).format("YYYY-MM-DD")}-${dayjs(endDate).format( |
There was a problem hiding this comment.
Felt that this name convention was right.
| return ""; | ||
| } | ||
| const header = Object.keys(data[0]).join(",") + "\n"; | ||
| const rows = data.map((obj: any) => Object.values(obj).join(",") + "\n"); |
There was a problem hiding this comment.
returning props of object as first line for headers.
|
|
||
| test.describe.configure({ mode: "parallel" }); | ||
|
|
||
| const createTeamsAndMembership = async (userIdOne: number, userIdTwo: number) => { |
There was a problem hiding this comment.
There is another PR that have more test here, reused some logic but only added required test here.
| endTime: true, | ||
| paid: true, | ||
| userEmail: true, | ||
| username: true, |
There was a problem hiding this comment.
We should be fine for now for this values.
| * @param props | ||
| * @returns | ||
| */ | ||
| static obtainWhereConditional = async ( |
There was a problem hiding this comment.
Reusing logic from insights router, to be used later and avoid duplicated code.
| * - memberUserId | ||
| * - eventTypeId | ||
| * - userId | ||
| * - teamId |
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Current Playwright Test Results Summary✅ 148 Passing - Run may still be in progress, this comment will be updated as current testing workflow or job completes... (Last updated on 10/12/2023 01:14:53pm UTC) Run DetailsRunning Workflow PR Update on Github Actions Commit: d5be128 Started: 10/12/2023 01:12:00pm UTC
|
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Popup Tests should be able to reschedule
Retry 1 • Initial Attempt |
5.28% (17)17 / 322 runsfailed over last 7 days |
94.10% (303)303 / 322 runsflaked over last 7 days |
📄 packages/embeds/embed-core/playwright/tests/inline.e2e.ts • 1 Flake
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Inline Iframe Inline Iframe - Configured with Dark Theme
Retry 1 • Initial Attempt |
2.80% (9)9 / 322 runsfailed over last 7 days |
9.94% (32)32 / 322 runsflaked over last 7 days |
|
getting a real-time URL comes later, right? |
CarinaWolli
left a comment
There was a problem hiding this comment.
Tested and works, but please address my comments first 🙏
|
I'm gonna try the trpc approach while also adding public url link for this PR. |
…-csv-api-endpoint-10747-cal-2347
CarinaWolli
left a comment
There was a problem hiding this comment.
Looks good, my requested changes are fixed 👍
What does this PR do?
Fixes #10747
Requirement/Documentation
Type of change
How should this be tested?
Mandatory Tasks