Commit Graph

30 Commits

Author SHA1 Message Date
Ashok Kumar M
353c91b8fa
fix: jest test failures coz of getIsAnvilLayout (#32664)
[![workerB](https://img.shields.io/endpoint?url=https%3A%2F%2Fworkerb.linearb.io%2Fv2%2Fbadge%2Fprivate%2FU2FsdGVkX1JO6UjhWrZEl6JP180WytEbimcxoUzA0%2Fcollaboration.svg%3FcacheSeconds%3D60)](https://workerb.linearb.io/v2/badge/collaboration-page?magicLinkId=8xbfQu9)
## Description
> [!TIP]  
> _Add a TL;DR when the description is longer than 500 words or
extremely technical (helps the content team)._
>
> _Please also include relevant motivation and context. List any
dependencies that are required for this change. Add links to Notion,
Figma or any other documents that might be relevant to the PR._

Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/8679486679>
> Commit: fe97e718498f1974e3604ae20160e99918f9c35c
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8679486679&attempt=1"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->








<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Refactor**
- Simplified the logic for determining the layout system type in the
app.
- **Tests**
- Updated test files to remove unnecessary mock implementations related
to layout system checks.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-04-15 09:17:23 +05:30
Ashok Kumar M
7b527c9024
chore: Merge wds and anvil feature flags (#32609)
[![workerB](https://img.shields.io/endpoint?url=https%3A%2F%2Fworkerb.linearb.io%2Fv2%2Fbadge%2Fprivate%2FU2FsdGVkX1LNwrMHgs05enX0VDk8QxZH7uP7Ii4HE%2Fcollaboration.svg%3FcacheSeconds%3D60)](https://workerb.linearb.io/v2/badge/collaboration-page?magicLinkId=M7zehz4)
## Description

Cleaning up three patterns of checks to enable wds and anvil into two.
wds and anvil had to have different flags coz anvil had to play catch up
with wds, now that's not the case so it does not make sense to have two
flags.

Old patterns
- checking if the wds feature flag is enabled
- checking if the anvil feature flag is enabled
- checking if the layout system of the app is anvil

New Pattern
- checking if anvil feature flag is enabled (used only for creating an
anvil app)
- checking if layout system of the app is anvil

Fixes #32590
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/8663918496>
> Commit: e10cc2a84ed680b29c49c5b2e8175df4c18da2f8
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8663918496&attempt=1"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->

















<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Refactor**
- Consolidated the usage of layout system checks across the application
to use a unified Anvil layout selector, enhancing consistency in
layout-related conditional logic.
- **Bug Fixes**
- Removed outdated feature flags related to the Anvil + WDS integration,
ensuring the application's feature toggling aligns with the current
development strategy.
- **Tests**
- Updated unit tests to align with the new method of layout system
determination, ensuring test environments accurately reflect production
behavior.
- **Chores**
- Cleaned up redundant code and feature flags that are no longer in use,
simplifying the codebase and reducing potential for errors.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-04-12 22:54:04 +05:30
balajisoundar
7ba6e5374b
chore: [chart widget] show configuration errors only in editor (#32024)
## Description
- Updated withWidgetProps to inject errors to widget only in canvas mode
- Deleted some stale code that were using the createCanvasWidget
function
   - getCanvasWidgetDsl
   - getMainContainer

Fixes https://github.com/appsmithorg/appsmith/issues/32026

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!IMPORTANT]  
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/8419000251>
> Commit: `cfaabbfe72c827bc4ed00e76093d74a0071226db`
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8419000251&attempt=2"
target="_blank">Click here!</a>
> All cypress tests have passed 🎉🎉🎉

<!-- end of auto-generated comment: Cypress test results  -->















<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Refactor**
- Simplified test setups by removing unnecessary mocks and spies across
various test files.
- Enhanced widget error handling in editor mode for improved stability
and user feedback.
- **Tests**
	- Refactored widget rendering utility tests for better error handling.
- **New Features**
- Widgets in editor mode now display error information, aiding in
quicker debugging and development.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-03-26 09:49:58 +05:30
Ankita Kinger
946ecd0810
chore: Refactor entity explorer to support displaying module instances in the list (#28855) 2023-11-16 17:03:59 +05:30
Abhinav Jha
4fa35210a8
chore: Update DSL for Anvil (#27966)
## Description
- If the Anvil feature flag is enabled, set the layout system type to
"ANVIL" when creating an application
- Refactor DSL transformers to pull the specific transformer based on
the layout system type
- Refactor code to move layout system specific transformers to the
specific layout system type folders
- Add new entry in the list of feature flags for Anvil

Note: No changes are observed visually in the application, as we're
defaulting to the Fixed layout system's widget flow until integrations
for Anvil are complete.

#### PR fixes following issue(s)
Fixes #27007 
Fixes #26971 

#### Media
#### Type of change
- New feature (non-breaking change which adds functionality)
- Chore (housekeeping or task changes that don't impact user perception)
## Testing
#### How Has This Been Tested?
- [ ] Manual
- [ ] JUnit - NA
- [ ] Jest - PENDING
- [ ] Cypress - NA

#### Test Plan
#### Issues raised during DP testing
## 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:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-10-19 20:50:17 +05:30
ashit-rath
59d0f999ad
chore: route builder refactor (#27905)
## Description
This PR aims to achieve 2 things
1. Make route building independent of explicitly passing `pageId` as
param when the route is generated against the current page navigation.
2. Add extensible points to extend basePath generation in EE.

THIS PR DOES NOT CHANGE ROUTE GENERATION. 

Changes: 
In `app/client/src/ce/entities/URLRedirect/URLAssembly.ts`
1. Moves the logic of `generateBasePath` way to specific method called
`generateBasePathForApps` and the generateBasePath is available to
extend and switch between a different base path generation logic in EE.
2. Adds a new member variable called `currentPageId`. This
`currentPageId` would help generating basePath without explicitly
passing `pageId` to the build method. If a `pageId` is passed it would
be overridden in the `resolveEntityId` logic.
3. Added `resolveEntityId` method to resolve the entity (pageId) based
on the params passed and the `currentPageId`. This method also acts as
an extension point for extending the logic to any other resolution logic
similar to `generateBasePath`

In `app/client/src/pages/AppViewer/index.tsx` and
`app/client/src/pages/Editor/index.tsx`
The `currentPageId` is set using the `urlBuilder.setCurrentPageId` when
the component mounts or page changes and unset when the component
unmounts.


#### PR fixes following issue(s)
Fixes #27840 

#### 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
- Chore (housekeeping or task changes that don't impact user perception)

## Testing
>
#### How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Also
list any relevant details for your test configuration.
> Delete anything that is not relevant
- [x] Manual
- [ ] JUnit
- [x] 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
- [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
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-10-12 11:01:22 +05:30
Apeksha Bhosale
4dc6df0013
chore: query module evaluation (#27660)
> Pull Request Template
>
> Use this template to quickly create a well written pull request.
Delete all quotes before creating the pull request.
>
## Description
There are multiple refactors and split for query module's creator flow
changes which involves module input -- it's a new entity introduced as
part of modules project

#### PR fixes following issue(s)
Fixes # (issue number)
Part of
https://app.zenhub.com/workspaces/modules-pod-63e0d668a7fea03850c89c6f/issues/gh/appsmithorg/appsmith/27352

#### Type of change

- Chore (housekeeping or task changes that don't impact user perception)

>
>
## Testing
>
#### How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Also
list any relevant details for your test configuration.
> Delete anything that is not relevant
- [ ] Manual
- [ ] JUnit
- [ ] 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:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-09-29 16:12:14 +05:30
Apeksha Bhosale
01c90f1df1
changes in evaluation for EE - split (#27144)
## Description
Evaluation split changes for EE. 
1. RequiresLinting function has moved to common place - on EE extra
checks will be added
2. DataTreeFactory - getActionsForCurrentPage changed to
getCurrentActions -- which will be modified on EE to acomodate package
actions
3. same as above for getJSCollectionsForCurrentPage --> changed to
getCurrentJSCollections

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

>
#### Type of change
- Chore (housekeeping or task changes that don't impact user perception)

>
>
>
## Testing
>
#### How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Also
list any relevant details for your test configuration.
> Delete anything that is not relevant
- [ ] Manual
- [ ] JUnit
- [ ] 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:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-09-12 17:21:39 +05:30
balajisoundar
2608e3dbd3
chore: Move the widget config to widget class (#26073)
## Description
- Remove the config objects from widget and config maps from the widget
factory.
- Introduce methods in widget development API to dynamically fetch this
items.
- freeze the widget configuration.

#### PR fixes following issue(s)
Fixes https://github.com/appsmithorg/appsmith/issues/26008
> 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
>
>
>
## Testing
>
#### How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Also
list any relevant details for your test configuration.
> Delete anything that is not relevant
- [x] 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:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [x] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [x] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-09-06 17:45:04 +05:30
Rudraprasad Das
6045119054
feat: Shared Package for DSL based operations (#23894)
## Description
Splitting DSL into different files when saving into git

#### PR fixes following issue(s)
Fixes #23763 

#### Media

#### Type of change
- New feature (non-breaking change which adds functionality)

## Testing
Manual Testing

#### How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Also
list any relevant details for your test configuration.
> Delete anything that is not relevant
- [ ] 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:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed

---------

Co-authored-by: Hetu Nandu <hetunandu@gmail.com>
2023-06-26 12:25:55 +05:30
Preet Sidhu
6a8806f629
feat: Add widget responsiveness and conversion algorithm (#21386)
## Description

QA branch for mobile responsiveness

---------

Co-authored-by: Aswath K <aswath@appsmith.com>
Co-authored-by: Arsalan Yaldram <arsalanyaldram0211@outlook.com>
Co-authored-by: Aswath K <aswath.sana@gmail.com>
Co-authored-by: Ashok Kumar M <35134347+marks0351@users.noreply.github.com>
Co-authored-by: rahulramesha <rahul@appsmith.com>
2023-04-07 09:51:35 -04:00
Apeksha Bhosale
2b25e1e9b0
fix: Improving performance of JS evaluations by splitting the data tree (#21547)
## Description
This is the second phase of the split data tree. In the previous version, we collected all config paths in each entity and put them in the `__config__` property. All those config properties do get inserted into final data tree which we don't need at all. 
As part of this change, we will be creating another tree i.e **'configTree'**  which will contain all config of each entity. 

unEvalTree is split into 2 trees => 
1. unEvalTree 
2.  configTree

Example: 
previous unEvalTree Api1 content 
<img width="1766" alt="image" src="https://user-images.githubusercontent.com/7846888/215990868-0b095421-e7b8-44bc-89aa-065b35e237d6.png">


After this change
unEvalTree Api1 content
<img width="1758" alt="image" src="https://user-images.githubusercontent.com/7846888/215991045-506fb10a-645a-4aad-8e77-0f3786a86977.png">
Note- above example doesn't have '__config__' property

configTree Api1 content 
<img width="1760" alt="image" src="https://user-images.githubusercontent.com/7846888/215991169-a2e03443-5d6a-4ff1-97c5-a12593e46395.png">


## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
- #11351


## How Has This Been Tested?
- 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: Aishwarya UR <aishwarya@appsmith.com>
2023-03-20 16:34:02 +05:30
Ivan Akulov
424d2f6965
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description

This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.

As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes

This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)

### Why is this needed?

This PR is needed because, for the Lodash optimization from
7cbb12af88,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.

However, just using `import type` in the current codebase will give you
this:

<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">

That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.

### Why enforce `import type`?

Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)

I’m doing this because I believe `import type` improves DX and makes
refactorings easier.

Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)

```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```

It’s pretty hard, right?

What about now?

```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```

Now, it’s clear that only `lodash` will be bundled.

This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.

This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.

## Type of change

- Chore (housekeeping or task changes that don't impact user perception)


## How Has This Been Tested?

This was tested to not break the build.

### 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
- [x] 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
- [x] 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: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 17:11:47 +05:30
Preet Sidhu
75cf47b8c5
feat: Auto layout appsmith editor and mobile responsiveness (#21151)
## Description

Core features of Auto Layout and mobile responsiveness, hidden under a feature flag.

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



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.


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


## How Has This Been Tested?
> Manual regression and sanity tests for all fixed canvas functionality.

- Manual
- Jest
- Cypress



## Checklist:
### Dev activity
- [x] My code follows the style guidelines of this project
- [x] 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
- [x] My changes generate no new warnings
- [ ] 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
- [x] PR is being merged under a feature flag


---------

Co-authored-by: Ashok Kumar M <35134347+marks0351@users.noreply.github.com>
Co-authored-by: Arsalan <arsalanyaldram0211@outlook.com>
Co-authored-by: Aswath K <aswath.sana@gmail.com>
Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2023-03-04 12:55:54 +05:30
Hetu Nandu
aa9b19c995
refactor: Widget Selection (#19643)
## Description

This change is a refactor of widget selection logic. It consolidates all
the business logic to make it easy to maintain. It also improves the
performance a bit.

It touched a lot of features as we heavily rely on this 

```
Select one
Select multiple with drag
Select multiple with shift
Select multiple with cmd/ctrl
Selections should be on the same level of hierarchy
Unselect all by clicking on the canvas
Unselect all by pressing esc
Select all with cmd + a
Paste in main container
Paste in another container
Undo
Redo
Modal Selection
Modal child selection
Context switching
cmd click
snipping mode
new widget suggestion
onboarding
```

> Refactor widget selection logic

Fixes #19570

## Type of change

- Refactor


## How Has This Been Tested?

All existing tests should pass

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

### Issues raised during DP testing

https://github.com/appsmithorg/appsmith/pull/19643#issuecomment-1383570810

https://github.com/appsmithorg/appsmith/pull/19643#issuecomment-1383607820

https://github.com/appsmithorg/appsmith/pull/19643#issuecomment-1385095478
[Bug bash
issues](https://www.notion.so/appsmith/610aa302f3e146a7b090b7dc6bc63ef9?v=0d277a9b07bf4aac9d717bcaf138c33a)

## 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-28 07:47:06 +05:30
Ankita Kinger
6ea8e2549f
feat: Handle permission driven views for auto-saving pages and action… (#16950)
Co-authored-by: Ankita Kinger <ankita@appsmith.com>
Co-authored-by: Sangeeth Sivan <74818788+berzerkeer@users.noreply.github.com>
Co-authored-by: Sangeeth Sivan <sangeeth@appsmith.com>
Co-authored-by: akash-codemonk <67054171+akash-codemonk@users.noreply.github.com>
Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2022-12-01 12:00:50 +05:30
Sumit Kumar
0cbe81dfde
feat: merge GraphQL plugin to release (#16554)
* merge GraphQL plugin to release
2022-09-09 21:29:47 +05:30
Ashok Kumar M
bb60ce6889
fix: useCanvasDragging should not be called in View mode. (#16030)
* Fix: useCanvasDragging should not be called in View mode.

* fixing test that broke coz of rebase.
2022-08-26 18:43:48 +05:30
Sangeeth Sivan
e9d719103c
chore: code split sagas and reducer's index file (#16261)
* chore: code split sagas and reducers index file

* fix: update imports

* chore: remove acl reducers file on ce

* fix: code split reducers properly

* chore: remove unnecessary import

* chore: split root sagas file
2022-08-24 17:46:32 +05:30
ashit-rath
893fd34cdd
perf: Widget re-rendering refactor (#14485)
* initial commit

* props hoc

* changes

* removed ignores and withWidgetProps

* added extra props to canvasStructure

* widget props changes

* list widget changes

* reintroduced widget props hook and other refactors

* remove warnings

* added deepequal for childWidgets selector

* fix global hotkeys and tabs widget jest test

* fix main container test fix

* fixed view mode width

* fix form widget values

* minor fix

* fix skeleton

* form widget validity fix

* jest test fix

* fixed tests: GlobalHotkeys, Tabs, CanvasSelectectionArena and fixed main container rendering

* minor fix

* minor comments

* reverted commented code

* simplified structure, selective redux state updates and other inconsistencies

* fix junit test cases

* stop form widget from force rendering children

* fix test case

* random commit to re run tests

* update isFormValid prop only if it exists

* detangling circular dependency

* fixing cypress tests

* cleaned up code

* clean up man cnavas props and fix jest cases

* fix rendering order of child widgets for canvas

* fix dropdown reset spec

* adding comments

* cleaning up unwanted code

* fix multiselect widget on deploy

* adressing review comments

* addressing minor review comment changes

* destructuring modal widget child and fix test case

* fix communityIssues cypress spec

* rewrite isVisible logic to match previous behaviour

* merging widget props with component props before checking isVisible

* adressing review comments for modal widget's isVisible

Co-authored-by: rahulramesha <rahul@appsmith.com>
2022-08-19 15:40:36 +05:30
arunvjn
fd6faf85ea
chore: code changes to support clean urls v2 (#14757) 2022-07-11 09:36:29 +05:30
Arsalan Yaldram
f58451aa5f
feat: upgrade to create react app 5 (#14000)
* Updated Typescript types.

* Typefixes after merge with release.

* chore: GenericApiResponse Removed alltogether.

* chore: resolved ApiResponse unknown errors removed PageListPayload.

* Added shouldBeDefined.

* fix: Resolved type errors.

* fix: Typescript upgrade to 4.5 and type fixes.

* feat: upgrade to cra 5

* feat: uncomment service worker registeration

* force secure websocket protocol

* jest test fixes

* fix: react function lint rule removed

* fix: klona test case.

* fix: typescirpt issues resolved

* fix: timeout for colorpicker test and change env.

* feat: update client-build.yml file

* fix: remove brotliplugin use compression plugin

* fix: build config fixed

* fix: upgrade webpack plugin

* fix: add branchbutton test to todo.

* fix: remove branch button test.

* fix: Add tailwind theme values, fix cypress tests

* fix: Typescript type fixes.

* feat: run jest tests in silent mode

* fix: cypress rgb values add branchbutton jest test

* fix: review comments, fixes for error.message

* fix: increase cache size for the workbox

* fix: remove OrgApi.ts file

* fix: cypress.json file remove credentials

* fix: downgrade react and react-dom packages

Co-authored-by: rahulramesha <rahul@appsmith.com>
2022-06-21 19:27:34 +05:30
Ankita Kinger
9b7944e7ee
feat: migrate organisation to workspace (#13863)
* migration from organization to workspace on code level

* updated a few more files

* fixed runtime errors

* update org settings URL

* Renamed organizationId in domain objects

* changed field named from organization to workspace

* Reverted AppsmithRole changes

* fixed migrations

* recreating indexes

* migration update

* seed data runs before migration, undo changes

* mock commit

* seedmongo to populate upgraded data, datasource upgrade

* fixed two test cases

* updated migrations

* updated prop name

* Upgraded AclPermission

* comment

* migrated AppsmithRole

* more changes

* final set of changes

* variable name changes

* update cypress variable name

* Update app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ApplicationControllerCE.java

* Update app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/Datasource.java

Co-authored-by: Trisha Anand <trisha@appsmith.com>

* reverting encryption handler change

* migrated a few missed out org to workspace

* migrated a few missed out org to workspace

* migration changes

* Removed Permission import

* fixed AppsmithRole

* mongodb version update

* fixed compile error

* fixed compile issue

* fixed some tests

* simplified embedded mongodb config

* updated a cypress test

Co-authored-by: Sidhant Goel <sidhant@appsmith.com>
Co-authored-by: Trisha Anand <trisha@appsmith.com>
Co-authored-by: Sidhant Goel <sidhant@hexcod.in>
2022-06-15 21:07:41 +05:30
Rishabh Rathod
4e13fc5125
fix: AppViewer init and page fetch logic (#14294)
OnPageSwitch we need not `initializeAppViewPage` but instead, only `fetchPublishedPage` this changes fixes that.
2022-06-10 18:22:59 +00:00
Ankita Kinger
c1e48f7486
feat: Refactor code for SAML integration (#12700)
* Implemented code splitting of some files for SAML integration

* Implemented code splitting of some more files for SAML integration

* updated redirect url component

* fixed an import statement

* fixed a unit test

* updated restart banner tooltip logic

* updated an import statement
2022-04-12 16:20:01 +05:30
arunvjn
69c09c03aa
feat: adding slug names in urls (#10957)
* Init commit clean urls

* Changes to builder route

* Refactored URLs

* Remove default params from url builder functions.

* Fixed more urls

* Changed selector name

* Minor url correction

* Type fixes

* Jest fixes

* Fixed routing for old published apps

* Fixed url slug replace

* page-1 -> page1 as default page slug name

* Remove application id from init editor calls

* Use default page slug

* Added comments and placeholder values for slug names

* variable rename

* Removed redirection and added back the old routes

* Prevent page slug name recompute

* Fixed home page load in view mode

* Added null checks

* Fixed jest test

* Fixed jest test

* Update URL slugs when app/page name changes

* Added unit tests and updates types

* Removed unused code

* * Removed duplication fetch page call.
* Fixes #11354
* Fixed sign up flow

* Refactored initializeEditorSaga

* Fixed warnings

* Fixed integrations screen URL bugs

* Cypress fixes

* Fixed slug names in copy/move operations and pages screen

* Minor refactor

* Fixed page highlight bug in published apps

* Added new url factory and middleware to store url params

* Changed store to default export and fix unit tests

* Fixed slugs unit test

* Minor fixes

* Fixes #11379

* Fixed set as home page feature

* Updated types

* app id adjustments for cypress

* Fixed bad merge

* Refactored routes to functional component

* * Fixed EE active entity highlight.
* Remove unused code in editor router.

* jest fix

* Mock history to prevent security errors

* constant rename

* Removed console logs

* Fixed page id regex

* Do not check for /pages in url

* Fixed missing pageId on quick edit/deploy clicks

* Missed files from previous commit

* Fixed warnings

* Fixed jest test

* New api integration

* feat: Add applicationVersion property to Application (#11626)

Added a new property to Application object - applicationVersion. This property can be used to identity when there is a breaking change and can not be solved with migration. FE will use this property to detect such conditions. Another API is added to migrate the applicationVersion to latest version when user migrates the breaking changes.

* Added manual upgrade modal.

* Test fix

* Fixed jest test

* function rename

* Fix deploy error

* Added null check

* Changes to persist URL search params when redirecting

* Added updates tooltip

* More unit test cases

* Fixed git url redirection

* Fix warning

* Fixed evaluation on upgrade

* Fixed warnings

* File rename

* Added cypress for clean urls

* Fixed import/export/fork cypress

* Cypress api server fixes

* Fixed mongo spec

* Fixed replay spec

* Fixed comments spec

* More cypress fixes

* Fixed tooltip in update btn

* Text size changes

* Minor fixes

* Jest test fix

* Fixed type error

* Fixed warnings

* Fixed todo comments

* Moved description to constants file

* Fixed cypress CI run crash

* Fixes git cypress failures

* Import/Export cypress test fixes

* Import export fork cypress fixes

* Explorer test fix

* Switch branch test fix

* Added applicationVersion in export app json

* Calls plugin forms in parallel

* Fixed warnings

* Fixed warning

* Import export CI fixes

* Reverts previous changes

* Fixes import export

* Fixed import export cypress URL verification

* Pass applicationVersion when duplicating application

* Cypress fix

* Dummy commit

Co-authored-by: Nayan <nayan@appsmith.com>
2022-03-25 16:13:26 +05:30
Aanchal
e78ace8bc2
fix: Removed unused variables (#8122)
Fix: Removed unused variables
2021-10-20 18:09:50 +06:00
Abhinav Jha
b49f5097c6
refactor: Widget Development API (#6405) 2021-09-09 20:40:22 +05:30
Rishabh Saxena
e4255f6773
Minor fixes for comments on the modal widget (#6368) 2021-08-06 14:47:56 +05:30
Ashok Kumar M
cf19b8e44d
[Feature] Widget Grouping Phase - 3 (Cut Copy Paste) (#5083)
* Cut copy paste first cut

* removed different parent groups logic

* mouseup on the outer canvas removes selections.

* bug fix

* remove unwanted dead code.

* Adding tests

* build fix

* min height fixes

* fixing specs.

* fixing specs.
2021-06-28 12:41:47 +05:30