chore: bump @trpc/* and @tanstack/react-query (#13335)
Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Omar López <[email protected]> Co-authored-by: CarinaWolli <[email protected]> Co-authored-by: Alex van Andel <[email protected]> Co-authored-by: zomars <[email protected]> Co-authored-by: Udit Takkar <[email protected]> Co-authored-by: Benny Joo <[email protected]> Co-authored-by: Carina Wollendorfer <[email protected]> Co-authored-by: Gergő Móricz <[email protected]> Co-authored-by: Keith Williams <[email protected]>
This commit is contained in:
183 files changed
+1203
-1013
No files matched your search
@@ -254,9 +254,9 @@ const InstallAppButtonChild = ({
|
||||
<DropdownMenuContent
|
||||
className="w-56"
|
||||
onInteractOutside={(event) => {
|
||||
if (mutation.isLoading) event.preventDefault();
|
||||
if (mutation.isPending) event.preventDefault();
|
||||
}}>
|
||||
{mutation.isLoading && (
|
||||
{mutation.isPending && (
|
||||
<div className="z-1 fixed inset-0 flex items-center justify-center">
|
||||
<Spinner />
|
||||
</div>
|
||||
|
||||
@@ -5,10 +5,10 @@ import Link from "next/link";
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import { AVATAR_FALLBACK } from "@calcom/lib/constants";
|
||||
|
||||
import type { Maybe } from "@trpc/server";
|
||||
|
||||
import { Tooltip } from "../tooltip";
|
||||
|
||||
type Maybe<T> = T | null | undefined;
|
||||
|
||||
export type AvatarProps = {
|
||||
className?: string;
|
||||
size?: "xxs" | "xs" | "xsm" | "sm" | "md" | "mdLg" | "lg" | "xl";
|
||||
|
||||
@@ -28,7 +28,7 @@ export type CreateBtnProps = {
|
||||
createFunction?: (teamId?: number) => void;
|
||||
subtitle?: string;
|
||||
buttonText?: string;
|
||||
isLoading?: boolean;
|
||||
isPending?: boolean;
|
||||
disableMobileButton?: boolean;
|
||||
"data-testid"?: string;
|
||||
color?: ButtonColor;
|
||||
@@ -46,7 +46,7 @@ export function CreateButton(props: CreateBtnProps) {
|
||||
const {
|
||||
createDialog,
|
||||
options,
|
||||
isLoading,
|
||||
isPending,
|
||||
createFunction,
|
||||
buttonText,
|
||||
disableMobileButton,
|
||||
@@ -85,7 +85,7 @@ export function CreateButton(props: CreateBtnProps) {
|
||||
}
|
||||
data-testid="create-button"
|
||||
StartIcon={Plus}
|
||||
loading={isLoading}
|
||||
loading={isPending}
|
||||
variant={disableMobileButton ? "button" : "fab"}
|
||||
{...restProps}>
|
||||
{buttonText ? buttonText : t("new")}
|
||||
@@ -97,7 +97,7 @@ export function CreateButton(props: CreateBtnProps) {
|
||||
variant={disableMobileButton ? "button" : "fab"}
|
||||
StartIcon={Plus}
|
||||
data-testid="create-button-dropdown"
|
||||
loading={isLoading}
|
||||
loading={isPending}
|
||||
{...restProps}>
|
||||
{buttonText ? buttonText : t("new")}
|
||||
</Button>
|
||||
|
||||
@@ -36,7 +36,7 @@ The `DataTable` setup for tabular data, with columns, virtual scroll, sticky hea
|
||||
args={{
|
||||
columns: columns,
|
||||
data: dataTableDemousers,
|
||||
isLoading: false,
|
||||
isPending: false,
|
||||
searchKey: "username",
|
||||
filterableItems: filterableItems,
|
||||
tableContainerRef: { current: null },
|
||||
|
||||
@@ -33,7 +33,7 @@ export interface DataTableProps<TData, TValue> {
|
||||
filterableItems?: FilterableItems;
|
||||
selectionOptions?: ActionItem<TData>[];
|
||||
tableCTA?: React.ReactNode;
|
||||
isLoading?: boolean;
|
||||
isPending?: boolean;
|
||||
onRowMouseclick?: (row: Row<TData>) => void;
|
||||
onScroll?: (e: React.UIEvent<HTMLDivElement, UIEvent>) => void;
|
||||
CTA?: React.ReactNode;
|
||||
@@ -49,7 +49,7 @@ export function DataTable<TData, TValue>({
|
||||
searchKey,
|
||||
selectionOptions,
|
||||
tableContainerRef,
|
||||
isLoading,
|
||||
isPending,
|
||||
tableOverlay,
|
||||
variant,
|
||||
/** This should only really be used if you dont have actions in a row. */
|
||||
@@ -127,7 +127,7 @@ export function DataTable<TData, TValue>({
|
||||
<td style={{ height: `${paddingTop}px` }} />
|
||||
</tr>
|
||||
)}
|
||||
{virtualRows && !isLoading ? (
|
||||
{virtualRows && !isPending ? (
|
||||
virtualRows.map((virtualRow) => {
|
||||
const row = rows[virtualRow.index] as Row<TData>;
|
||||
return (
|
||||
|
||||
@@ -13,7 +13,7 @@ type ConfirmBtnType =
|
||||
|
||||
export type ConfirmationDialogContentProps = {
|
||||
cancelBtnText?: string;
|
||||
isLoading?: boolean;
|
||||
isPending?: boolean;
|
||||
loadingText?: string;
|
||||
onConfirm?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
||||
title: string;
|
||||
@@ -29,7 +29,7 @@ export function ConfirmationDialogContent(props: PropsWithChildren<ConfirmationD
|
||||
confirmBtnText = t("confirm"),
|
||||
cancelBtnText = t("cancel"),
|
||||
loadingText = t("loading"),
|
||||
isLoading = false,
|
||||
isPending = false,
|
||||
onConfirm,
|
||||
children,
|
||||
} = props;
|
||||
@@ -71,13 +71,13 @@ export function ConfirmationDialogContent(props: PropsWithChildren<ConfirmationD
|
||||
) : (
|
||||
<DialogClose
|
||||
color="primary"
|
||||
loading={isLoading}
|
||||
loading={isPending}
|
||||
onClick={(e) => onConfirm && onConfirm(e)}
|
||||
data-testid="dialog-confirmation">
|
||||
{isLoading ? loadingText : confirmBtnText}
|
||||
{isPending ? loadingText : confirmBtnText}
|
||||
</DialogClose>
|
||||
)}
|
||||
<DialogClose disabled={isLoading}>{cancelBtnText}</DialogClose>
|
||||
<DialogClose disabled={isPending}>{cancelBtnText}</DialogClose>
|
||||
</div>
|
||||
</DialogContent>
|
||||
);
|
||||
|
||||
@@ -22,7 +22,7 @@ export function TimezoneSelect({
|
||||
...props
|
||||
}: SelectProps & { variant?: "default" | "minimal" }) {
|
||||
const [cities, setCities] = useState<ICity[]>([]);
|
||||
const { data, isLoading } = trpc.viewer.public.cityTimezones.useQuery(undefined, {
|
||||
const { data, isPending } = trpc.viewer.public.cityTimezones.useQuery(undefined, {
|
||||
trpc: { context: { skipBatch: true } },
|
||||
});
|
||||
const handleInputChange = (tz: string) => {
|
||||
@@ -39,8 +39,8 @@ export function TimezoneSelect({
|
||||
<BaseSelect
|
||||
value={value}
|
||||
className={className}
|
||||
isLoading={isLoading}
|
||||
isDisabled={isLoading}
|
||||
isLoading={isPending}
|
||||
isDisabled={isPending}
|
||||
{...reactSelectProps}
|
||||
timezones={{
|
||||
...(data ? addCitiesToDropdown(data) : {}),
|
||||
|
||||
@@ -57,7 +57,7 @@ The `TimezoneSelect` component can be used to display timezone options.
|
||||
"Timezone 2": "City 2",
|
||||
"Timezone 3": "City 3",
|
||||
},
|
||||
isLoading: false,
|
||||
isPending: false,
|
||||
}}
|
||||
argTypes={{
|
||||
value: {
|
||||
|
||||
@@ -14,9 +14,9 @@ type DefaultStep = {
|
||||
containerClassname?: string;
|
||||
contentClassname?: string;
|
||||
description: string;
|
||||
content?: ((setIsLoading: Dispatch<SetStateAction<boolean>>) => JSX.Element) | JSX.Element;
|
||||
content?: ((setIsPending: Dispatch<SetStateAction<boolean>>) => JSX.Element) | JSX.Element;
|
||||
isEnabled?: boolean;
|
||||
isLoading?: boolean;
|
||||
isPending?: boolean;
|
||||
};
|
||||
|
||||
function WizardForm<T extends DefaultStep>(props: {
|
||||
@@ -37,10 +37,10 @@ function WizardForm<T extends DefaultStep>(props: {
|
||||
const setStep = (newStep: number) => {
|
||||
router.replace(`${href}?step=${newStep || 1}`);
|
||||
};
|
||||
const [currentStepIsLoading, setCurrentStepIsLoading] = useState(false);
|
||||
const [currentStepisPending, setCurrentStepisPending] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setCurrentStepIsLoading(false);
|
||||
setCurrentStepisPending(false);
|
||||
}, [currentStep]);
|
||||
|
||||
return (
|
||||
@@ -67,7 +67,7 @@ function WizardForm<T extends DefaultStep>(props: {
|
||||
<div className={classNames("mb-8 overflow-hidden md:w-[700px]", props.containerClassname)}>
|
||||
<div className={classNames("print:p-none max-w-3xl px-8 py-5 sm:p-6", currentStep.contentClassname)}>
|
||||
{typeof currentStep.content === "function"
|
||||
? currentStep.content(setCurrentStepIsLoading)
|
||||
? currentStep.content(setCurrentStepisPending)
|
||||
: currentStep.content}
|
||||
</div>
|
||||
{!props.disableNavigation && (
|
||||
@@ -84,7 +84,7 @@ function WizardForm<T extends DefaultStep>(props: {
|
||||
|
||||
<Button
|
||||
tabIndex={0}
|
||||
loading={currentStepIsLoading}
|
||||
loading={currentStepisPending}
|
||||
type="submit"
|
||||
color="primary"
|
||||
form={`wizard-step-${step}`}
|
||||
|
||||
@@ -29,8 +29,8 @@ const steps = [
|
||||
{
|
||||
title: "Step 2",
|
||||
description: "Description 2",
|
||||
content: (setIsLoading: (value: boolean) => void) => (
|
||||
<button data-testid="content-2" onClick={() => setIsLoading(true)}>
|
||||
content: (setIsPending: (value: boolean) => void) => (
|
||||
<button data-testid="content-2" onClick={() => setIsPending(true)}>
|
||||
Test
|
||||
</button>
|
||||
),
|
||||
|
||||
@@ -68,11 +68,15 @@ function BasePhoneInput({ name, className = "", onChange, ...rest }: PhoneInputP
|
||||
|
||||
const useDefaultCountry = () => {
|
||||
const [defaultCountry, setDefaultCountry] = useState("us");
|
||||
trpc.viewer.public.countryCode.useQuery(undefined, {
|
||||
const query = trpc.viewer.public.countryCode.useQuery(undefined, {
|
||||
refetchOnWindowFocus: false,
|
||||
refetchOnReconnect: false,
|
||||
retry: false,
|
||||
onSuccess: (data) => {
|
||||
});
|
||||
|
||||
useEffect(
|
||||
function refactorMeWithoutEffect() {
|
||||
const data = query.data;
|
||||
if (!data?.countryCode) {
|
||||
return;
|
||||
}
|
||||
@@ -81,7 +85,8 @@ const useDefaultCountry = () => {
|
||||
? setDefaultCountry(data.countryCode.toLowerCase())
|
||||
: setDefaultCountry(navigator.language.split("-")[1]?.toLowerCase() || "us");
|
||||
},
|
||||
});
|
||||
[query.data]
|
||||
);
|
||||
|
||||
return defaultCountry;
|
||||
};
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
"@react-icons/all-files": "^4.1.0",
|
||||
"@storybook/blocks": "^7.6.3",
|
||||
"@storybook/react": "^7.6.3",
|
||||
"@tanstack/react-query": "^4.3.9",
|
||||
"@tanstack/react-query": "^5.17.15",
|
||||
"@tanstack/react-table": "^8.9.3",
|
||||
"@wojtekmaj/react-daterange-picker": "^3.3.1",
|
||||
"class-variance-authority": "^0.4.0",
|
||||
|
||||
Reference in new issue
Block a user