@flozy/editor 2.1.2 → 2.1.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -30,7 +30,7 @@ const FormWorkflow = props => {
|
|
30
30
|
// setBodyData(data);
|
31
31
|
};
|
32
32
|
const onSaveBodyField = data => {
|
33
|
-
let bodyData = typeof data ===
|
33
|
+
let bodyData = typeof data === "string" ? JSON.parse(data) : data;
|
34
34
|
setBodyData(bodyData);
|
35
35
|
};
|
36
36
|
const handleScheduleInstant = event => {
|
@@ -71,11 +71,11 @@ const FormWorkflow = props => {
|
|
71
71
|
children: [/*#__PURE__*/_jsx(Grid, {
|
72
72
|
item: true,
|
73
73
|
sx: classes.radioBtn,
|
74
|
-
children: /*#__PURE__*/
|
74
|
+
children: /*#__PURE__*/_jsx(RadioGroup, {
|
75
75
|
name: "set timing",
|
76
76
|
value: schedule,
|
77
77
|
defaultValue: 1,
|
78
|
-
children:
|
78
|
+
children: /*#__PURE__*/_jsx(FormControlLabel, {
|
79
79
|
value: "immediately",
|
80
80
|
label: "Immediately",
|
81
81
|
onChange: () => {
|
@@ -84,16 +84,7 @@ const FormWorkflow = props => {
|
|
84
84
|
control: /*#__PURE__*/_jsx(Radio, {
|
85
85
|
size: "small"
|
86
86
|
})
|
87
|
-
})
|
88
|
-
value: "after",
|
89
|
-
label: "After",
|
90
|
-
onChange: () => {
|
91
|
-
setSchedule("after");
|
92
|
-
},
|
93
|
-
control: /*#__PURE__*/_jsx(Radio, {
|
94
|
-
size: "small"
|
95
|
-
})
|
96
|
-
})]
|
87
|
+
})
|
97
88
|
})
|
98
89
|
}), schedule === "after" && /*#__PURE__*/_jsx(Grid, {
|
99
90
|
item: true,
|
@@ -158,6 +149,7 @@ const FormWorkflow = props => {
|
|
158
149
|
}), /*#__PURE__*/_jsx(TextField, {
|
159
150
|
multiline: true,
|
160
151
|
margin: "none",
|
152
|
+
id: "email_subject",
|
161
153
|
value: subject,
|
162
154
|
onChange: onSubjectChange,
|
163
155
|
fullWidth: true,
|
@@ -64,7 +64,7 @@ const Workflow = props => {
|
|
64
64
|
};
|
65
65
|
const saveFormWorkflow = () => {
|
66
66
|
let workflowData = [...workflowList];
|
67
|
-
let
|
67
|
+
let subjectText = document?.getElementById('email_subject')?.value;
|
68
68
|
let bodyHtml = document?.getElementsByClassName('editorWorkflow')[0]?.innerHTML;
|
69
69
|
let data = {
|
70
70
|
schedule_type: schedule,
|
@@ -72,7 +72,7 @@ const Workflow = props => {
|
|
72
72
|
schedule_on: schedule === "after" ? scheduleOn : 0,
|
73
73
|
subject_data: subject,
|
74
74
|
body_data: bodyData,
|
75
|
-
|
75
|
+
subject_text: subjectText,
|
76
76
|
body_html: bodyHtml
|
77
77
|
};
|
78
78
|
if (flowEdited.isEdited) {
|
@@ -47,7 +47,8 @@ const withHtml = editor => {
|
|
47
47
|
const slateHTML = data?.getData("application/x-slate-fragment");
|
48
48
|
const html = data?.getData("text/html");
|
49
49
|
const currentEl = getCurrentElement(editor);
|
50
|
-
|
50
|
+
const eltype = currentEl?.type;
|
51
|
+
if (slateHTML && !formatFragment[eltype]) {
|
51
52
|
const [tableNode] = Editor.nodes(editor, {
|
52
53
|
match: n => !Editor.isEditor(n) && Element.isElement(n) && n.type === "table"
|
53
54
|
});
|
@@ -62,7 +63,6 @@ const withHtml = editor => {
|
|
62
63
|
} else if (html) {
|
63
64
|
const parsed = new DOMParser().parseFromString(html, "text/html");
|
64
65
|
const fragment = deserialize(parsed.body);
|
65
|
-
const eltype = currentEl?.type;
|
66
66
|
const formattedFragment = formatFragment[eltype] ? formatFragment[eltype](fragment) : fragment;
|
67
67
|
Transforms.insertFragment(editor, formattedFragment);
|
68
68
|
return;
|