Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Geolocation APIs on appsmith #9295

Merged
merged 10 commits into from
Dec 7, 2021
Merged

Conversation

hetunandu
Copy link
Member

@hetunandu hetunandu commented Nov 23, 2021

Description

Expose Geolocation apis to appsmith app developers

Fixes #9207

Type of change

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

How Has This Been Tested?

Checklist:

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

Test coverage results 🧪

🔴 Total coverage has decreased
// Code coverage diff between base branch:release and head branch: feature/geolocaion-api 
Status File % Stmts % Branch % Funcs % Lines
🔴 total 55.06 (-0.07) 36.93 (-0.04) 33.91 (-0.02) 55.58 (-0.07)
✨ 🆕 app/client/src/actions/browserRequestActions.ts 75 100 0 66.67
🔴 app/client/src/components/editorComponents/ActionCreator/Fields.tsx 31.74 (-0.19) 22.03 (-0.13) 7.79 (0) 31.19 (-0.19)
🔴 app/client/src/components/editorComponents/ActionCreator/index.tsx 40.11 (-0.43) 6.72 (-0.12) 40 (0) 40 (-0.44)
🟢 app/client/src/constants/messages.ts 74.11 (0.15) 100 (0) 23.4 (0.44) 79.81 (0.09)
🔴 app/client/src/reducers/entityReducers/appReducer.ts 63.64 (-6.36) 100 (0) 33.33 (-6.67) 63.64 (-6.36)
🔴 app/client/src/sagas/ActionExecution/ActionExecutionSagas.ts 23 (-2.29) 2 (-0.27) 20 (0) 24.21 (-1.67)
✨ 🆕 app/client/src/sagas/ActionExecution/GetCurrentLocationSaga.ts 14.71 0 0 15.87
🟢 app/client/src/selectors/commentsSelectors.ts 85.25 (1.64) 64.71 (2.95) 73.33 (0) 90.59 (2.35)
🔴 app/client/src/utils/autocomplete/EntityDefinitions.ts 27.03 (-1.1) 0 (0) 14.29 (-2.38) 26.47 (-1.12)
🔴 app/client/src/workers/Actions.ts 70.07 (-5.54) 50 (-5) 70 (-10.65) 68.6 (-6.17)
🟢 app/client/src/workers/evaluationUtils.ts 57.46 (0.28) 56.33 (1.9) 62.26 (1.88) 55.19 (0.32)

@hetunandu hetunandu changed the title Geolocation apis on appsmith Geolocation APIs on appsmith Nov 23, 2021
@hetunandu hetunandu changed the title Geolocation APIs on appsmith feat: Geolocation APIs on appsmith Nov 23, 2021
@github-actions
Copy link

Unable to find test scripts. Please add necessary tests to the PR.

1 similar comment
@github-actions
Copy link

Unable to find test scripts. Please add necessary tests to the PR.

@github-actions github-actions bot added the Enhancement New feature or request label Nov 23, 2021
@github-actions
Copy link

Unable to find test scripts. Please add necessary tests to the PR.

@hetunandu
Copy link
Member Author

/ok-to-test sha=d99d133

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/1493827808.
Workflow: Appsmith External Integration Test Workflow.
Commit: d99d133.
PR: 9295.

@hetunandu
Copy link
Member Author

/ok-to-test sha=2fad65b

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/1519808407.
Workflow: Appsmith External Integration Test Workflow.
Commit: 2fad65b.
PR: 9295.

eco-monk
eco-monk previously approved these changes Nov 30, 2021
@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/1519808407.
Workflow: Appsmith External Integration Test Workflow.
Commit: 2fad65b.
PR: 9295.

eco-monk
eco-monk previously approved these changes Dec 7, 2021
@hetunandu
Copy link
Member Author

/ok-to-test sha=d36c9ce

@github-actions
Copy link

github-actions bot commented Dec 7, 2021

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/1548081116.
Workflow: Appsmith External Integration Test Workflow.
Commit: d36c9ce.
PR: 9295.

@hetunandu hetunandu merged commit 7143bba into release Dec 7, 2021
@hetunandu hetunandu deleted the feature/geolocaion-api branch December 7, 2021 10:19
mohanarpit pushed a commit that referenced this pull request Oct 20, 2022
## Description

**Revert Context -** 

Reverts #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 - #9295
2. setInterval and clearInterval support - #8158

**Fixes** #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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Add a method to request for the current location of a user
4 participants