@streamoid/chat-components 0.2.10 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -25
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -722,31 +722,7 @@ function DynamicForm(props) {
|
|
|
722
722
|
form_title: title,
|
|
723
723
|
values
|
|
724
724
|
};
|
|
725
|
-
const
|
|
726
|
-
for (const [fieldId, val] of Object.entries(values)) {
|
|
727
|
-
const field = fields.find((f) => f.id === fieldId);
|
|
728
|
-
const fieldLabel = field?.label || fieldId;
|
|
729
|
-
let displayVal;
|
|
730
|
-
if (field?.type === "media_approval" && val && typeof val === "object") {
|
|
731
|
-
const mediaVal = val;
|
|
732
|
-
const decisionText = mediaVal.decision ?? "pending";
|
|
733
|
-
const feedbackText = mediaVal.feedback?.trim() || "none";
|
|
734
|
-
const mediaCount = Array.isArray(mediaVal.media_urls) ? mediaVal.media_urls.length : 0;
|
|
735
|
-
displayVal = `decision=${decisionText}, feedback=${feedbackText}, media_count=${mediaCount}`;
|
|
736
|
-
} else if (field?.options && typeof val === "string") {
|
|
737
|
-
const opt = field.options.find((o) => o.id === val);
|
|
738
|
-
displayVal = opt?.label || val;
|
|
739
|
-
} else if (field?.options && Array.isArray(val)) {
|
|
740
|
-
displayVal = val.map((v) => field.options.find((o) => o.id === v)?.label || v).join(", ");
|
|
741
|
-
} else {
|
|
742
|
-
displayVal = String(val ?? "");
|
|
743
|
-
}
|
|
744
|
-
valueSummaryParts.push(`${fieldLabel}: ${displayVal}`);
|
|
745
|
-
}
|
|
746
|
-
const valueSummary = valueSummaryParts.length > 0 ? `
|
|
747
|
-
Submitted values:
|
|
748
|
-
${valueSummaryParts.join("\n")}` : "";
|
|
749
|
-
const messageText = `User clicked "${userAction}" on form "${title}"${valueSummary}`;
|
|
725
|
+
const messageText = `User clicked "${userAction}" on form "${title}"`;
|
|
750
726
|
try {
|
|
751
727
|
await onSubmit(resumePayload, messageText);
|
|
752
728
|
setSubmittedData({ user_action: userAction, values });
|
package/package.json
CHANGED