[CAL-216] Confirming a booking shows old toast. Also removes old notification component. (#5146)
Co-authored-by: gitstart <[email protected]> Co-authored-by: MuriloAmarals <[email protected]> Co-authored-by: Murilo Amaral <[email protected]> Co-authored-by: Rubens Rafael <[email protected]> Co-authored-by: Thiago Nascimbeni <[email protected]> Co-authored-by: Rafael Toledo <[email protected]> Co-authored-by: gitstart <[email protected]> Co-authored-by: Rafael <[email protected]> Co-authored-by: Grace Nshokano <[email protected]> Co-authored-by: Matheus Muniz <[email protected]> Co-authored-by: Júlio Piubello da Silva Cabral <[email protected]> Co-authored-by: Matheus Muniz <[email protected]> Co-authored-by: Matheus Benini Ferreira <[email protected]> Co-authored-by: Nitesh Singh <[email protected]> Co-authored-by: C000Ldude <[email protected]> Co-authored-by: Klinger Matheus <[email protected]> Co-authored-by: Eman <[email protected]>
This commit is contained in:
36 files changed
+35
-85
No files matched your search
@@ -7,9 +7,9 @@ import { Toaster } from "react-hot-toast";
|
||||
import z from "zod";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import showToast from "@calcom/lib/notification";
|
||||
import Button from "@calcom/ui/v2/core/Button";
|
||||
import { Form, TextField } from "@calcom/ui/v2/core/form/fields";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
|
||||
const formSchema = z.object({
|
||||
api_key: z.string(),
|
||||
|
||||
@@ -10,11 +10,11 @@ import CustomBranding from "@calcom/lib/CustomBranding";
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import useTheme from "@calcom/lib/hooks/useTheme";
|
||||
import showToast from "@calcom/lib/notification";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { AppGetServerSidePropsContext, AppPrisma } from "@calcom/types/AppGetServerSideProps";
|
||||
import { inferSSRProps } from "@calcom/types/inferSSRProps";
|
||||
import { Button } from "@calcom/ui/v2/";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
|
||||
import { useExposePlanGlobally } from "@lib/hooks/useExposePlanGlobally";
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@ import { configureChains, createClient, WagmiConfig } from "wagmi";
|
||||
import { useAccount, useSignMessage } from "wagmi";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import showToast from "@calcom/lib/notification";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { SkeletonText } from "@calcom/ui";
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
|
||||
import { getProviders, ETH_MESSAGE, SUPPORTED_CHAINS } from "../utils/ethereum";
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import showToast from "@calcom/lib/notification";
|
||||
import { Button, Select } from "@calcom/ui";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
|
||||
export interface IAppConfigurationProps {
|
||||
credentialIds: number[];
|
||||
|
||||
@@ -5,10 +5,10 @@ import { Dispatch, SetStateAction, useState } from "react";
|
||||
import dayjs from "@calcom/dayjs";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import showToast from "@calcom/lib/notification";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { Dialog, DialogContent, DialogFooter, DialogHeader } from "@calcom/ui/Dialog";
|
||||
import Button from "@calcom/ui/v2/core/Button";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
|
||||
interface IConfirmDialogWipe {
|
||||
isOpenDialog: boolean;
|
||||
|
||||
@@ -5,9 +5,9 @@ import { useState } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import showToast from "@calcom/lib/notification";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { Button, Loader, Tooltip } from "@calcom/ui";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
|
||||
export interface IZapierSetupProps {
|
||||
inviteLink: string;
|
||||
|
||||
@@ -3,7 +3,6 @@ import { Controller, useForm } from "react-hook-form";
|
||||
|
||||
import dayjs from "@calcom/dayjs";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import showToast from "@calcom/lib/notification";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import Button from "@calcom/ui/Button";
|
||||
import { DialogFooter } from "@calcom/ui/Dialog";
|
||||
@@ -12,6 +11,7 @@ import Switch from "@calcom/ui/Switch";
|
||||
import { Tooltip } from "@calcom/ui/Tooltip";
|
||||
import { Form, TextField } from "@calcom/ui/form/fields";
|
||||
import { DatePicker } from "@calcom/ui/v2";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
|
||||
import LicenseRequired from "../../common/components/LicenseRequired";
|
||||
import type { TApiKeys } from "./ApiKeyListItem";
|
||||
|
||||
@@ -5,7 +5,6 @@ import dayjs from "@calcom/dayjs";
|
||||
import { TApiKeys } from "@calcom/ee/api-keys/components/ApiKeyListItem";
|
||||
import LicenseRequired from "@calcom/ee/common/components/v2/LicenseRequired";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import showToast from "@calcom/lib/notification";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { DialogFooter } from "@calcom/ui/Dialog";
|
||||
import { ClipboardCopyIcon } from "@calcom/ui/Icon";
|
||||
@@ -14,6 +13,7 @@ import { DatePicker } from "@calcom/ui/v2";
|
||||
import Button from "@calcom/ui/v2/core/Button";
|
||||
import Switch from "@calcom/ui/v2/core/Switch";
|
||||
import { Form, TextField } from "@calcom/ui/v2/core/form/fields";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
|
||||
export default function ApiKeyDialogForm({
|
||||
defaultValues,
|
||||
|
||||
@@ -3,10 +3,10 @@ import { useChat } from "react-live-chat-loader";
|
||||
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import showToast from "@calcom/lib/notification";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import Button from "@calcom/ui/v2/core/Button";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
|
||||
import ContactMenuItem from "./ContactMenuItem";
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import { z } from "zod";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { HttpError } from "@calcom/lib/http-error";
|
||||
import showToast from "@calcom/lib/notification";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { Button } from "@calcom/ui";
|
||||
import { Dialog, DialogClose, DialogContent, DialogTrigger } from "@calcom/ui/Dialog";
|
||||
@@ -16,6 +15,7 @@ import { Icon } from "@calcom/ui/Icon";
|
||||
import PhoneInput from "@calcom/ui/form/PhoneInputLazy";
|
||||
import Select from "@calcom/ui/form/Select";
|
||||
import { Form, TextField } from "@calcom/ui/form/fields";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
|
||||
import { TIME_UNIT, WORKFLOW_ACTIONS, WORKFLOW_TRIGGER_EVENTS } from "../lib/constants";
|
||||
import {
|
||||
|
||||
@@ -6,11 +6,11 @@ import { Controller, UseFormReturn } from "react-hook-form";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { HttpError } from "@calcom/lib/http-error";
|
||||
import showToast from "@calcom/lib/notification";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { Button } from "@calcom/ui";
|
||||
import MultiSelectCheckboxes, { Option } from "@calcom/ui/form/MultiSelectCheckboxes";
|
||||
import { Form } from "@calcom/ui/form/fields";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
|
||||
import type { FormValues } from "../pages/workflow";
|
||||
import { AddActionDialog } from "./AddActionDialog";
|
||||
|
||||
@@ -3,7 +3,6 @@ import { useState } from "react";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { HttpError } from "@calcom/lib/http-error";
|
||||
import showToast from "@calcom/lib/notification";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { Button, Tooltip } from "@calcom/ui";
|
||||
import ConfirmationDialogContent from "@calcom/ui/ConfirmationDialogContent";
|
||||
@@ -11,6 +10,7 @@ import { Dialog } from "@calcom/ui/Dialog";
|
||||
import Dropdown, { DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@calcom/ui/Dropdown";
|
||||
import EmptyScreen from "@calcom/ui/EmptyScreen";
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
|
||||
import { WorkflowType } from "./v2/WorkflowListPage";
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ import "react-phone-number-input/style.css";
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { HttpError } from "@calcom/lib/http-error";
|
||||
import showToast from "@calcom/lib/notification";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { Button } from "@calcom/ui";
|
||||
import ConfirmationDialogContent from "@calcom/ui/ConfirmationDialogContent";
|
||||
@@ -24,6 +23,7 @@ import Dropdown, { DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger }
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import Select from "@calcom/ui/form/Select";
|
||||
import { TextArea } from "@calcom/ui/form/fields";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
|
||||
import { AddVariablesDropdown } from "../components/AddVariablesDropdown";
|
||||
import {
|
||||
|
||||
@@ -11,7 +11,6 @@ import "react-phone-number-input/style.css";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { HttpError } from "@calcom/lib/http-error";
|
||||
import showToast from "@calcom/lib/notification";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { Dialog } from "@calcom/ui/Dialog";
|
||||
import Dropdown, { DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@calcom/ui/Dropdown";
|
||||
@@ -22,6 +21,7 @@ import ConfirmationDialogContent from "@calcom/ui/v2/core/ConfirmationDialogCont
|
||||
import CheckboxField from "@calcom/ui/v2/core/form/Checkbox";
|
||||
import { EmailField, Label, TextArea } from "@calcom/ui/v2/core/form/fields";
|
||||
import Select from "@calcom/ui/v2/core/form/select";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
|
||||
import { AddVariablesDropdown } from "../../components/v2/AddVariablesDropdown";
|
||||
import {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { useWatch } from "react-hook-form";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import showToast from "@calcom/lib/notification";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { Icon } from "@calcom/ui/Icon";
|
||||
import Badge from "@calcom/ui/v2/core/Badge";
|
||||
import Button from "@calcom/ui/v2/core/Button";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
|
||||
export default function WebhookTestDisclosure() {
|
||||
const subscriberUrl: string = useWatch({ name: "subscriberUrl" });
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
export default function showToast(message: string, variant: "success" | "warning" | "error") {
|
||||
switch (variant) {
|
||||
case "success":
|
||||
toast.success(message, {
|
||||
duration: 6000,
|
||||
style: {
|
||||
borderRadius: "2px",
|
||||
background: "#333",
|
||||
color: "#fff",
|
||||
boxShadow: "none",
|
||||
},
|
||||
className: "data-testid-toast-success",
|
||||
});
|
||||
break;
|
||||
case "error":
|
||||
toast.error(message, {
|
||||
duration: 6000,
|
||||
style: {
|
||||
borderRadius: "2px",
|
||||
background: "#FEE2E2",
|
||||
color: "#B91C1C",
|
||||
boxShadow: "none",
|
||||
},
|
||||
});
|
||||
break;
|
||||
case "warning":
|
||||
toast(message, {
|
||||
duration: 6000,
|
||||
style: {
|
||||
borderRadius: "2px",
|
||||
background: "#FFEDD5",
|
||||
color: "#C2410C",
|
||||
boxShadow: "none",
|
||||
},
|
||||
});
|
||||
break;
|
||||
default:
|
||||
toast.success(message, {
|
||||
duration: 6000,
|
||||
style: {
|
||||
borderRadius: "2px",
|
||||
background: "#333",
|
||||
color: "#fff",
|
||||
boxShadow: "none",
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import { FieldValues, FormProvider, SubmitHandler, useFormContext, UseFormReturn
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import { getErrorFromUnknown } from "@calcom/lib/errors";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import showToast from "@calcom/lib/notification";
|
||||
import showToast from "@calcom/ui/v2/core/notifications";
|
||||
|
||||
import { Alert } from "../Alert";
|
||||
|
||||
|
||||
Reference in new issue
Block a user