PromucFlow_constructor/app/client/cypress/support/Pages
Rimil Dey 42b913cef8
feat: Add postMessage as a global function (#14925)
## Description

**Revert Context -** 

Reverts appsmithorg/appsmith#14890 (We had to revert the PR as we got some suggestions on improving the feature - now reverting the revert so we can have this feature out with improvements)

**PR Context -** 
This pull request exposes window.postMessage() as a global function in the Appsmith platform.

Post message safely enables cross-origin communication between window objects.
Example use-case - Appsmith page embedded within an iframe which communicates with the container website

Diagram for all the different levels of communication - 
![Untitled-2022-09-12-1205](https://user-images.githubusercontent.com/10229595/189592030-98bc29ac-b94e-4c75-8567-965757cc0d18.png)



**More on post message here** - https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage

**References used for this PR:**

1. Geolocation APIs - https://github.com/appsmithorg/appsmith/pull/9295
2. setInterval and clearInterval support - https://github.com/appsmithorg/appsmith/pull/8158

**Fixes** https://github.com/appsmithorg/appsmith/issues/7241

## Type of change

- New feature (non-breaking change which adds functionality)

## How Has This Been Tested?

Test plan 
- **Manual**: Created an app with different buttons holding different types of data and embedded it in a code sandbox within an iframe. Also removed the target origin which throws an error (App link - https://dev.appsmith.com/app/post-msg-app/page1-624c1af4d8e632741017682e, Codesandbox link - https://codesandbox.io/s/compassionate-tdd-6dnzzd?file=/src/index.js)
- Added Jest tests
- https://github.com/appsmithorg/TestSmith/issues/1892
- https://github.com/appsmithorg/TestSmith/issues/2068
- https://github.com/appsmithorg/TestSmith/issues/2069

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes

Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2022-10-20 12:39:42 +05:30
..
AggregateHelper.ts feat: Add postMessage as a global function (#14925) 2022-10-20 12:39:42 +05:30
ApiPage.ts fix: adding mode for graphql syntax with dynamic bindings (#17229) 2022-10-08 03:17:07 +01:00
DataSources.ts feat: Adds one way switching to Form Controls (#17194) 2022-10-13 21:28:46 +01:00
DeployModeHelper.ts test: Script updates for flaky tests to unblock CI (#17264) 2022-10-03 15:25:11 +05:30
EntityExplorer.ts feat: Maintain Focus and Context Phase 1 (#16317) 2022-10-17 20:46:38 +05:30
FakerHelper.ts test: Script updates for flaky tests (#16631) 2022-09-12 09:48:44 +05:30
GitSync.ts fix: Blocks shortcut action execution when git modal is open (#16248) 2022-09-01 22:55:22 +02:00
HomePage.ts test: Add cypress tests for leave workspace flow (#17354) 2022-10-13 12:14:39 +00:00
JSEditor.ts test: Script updates for flaky tests to unblock CI (#17469) 2022-10-13 12:54:09 +05:30
PropertyPane.ts feat: Maintain Focus and Context Phase 1 (#16317) 2022-10-17 20:46:38 +05:30
Table.ts test: Script updates for flaky tests (#16355) 2022-09-02 06:35:45 +05:30
TableV2.ts feat: Autoassigns column datatype in table widget (#16701) 2022-09-29 10:56:08 +05:30