chore: plain text plugin for Editor (#17134)
* chore: plain text plugin for Editor * fix build error
This commit is contained in:
1 parent
aaa75100d4
commit
cd15335eed
4 files changed
+34
-9
No files matched your search
@@ -10,9 +10,7 @@ import { classNames } from "@calcom/lib";
|
||||
import { SENDER_ID, SENDER_NAME } from "@calcom/lib/constants";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { HttpError } from "@calcom/lib/http-error";
|
||||
import { md } from "@calcom/lib/markdownIt";
|
||||
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
|
||||
import turndown from "@calcom/lib/turndownService";
|
||||
import { TimeUnit, WorkflowActions, WorkflowTemplates, WorkflowTriggerEvents } from "@calcom/prisma/enums";
|
||||
import type { RouterOutputs } from "@calcom/trpc/react";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
@@ -917,14 +915,10 @@ export default function WorkflowStepContainer(props: WorkflowStepProps) {
|
||||
</div>
|
||||
<Editor
|
||||
getText={() => {
|
||||
return md.render(props.form.getValues(`steps.${step.stepNumber - 1}.reminderBody`) || "");
|
||||
return props.form.getValues(`steps.${step.stepNumber - 1}.reminderBody`) || "";
|
||||
}}
|
||||
setText={(text: string) => {
|
||||
if (isSMSOrWhatsappAction(step.action)) {
|
||||
props.form.setValue(`steps.${step.stepNumber - 1}.reminderBody`, turndown(text));
|
||||
} else {
|
||||
props.form.setValue(`steps.${step.stepNumber - 1}.reminderBody`, text);
|
||||
}
|
||||
props.form.setValue(`steps.${step.stepNumber - 1}.reminderBody`, text);
|
||||
props.form.clearErrors();
|
||||
}}
|
||||
variables={DYNAMIC_TEXT_VARIABLES}
|
||||
@@ -937,6 +931,7 @@ export default function WorkflowStepContainer(props: WorkflowStepProps) {
|
||||
excludedToolbarItems={
|
||||
!isSMSAction(step.action) ? [] : ["blockType", "bold", "italic", "link"]
|
||||
}
|
||||
plainText={isSMSAction(step.action)}
|
||||
/>
|
||||
|
||||
{form.formState.errors.steps &&
|
||||
|
||||
Reference in new issue
Block a user