fix: remove kyc and make text messages to attendee org only (#11389)

* add orgs upgrade badge to select

* don't allow updating to if no teams or orgs plan

* make sure only paying users can request verification codes

* add new action helper function

* remove kyc code

* code clean up

* fix verify button UI

* fix type errors

* add eventTypeRequiresConfirmation everywhere

* address feedback

---------

Co-authored-by: CarinaWolli <[email protected]>
This commit is contained in:
Carina WollendorferandCarinaWolli authored and GitHub committed 2023-09-20 23:22:05 -07:00
1 parent 96263b0cf7
commit 3b50fe075d
30 files changed
+89 -542

No files matched your search

@@ -1,20 +0,0 @@
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Tooltip } from "../tooltip";
import { Badge } from "./Badge";
export const KYCVerificationBadge = function KYCVerificationBadge(props: { verifyTeamAction?: () => void }) {
const { verifyTeamAction } = props;
const { t } = useLocale();
if (!verifyTeamAction) return <></>;
return (
<>
<Tooltip content={t("verify_team_tooltip")}>
<Badge variant="gray" onClick={() => verifyTeamAction()}>
{t("verify_account")}
</Badge>
</Tooltip>
</>
);
};
@@ -0,0 +1,16 @@
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Tooltip } from "../tooltip";
import { Badge } from "./Badge";
export const UpgradeOrgsBadge = function UpgradeOrgsBadge() {
const { t } = useLocale();
return (
<Tooltip content={t("orgs_upgrade_to_enable_feature")}>
<a href="https://cal.com/enterprise" target="_blank">
<Badge variant="gray">{t("upgrade")}</Badge>
</a>
</Tooltip>
);
};
+1 -1
View File
@@ -1,5 +1,5 @@
export { Badge } from "./Badge";
export { UpgradeTeamsBadge } from "./UpgradeTeamsBadge";
export { KYCVerificationBadge } from "./KYCVerificationBadge";
export { UpgradeOrgsBadge } from "./UpgradeOrgsBadge";
export type { BadgeProps } from "./Badge";
@@ -3,7 +3,7 @@ import { components as reactSelectComponents } from "react-select";
import { classNames } from "@calcom/lib";
import { UpgradeTeamsBadge, KYCVerificationBadge } from "../../badge";
import { UpgradeTeamsBadge, UpgradeOrgsBadge } from "../../badge";
import { Check } from "../../icon";
export const InputComponent = <
@@ -29,9 +29,8 @@ export const InputComponent = <
type ExtendedOption = {
value: string | number;
label: string;
needsUpgrade?: boolean;
needsVerification?: boolean;
verificationAction?: () => void;
needsTeamsUpgrade?: boolean;
needsOrgsUpgrade?: boolean;
};
export const OptionComponent = <
@@ -48,12 +47,10 @@ export const OptionComponent = <
<span className="mr-auto" data-testid={`select-option-${(props as unknown as ExtendedOption).value}`}>
{props.label || <>&nbsp;</>}
</span>
{(props.data as unknown as ExtendedOption).needsUpgrade ? (
{(props.data as unknown as ExtendedOption).needsTeamsUpgrade ? (
<UpgradeTeamsBadge />
) : (props.data as unknown as ExtendedOption).needsVerification ? (
<KYCVerificationBadge
verifyTeamAction={(props.data as unknown as ExtendedOption).verificationAction}
/>
) : (props.data as unknown as ExtendedOption).needsOrgsUpgrade ? (
<UpgradeOrgsBadge />
) : (
<></>
)}