Commit Graph

16 Commits

Author SHA1 Message Date
subratadeypappu
0ae19d6d32
fix: Unblocking CI - Unexpected cyclic dependency error and Lint spec fixes (#20260)
## Description
This PR fixes the false cyclic dependency error Cypress tests and the
basic Lint error Cypress tests.

> Add a TL;DR when description is extra long (helps content team)

Fixes # (issue)
> if no issue exists, please create an issue and ask the maintainers
about this first


Media
> A video or a GIF is preferred. when using Loom, don’t embed because it
looks like it’s a GIF. instead, just link to the video


## Type of change

> Please delete options that are not relevant.

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- Chore (housekeeping or task changes that don't impact user perception)
- This change requires a documentation update


## How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Provide
instructions, so we can reproduce.
> Please also list any relevant details for your test configuration.
> Delete anything that is not important

- Manual
- Jest
- Cypress

### Test Plan
> Add Testsmith test cases links that relate to this PR

### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)


## Checklist:
### Dev activity
- [ ] 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
- [ ] PR is being merged under a feature flag


### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test

---------

Co-authored-by: ChandanBalajiBP <104058110+ChandanBalajiBP@users.noreply.github.com>
2023-01-31 20:33:10 +06:00
Favour Ohanekwu
645e35a8e1
chore: Add eslint and prettier config to shared module (#19939)
## Description

To maintain consistency in output and prevention of unnecessary code
edits, this PR adds eslint and prettier config to the shared module.

Fixes # (issue)
> if no issue exists, please create an issue and ask the maintainers
about this first


Media
> A video or a GIF is preferred. when using Loom, don’t embed because it
looks like it’s a GIF. instead, just link to the video


## Type of change

> Please delete options that are not relevant.

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- Chore (housekeeping or task changes that don't impact user perception)
- This change requires a documentation update


## How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Provide
instructions, so we can reproduce.
> Please also list any relevant details for your test configuration.
> Delete anything that is not important

- Manual
- Jest
- Cypress

### Test Plan
> Add Testsmith test cases links that relate to this PR

### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)


## Checklist:
### Dev activity
- [ ] 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
- [ ] PR is being merged under a feature flag


### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-01-20 18:17:24 +05:30
Favour Ohanekwu
ad470d6502
fix: prevent invalid property assesment lint error (#19919) 2023-01-20 13:36:54 +01:00
dependabot[bot]
1397384812
chore: bump json5 from 2.2.1 to 2.2.3 in /app/shared/ast (#19431)
Bumps [json5](https://github.com/json5/json5) from 2.2.1 to 2.2.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/json5/json5/releases">json5's releases</a>.</em></p>
<blockquote>
<h2>v2.2.3</h2>
<ul>
<li>Fix: json5@2.2.3 is now the 'latest' release according to npm instead of v1.0.2. (<a href="https://github-redirect.dependabot.com/json5/json5/issues/299">#299</a>)</li>
</ul>
<h2>v2.2.2</h2>
<ul>
<li>Fix: Properties with the name <code>__proto__</code> are added to objects and arrays.
(<a href="https://github-redirect.dependabot.com/json5/json5/issues/199">#199</a>) This also fixes a prototype pollution vulnerability reported by
Jonathan Gregson! (<a href="https://github-redirect.dependabot.com/json5/json5/issues/295">#295</a>).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/json5/json5/blob/main/CHANGELOG.md">json5's changelog</a>.</em></p>
<blockquote>
<h3>v2.2.3 [<a href="https://github.com/json5/json5/tree/v2.2.3">code</a>, <a href="https://github.com/json5/json5/compare/v2.2.2...v2.2.3">diff</a>]</h3>
<ul>
<li>Fix: json5@2.2.3 is now the 'latest' release according to npm instead of
v1.0.2. (<a href="https://github-redirect.dependabot.com/json5/json5/issues/299">#299</a>)</li>
</ul>
<h3>v2.2.2 [<a href="https://github.com/json5/json5/tree/v2.2.2">code</a>, <a href="https://github.com/json5/json5/compare/v2.2.1...v2.2.2">diff</a>]</h3>
<ul>
<li>Fix: Properties with the name <code>__proto__</code> are added to objects and arrays.
(<a href="https://github-redirect.dependabot.com/json5/json5/issues/199">#199</a>) This also fixes a prototype pollution vulnerability reported by
Jonathan Gregson! (<a href="https://github-redirect.dependabot.com/json5/json5/issues/295">#295</a>).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="c3a7524277"><code>c3a7524</code></a> 2.2.3</li>
<li><a href="94fd06d82e"><code>94fd06d</code></a> docs: update CHANGELOG for v2.2.3</li>
<li><a href="3b8cebf0c4"><code>3b8cebf</code></a> docs(security): use GitHub security advisories</li>
<li><a href="f0fd9e194d"><code>f0fd9e1</code></a> docs: publish a security policy</li>
<li><a href="6a91a05fff"><code>6a91a05</code></a> docs(template): bug -&gt; bug report</li>
<li><a href="14f8cb186e"><code>14f8cb1</code></a> 2.2.2</li>
<li><a href="10cc7ca916"><code>10cc7ca</code></a> docs: update CHANGELOG for v2.2.2</li>
<li><a href="7774c10979"><code>7774c10</code></a> fix: add <strong>proto</strong> to objects and arrays</li>
<li><a href="edde30abd8"><code>edde30a</code></a> Readme: slight tweak to intro</li>
<li><a href="97286f8bd5"><code>97286f8</code></a> Improve example in readme</li>
<li>Additional commits viewable in <a href="https://github.com/json5/json5/compare/v2.2.1...v2.2.3">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=json5&package-manager=npm_and_yarn&previous-version=2.2.1&new-version=2.2.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/appsmithorg/appsmith/network/alerts).

</details>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-02 18:24:57 +05:30
Rimil Dey
d0ceef7593
revert: Parse js actions for view mode changes (#19033)
Revert "fix: Parse js actions for view mode changes (#18357)"

This reverts commit efa8b68a47.
2022-12-21 10:27:55 +05:30
Apeksha Bhosale
efa8b68a47
fix: Parse js actions for view mode changes (#18357)
* added new function inside parse js actions for view moe

* fixing test cases

* added evaluateSync with isTriggered false

* Add types
Add switch case for diff.event
Add function get back app mode

* Change foreach loops to for of

* Dont return jsUpdates from view mode save resolved since no operation is happening
Change viewModeSaveResolvedFunctionsAndJSUpdates -> viewModeSaveResolvedFunctions to reflect
what it's functionality is

* Refactor JSObject code

* Refactor code for JSobject
* remove any
* export parsed object's type from ast
* create function for deleteResolvedFunctionsAndCurrentJSCollectionState

* Code review changes

* Fix tests

* Change returns in for of loops to continue
Remove try for evaluate sync
Js updates return

* Fix bug

* Fix bug

Co-authored-by: Rimil Dey <rimil@appsmith.com>
Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2022-12-12 19:45:40 +05:30
Nidhi
5329010415
fix: Refactor entities based on AST parsing logic (#18517)
* feat: Refactor entities based on AST parsing logic

* Deleted jmh file

* rts updates for the edge cases

* adding jest test cases

* update review comments

* Fixed issue with references outside of bindings and some other stuff

* Added tests for DSLUtils

* bug fix 18699

* Test fixes

* Test fixes

* Review comments

* Changed type to boxed

Co-authored-by: ChandanBalajiBP <chandan@appsmith.com>
Co-authored-by: ChandanBalajiBP <104058110+ChandanBalajiBP@users.noreply.github.com>
2022-12-12 08:12:21 +03:00
ChandanBalajiBP
2184eb8acd
fix: Instrumentation for execution errors (#18093)
* fix: Instrumentation for execution errors

* added widget editor error event
2022-11-14 14:01:55 +07:00
Nidhi
204a187bc2
fix: Refactor entities with specific rules (#17523)
* Refactor changes for DSL

* Spaces

* Action and collection refactor logic

* Changes to some logic for DSL

* Fixed tests, added dynamic trigger path list logic as well

* Added test for dynamicTriggerList condition

* added analytics data to response in ast

* Fix for peer closed connection on AST

* Added comments for clarity

* Added logs for time taken by AST call

* handle export default and update success param accordingly

* updates for review comments

Co-authored-by: ChandanBalajiBP <chandan@appsmith.com>
2022-10-26 20:23:06 +05:30
ChandanBalajiBP
e5cdfbe445
feat: AST based entity refactor (#17434)
* task: AST based entity refactor

* implemented refactor logic

* jest cases with string manipulation using AST logic

* comments and indentation

* added evalVersion to request
2022-10-18 12:07:06 +05:30
Aman Agarwal
7ecb5e1c19
fix: workflow for shared modules testing (#16778)
* fix: workflow for shared modules testing
2022-09-30 18:36:25 +05:30
Ayangade Adeoluwa
610509506e
fix: update rts logic to use updated shared AST logic (#16849)
* update rts logic to use updated shared AST logic

* Make changes to naming conventions

* Add test cases for RTS and rename ast functions

* Add running jest test to RTS workflow

* Install dependencies and then trigger jest tests in workflow

* Close server connection after test ends

* Remove logs

* Improve jest test descriptions
2022-09-28 17:28:18 +00:00
Favour Ohanekwu
d6fbdb15b9
feat: Linting in entity properties and methods (#16171)
* Initial commit

* Remove arrow function params from identifiers

* Remove invalid identifiers from extracted identifiers

* Remove invalid identifiers which are derived from function params and variable declarations

* Fix typo error

* Correctly remove invalid identifiers

* Remove invalid names from identifier list

* fix build failure

* Add Promise to list of unacceptable entity name

* Keep track of unreferenced identifiers in bindings

* Add Global scope object names as unusable entity names

* Keep track of unreferenced identifiers

* Prevent traversal of data tree for addition of new paths and entities

* Sync linting in trigger fields

* Support linting of invalid properties

* Fix linting reactivity bug in trigger field

* Remove unused objects

* Fix conflict in merging

* Lint jsobject body for function change

* Remove unused map from tests

* Code cleanup

* Modify jest tests

* Update jest tests

* Fix cypress tests

* Code cleanup

* Support  linting of multiple bindings

* Set squiggle line as long as invalid property length

* Add jest tests

* Minor code refactor

* Move ast to shared repo

* Rename confusing identifiers

* Improve naming of functions and their return values

* move shared widget validation utils and constants to shared folder

* Add jest test for invalid entity names

* Add cypress tests

* Modify test comment

* Extend list of dedicated worker scope identifiers

* Resolve code review comments

* Resolve review comments

* Annonate code where necessary

* Code refactor

* Improve worker global scope object

* Code refactor

* Fix merge conflict

* Code refactor

* Minor bug fix

* Redundant commit to retrigger vercel build

* Add null checks to dependecy chain
2022-09-17 18:40:28 +01:00
Ayangade Adeoluwa
b3c4f7c392
feat: AST apis for parsing script and returning identifiers (#16252)
* rts configurations for ast

* update shared dependencies.json for shared ast module

* feat: api for script to identifiers

* fix: typo for identifiers

* feat: api for multiple scripts to get identifiers

* fix: rts config, apis for ast

* fix: removed unnecessary changes for ast modules

* fix: docker image for rts including ast shared module, rts file alias ref

* fix: added comments in build.sh file

Co-authored-by: Aman Agarwal <aman@appsmith.com>
2022-09-12 14:45:47 +05:30
Ayangade Adeoluwa
3de00c6bf4
feat: Extraction of AST Logic (#15892)
* POC for Shared AST Logic using Yarn Symlinks

* fix: preinstall script for bundling shared packages

* Merge commit

* fix: updated the script to link, unlink the package as shared dep

* fix: updated dependencies

* Add a post-install script and fix yarn.lock file

* Remove commented code

* fix: added verification script, readme, moved scripts to shared

* Extraction of AST Logic into shared/ast folder

* Add jest test script

* Replace hardcoded ast Logic use with Shared AST module

* Replace parse code with getAST

Co-authored-by: Aman Agarwal <aman@appsmith.com>
2022-08-23 16:39:42 +05:30
Aman Agarwal
3b00508c1e
feat: ast mono repo poc (#15610)
* POC for Shared AST Logic using Yarn Symlinks

* fix: preinstall script for bundling shared packages

* Merge commit

* fix: updated the script to link, unlink the package as shared dep

* fix: updated dependencies

* Add a post-install script and fix yarn.lock file

* Remove commented code

* fix: added verification script, readme, moved scripts to shared

Co-authored-by: Ayangade Adeoluwa <adeoluayangade@yahoo.com>
2022-08-11 20:59:26 +05:30