Adds "Upgrade" paywall to Workflow SMS features instead of disabling them (#6412)

* adds upgrade badge to dropdown

* add space between batch and check

* add upgrade tool tip

* fix import

* code clean up

* fix type error

* fix type error

* fix type errors

Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2023-01-11 18:41:45 +00:00
1 parent c8744768c4
commit 161f5c7000
5 files changed
+33 -7

No files matched your search

@@ -136,8 +136,8 @@ export const AddActionDialog = (props: IAddActionDialog) => {
isOptionDisabled={(option: {
label: string;
value: WorkflowActions;
disabled: boolean;
}) => option.disabled}
needsUpgrade: boolean;
}) => option.needsUpgrade}
/>
);
}}
@@ -36,6 +36,7 @@ import {
TextField,
Editor,
AddVariablesDropdown,
Tooltip,
} from "@calcom/ui";
import { DYNAMIC_TEXT_VARIABLES } from "../lib/constants";
@@ -54,6 +55,7 @@ type WorkflowStepProps = {
export default function WorkflowStepContainer(props: WorkflowStepProps) {
const { t, i18n } = useLocale();
const utils = trpc.useContext();
const { step, form, reload, setReload } = props;
const { data: _verifiedNumbers } = trpc.viewer.workflows.getVerifiedNumbers.useQuery();
const verifiedNumbers = _verifiedNumbers?.map((number) => number.phoneNumber);
@@ -264,7 +266,7 @@ export default function WorkflowStepContainer(props: WorkflowStepProps) {
const selectedAction = {
label: actionString.charAt(0).toUpperCase() + actionString.slice(1),
value: step.action,
disabled: false,
needsUpgrade: false,
};
const selectedTemplate = { label: t(`${step.template.toLowerCase()}`), value: step.template };
@@ -382,8 +384,8 @@ export default function WorkflowStepContainer(props: WorkflowStepProps) {
isOptionDisabled={(option: {
label: string;
value: WorkflowActions;
disabled: boolean;
}) => option.disabled}
needsUpgrade: boolean;
}) => option.needsUpgrade}
/>
);
}}
@@ -13,7 +13,7 @@ export function getWorkflowActionOptions(t: TFunction, isTeamsPlan?: boolean) {
return {
label: actionString.charAt(0).toUpperCase() + actionString.slice(1),
value: action,
disabled: isSMSAction && !isTeamsPlan,
needsUpgrade: isSMSAction && !isTeamsPlan,
};
});
}