feat: insights orgs [CAL-1888]#9551
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| const { t } = useLocale(); | ||
| const { filter } = useFilterContext(); | ||
| const { dateRange, selectedMemberUserId } = filter; | ||
| const { dateRange, selectedMemberUserId, isOrg } = filter; |
There was a problem hiding this comment.
new prop in UI that tell us if Team option selected is the team that is parent of other teams.
| userId: null, | ||
| teamId: null, | ||
| isOrg: false, | ||
| }); |
There was a problem hiding this comment.
Added this so I can save initialConfig and reinstate it when using clear filters button.
| const userId = | ||
| filter?.[0] === "user" ? selectedMemberUserId : selectedUserId ? selectedUserId : undefined; | ||
| const eventTypeId = filter?.[0] === "event-type" ? selectedEventTypeId : undefined; | ||
| const memberUserId = filter?.[0] === "user" ? selectedMemberUserId : undefined; |
There was a problem hiding this comment.
Was missing some clean up here when running clean filters action
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 One Page Changed SizeThe following page changed size from the code in this PR compared to its base branch:
DetailsOnly the gzipped size is provided here based on an expert tip. First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If Any third party scripts you have added directly to your app using the The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored. |
Current Playwright Test Results Summary✅ 124 Passing - Run may still be in progress, this comment will be updated as current testing workflow or job completes... (Last updated on 06/29/2023 05:00:43pm UTC) Run DetailsRunning Workflow PR Update on Github Actions Commit: 1d6aca3 Started: 06/29/2023 04:58:35pm UTC
|
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Routing Forms Seeded Routing Form Routing Link should validate fields
Retry 1 • Initial Attempt |
0% (0)0 / 166 runsfailed over last 7 days |
2.41% (4)4 / 166 runsflaked over last 7 days |
📄 packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 2 Flakes
Top 1 Common Error Messages
|
|
2 Test Cases Affected |
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Popup Tests -- new-booker should be able to reschedule
Retry 1 • Initial Attempt |
12.86% (9)9 / 70 runsfailed over last 7 days |
21.43% (15)15 / 70 runsflaked over last 7 days |
|
Popup Tests -- old-booker should be able to reschedule
Retry 1 • Initial Attempt |
2.86% (2)2 / 70 runsfailed over last 7 days |
11.43% (8)8 / 70 runsflaked over last 7 days |
📄 apps/web/playwright/reschedule.e2e.ts • 1 Flake
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Reschedule Tests -- new-booker Paid rescheduling should go to success page
Retry 1 • Initial Attempt |
0.40% (1)1 / 249 runfailed over last 7 days |
2.01% (5)5 / 249 runsflaked over last 7 days |
📄 apps/web/playwright/booking-seats.e2e.ts • 1 Flake
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Booking with Seats -- old-booker Attendees can cancel a seated event time slot
Retry 1 • Initial Attempt |
0% (0)0 / 254 runsfailed over last 7 days |
2.36% (6)6 / 254 runsflaked over last 7 days |
|
|
||
| const UserBelongsToTeamInput = z.object({ | ||
| teamId: z.coerce.number().optional().nullable(), | ||
| isOrg: z.boolean().optional(), |
There was a problem hiding this comment.
Most important changes where in this file and github just hides it
| ...ctx, | ||
| user: { | ||
| ...ctx.user, | ||
| isOwnerAdminOfParentTeam: true, |
There was a problem hiding this comment.
If no direct membership is found, we then look for parent teams and look if user session is admin/owner.
There was a problem hiding this comment.
Then we pass down ctx a new prop that user is validated and if isOrg is passed in input we should allow user get child teams data.
| select: { | ||
| id: true, | ||
| }, | ||
| }); |
There was a problem hiding this comment.
Getting teams from org
| in: teamsFromOrg.map((t) => t.id), | ||
| }, | ||
| }; | ||
| const usersFromOrg = await ctx.prisma.membership.findMany({ |
There was a problem hiding this comment.
Then we convert those teams to users ids
| where: eventTypeWhereConditional, | ||
| }); | ||
|
|
||
| default: |
There was a problem hiding this comment.
Changed from switch to if conditional
|
|
||
| if (teamId) { | ||
| if (isOrg && ctx.user.isOwnerAdminOfParentTeam) { | ||
| const teamsFromOrg = await ctx.prisma.team.findMany({ |
There was a problem hiding this comment.
Same is done across actions in insights methods
* initial commit * fixes on data returned * mobile style fixes * Update on styles and dates not being shown on graphics * feat: update insights filters UI (calcom#9756) * feat: update insights filters UI Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> * Fixes for filters with new UI * fix initialConfig lost while clearing filters * Add single user conditional for first render --------- Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> Co-authored-by: Alan <alannnc@gmail.com> --------- Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> Co-authored-by: Efraín Rochín <roae.85@gmail.com> Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
What does this PR do?
Fixes # (issue)
Fixes #9360
https://www.loom.com/share/d149cc7b8dfd436487f404d472c1840c
Type of change
How should this be tested?
Mandatory Tasks
Checklist