diff --git a/app/client/src/components/editorComponents/ActionCreator/Fields.tsx b/app/client/src/components/editorComponents/ActionCreator/Fields.tsx index 068153fcc1..5add9e35d0 100644 --- a/app/client/src/components/editorComponents/ActionCreator/Fields.tsx +++ b/app/client/src/components/editorComponents/ActionCreator/Fields.tsx @@ -358,7 +358,6 @@ export enum FieldType { CLEAR_INTERVAL_ID_FIELD = "CLEAR_INTERVAL_ID_FIELD", MESSAGE_FIELD = "MESSAGE_FIELD", TARGET_ORIGIN_FIELD = "TARGET_ORIGIN_FIELD", - TRANSFER_ARRAY_FIELD = "TRANSFER_ARRAY_FIELD", } type FieldConfig = { @@ -649,15 +648,6 @@ const fieldConfigs: FieldConfigs = { }, view: ViewTypes.TEXT_VIEW, }, - [FieldType.TRANSFER_ARRAY_FIELD]: { - getter: (value: string) => { - return textGetter(value, 2); - }, - setter: (value: string, currentValue: string) => { - return textSetter(value, currentValue, 2); - }, - view: ViewTypes.TEXT_VIEW, - }, }; function renderField(props: { @@ -831,7 +821,6 @@ function renderField(props: { case FieldType.CLEAR_INTERVAL_ID_FIELD: case FieldType.MESSAGE_FIELD: case FieldType.TARGET_ORIGIN_FIELD: - case FieldType.TRANSFER_ARRAY_FIELD: let fieldLabel = ""; if (fieldType === FieldType.ALERT_TEXT_FIELD) { fieldLabel = "Message"; @@ -861,8 +850,6 @@ function renderField(props: { fieldLabel = "Message"; } else if (fieldType === FieldType.TARGET_ORIGIN_FIELD) { fieldLabel = "Target origin"; - } else if (fieldType === FieldType.TRANSFER_ARRAY_FIELD) { - fieldLabel = "Transfer array (optional)"; } viewElement = (view as (props: TextViewProps) => JSX.Element)({ label: fieldLabel, diff --git a/app/client/src/components/editorComponents/ActionCreator/index.tsx b/app/client/src/components/editorComponents/ActionCreator/index.tsx index 4d62d1b1fb..c1d4186ea7 100644 --- a/app/client/src/components/editorComponents/ActionCreator/index.tsx +++ b/app/client/src/components/editorComponents/ActionCreator/index.tsx @@ -387,9 +387,6 @@ function getFieldFromValue( { field: FieldType.TARGET_ORIGIN_FIELD, }, - { - field: FieldType.TRANSFER_ARRAY_FIELD, - }, ); } diff --git a/app/client/src/entities/DataTree/actionTriggers.ts b/app/client/src/entities/DataTree/actionTriggers.ts index d5b5ae97ab..54f118143a 100644 --- a/app/client/src/entities/DataTree/actionTriggers.ts +++ b/app/client/src/entities/DataTree/actionTriggers.ts @@ -173,7 +173,6 @@ export type PostMessageDescription = { payload: { message: any; targetOrigin: string; - transfer?: any[]; }; }; diff --git a/app/client/src/sagas/ActionExecution/ActionExecutionSagas.ts b/app/client/src/sagas/ActionExecution/ActionExecutionSagas.ts index 5b3729e6c4..cb6d1cb3a3 100644 --- a/app/client/src/sagas/ActionExecution/ActionExecutionSagas.ts +++ b/app/client/src/sagas/ActionExecution/ActionExecutionSagas.ts @@ -144,7 +144,7 @@ export function* executeActionTriggers( } break; case ActionTriggerType.POST_MESSAGE: - yield call(postMessageSaga, trigger.payload); + yield call(postMessageSaga, trigger.payload, triggerMeta); break; default: log.error("Trigger type unknown", trigger); diff --git a/app/client/src/sagas/ActionExecution/PostMessageSaga.ts b/app/client/src/sagas/ActionExecution/PostMessageSaga.ts index b2699e4af1..51e0499616 100644 --- a/app/client/src/sagas/ActionExecution/PostMessageSaga.ts +++ b/app/client/src/sagas/ActionExecution/PostMessageSaga.ts @@ -1,16 +1,27 @@ import { spawn } from "redux-saga/effects"; import { PostMessageDescription } from "../../entities/DataTree/actionTriggers"; -import { TriggerFailureError } from "sagas/ActionExecution/errorUtils"; +import { logActionExecutionError } from "sagas/ActionExecution/errorUtils"; +import { TriggerMeta } from "./ActionExecutionSagas"; -export function* postMessageSaga(payload: PostMessageDescription["payload"]) { - yield spawn(executePostMessage, payload); +export function* postMessageSaga( + payload: PostMessageDescription["payload"], + triggerMeta: TriggerMeta, +) { + yield spawn(executePostMessage, payload, triggerMeta); } -function* executePostMessage(payload: PostMessageDescription["payload"]) { - const { message, targetOrigin, transfer } = payload; +function* executePostMessage( + payload: PostMessageDescription["payload"], + triggerMeta: TriggerMeta, +) { + const { message, targetOrigin } = payload; try { - window.parent.postMessage(message, targetOrigin, transfer || undefined); + window.parent.postMessage(message, targetOrigin, undefined); } catch (error) { - throw new TriggerFailureError(error.message); + logActionExecutionError( + error.message, + triggerMeta.source, + triggerMeta.triggerPropertyName, + ); } } diff --git a/app/client/src/workers/Actions.ts b/app/client/src/workers/Actions.ts index 4a550814c2..795d12bf13 100644 --- a/app/client/src/workers/Actions.ts +++ b/app/client/src/workers/Actions.ts @@ -261,17 +261,12 @@ const DATA_TREE_FUNCTIONS: Record< }; }, }, - postMessageToTargetWindow: function( - message: any, - targetOrigin: string, - transfer?: any[], - ) { + postMessageToTargetWindow: function(message: any, targetOrigin: string) { return { type: ActionTriggerType.POST_MESSAGE, payload: { message, targetOrigin, - transfer, }, executionType: ExecutionType.TRIGGER, };