-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: virtual queues tab in insights #18260
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
97eb034
creat virtual-queues page in insights
cbcf01b
refactor SingleForm
2e00ee9
fix dialog issue
34a5745
first virtual queues logic
bf7e389
finish showing ordered hosts in insights/virtual-queues
468a5f1
add missing translation
3fec04e
remove comment
722d4c7
use raw sql to prevent nested loops
sean-brydon ba43ac8
Merge branch 'main' into feat/temp-virtual-queues
sean-brydon c398873
Apply suggestions from code review
PeerRich 5c2e8fd
Merge branch 'main' into feat/temp-virtual-queues
zomars 075d4db
UI fix
7fb43a8
Merge branch 'main' into feat/temp-virtual-queues
CarinaWolli 383c155
remove type
fce9bce
define type
4dc9a7f
type changes
9eaa3f6
use appschema only when necessary
hariombalhara 0ff5d1a
Merge remote-tracking branch 'origin/fix-ts-crash-api-v2' into feat/t…
hariombalhara cd127e8
Variable casing change and type fixes
hariombalhara 60913c9
Merge remote-tracking branch 'origin/fix-ts-crash-api-v2' into feat/t…
hariombalhara 564cec0
Another fix
hariombalhara 4819bad
Another missing ts fix
hariombalhara 7954f7e
Merge remote-tracking branch 'origin/fix-ts-crash-api-v2' into feat/t…
hariombalhara 34c438e
Merge branch 'main' into feat/temp-virtual-queues
3779792
add missing import
cdd762d
check for undefined metadata
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { withAppDirSsr } from "app/WithAppDirSsr"; | ||
import { _generateMetadata } from "app/_utils"; | ||
import { WithLayout } from "app/layoutHOC"; | ||
|
||
import { getServerSideProps } from "@lib/insights/getServerSideProps"; | ||
|
||
import InsightsVirtualQueuesPage from "~/insights/insights-virtual-queues-view"; | ||
|
||
export const generateMetadata = async () => | ||
await _generateMetadata( | ||
(t) => t("insights"), | ||
(t) => t("insights_subtitle") | ||
); | ||
|
||
const getData = withAppDirSsr(getServerSideProps); | ||
|
||
export default WithLayout({ getLayout: null, getData, Page: InsightsVirtualQueuesPage }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
apps/web/modules/insights/insights-virtual-queues-view.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
"use client"; | ||
|
||
import { useState } from "react"; | ||
|
||
import { TestForm } from "@calcom/app-store/routing-forms/components/SingleForm"; | ||
import type { RoutingForm } from "@calcom/app-store/routing-forms/types/types"; | ||
import { useLocale } from "@calcom/lib/hooks/useLocale"; | ||
import { trpc } from "@calcom/trpc"; | ||
import { Label, Select } from "@calcom/ui"; | ||
|
||
import InsightsLayout from "./layout"; | ||
|
||
export default function InsightsVirtualQueuesPage() { | ||
const { t } = useLocale(); | ||
const { data: routingForms, isLoading: isRoutingFormsLoading } = | ||
trpc.viewer.insights.getUserRelevantTeamRoutingForms.useQuery(); | ||
|
||
const [selectedForm, setSelectedForm] = useState<RoutingForm | undefined>( | ||
routingForms && routingForms.length > 0 ? routingForms[0] : undefined | ||
); | ||
|
||
if (routingForms && !selectedForm && routingForms.length > 0) { | ||
setSelectedForm(routingForms[0]); | ||
} | ||
|
||
return ( | ||
<InsightsLayout> | ||
<Label>{t("routing_form")}</Label> | ||
<Select | ||
placeholder="Select project" | ||
options={routingForms?.map((form) => ({ label: form.name, value: form.id })) ?? []} | ||
isLoading={isRoutingFormsLoading} | ||
className="w-60" | ||
onChange={(e) => { | ||
if (e && routingForms) { | ||
const form = routingForms.find((form) => form.id === e.value); | ||
setSelectedForm(form); | ||
} | ||
}} | ||
value={selectedForm ? { label: selectedForm.name, value: selectedForm.id } : undefined} | ||
/> | ||
<div className="mt-10"> | ||
{selectedForm ? <TestForm form={selectedForm} showAllData={false} /> : <></>} | ||
</div> | ||
</InsightsLayout> | ||
); | ||
|
||
return <></>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only returns routing forms of teams the user is a member of + that have at least one route that redirects to a weighted round robin event type where the user is a host of