From e31f526618e680d4a04bb212e49aecc8f7946347 Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Thu, 10 Oct 2019 08:21:10 -0700 Subject: [PATCH] Send flipper trace as a separate message Summary: This diff sends flipper trace as a separate message so that the form can update the state which can be used for validation. If the user doesn't click on "Flipper Trace" then it will show a validation error. WWW side changes are here D17810526. Merge this diff only when www is landed. Reviewed By: jknoxville Differential Revision: D17812023 fbshipit-source-id: 35f17f9e58fc08cde3928072dc66758b1c507bcb --- src/utils/supportRequestsFormUtils.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/utils/supportRequestsFormUtils.tsx b/src/utils/supportRequestsFormUtils.tsx index bd8a0bd06..808dbc8d2 100644 --- a/src/utils/supportRequestsFormUtils.tsx +++ b/src/utils/supportRequestsFormUtils.tsx @@ -32,6 +32,21 @@ export function appendTextInQuestionsField(webview: WebviewTag, text: string) { }); } +/** + * + * @param webview + * @param text + * This helper function is for appending flipper trace in the questions input text field. + * It also updates the Flipper trace state in the form which makes it pass the validation. + * One should use it only for the pages backed by NTUsersFormContainer.react.js + */ +export function sendFlipperTrace(webview: WebviewTag, text: string) { + webview.send('hostMessage', { + type: 'flipperTrace', + payload: text, + }); +} + /** * * @param webview