Commit Graph

28 Commits

Author SHA1 Message Date
Rahul Barwal
0d63d7afae
fix: Revert "fix: Enhance error handling in ComputeTablePropertyControlV2 binding methods (#38205)" (#38852) 2025-01-27 18:16:38 +05:30
Rahul Barwal
08cd433794
fix: Enhance error handling in ComputeTablePropertyControlV2 binding methods (#38205) 2025-01-27 10:41:51 +05:30
Rahul Barwal
3610bae834
feat: Implements HTML as a column type in table widget. (#37997) 2024-12-11 13:07:30 +05:30
Rahul Barwal
6507f90e05
fix: Incorrect updation of selctedRowIndex when primary column is set. (#36393)
## Description
<ins> Problem statement </ins>
1. Table should have a primary column set.
2. The table should be filtered(via search or client side filters)
3. there should be a selectedRow in table
a. One way to ensure is add a text widget and bind it to table's
`selectedRowIndex` property.

If you now run a query that updates the data behind the table: the
`selectedRow` is updated to (seemingly) random row and selectedRowIndex
is updated as well

<ins> Rootcause </ins>
We have a mechanism of preserving `selectedRow` when data updates
happen.
Underlying logic gets the previous selected row and tries to find it in
the new data using the primary key.
* If it finds it, it updates the selectedRowIndex to the
`__original_index__` of the found row i.e. its position in the original
data before any filters were applied.

<ins> Solution </ins>
We update the selectedRowIndex to the index in the new filtered data.

<ins> How to test </ins>
1. Create a table with a primary key
2. Add a text widget and bind it to table's `selectedRowIndex` property
3. Filter the table
4. Click on a row to select it
5. Run a query that updates the data behind the table
6. Assert that the selected row is the same and that the
selectedRowIndex is updated to the new index


Fixes #36080
_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.Table, @tag.Binding, @tag.Sanity"

### 🔍 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/10953679202>
> Commit: 1a2d64467e453229940b67b29da1ce9d0e9ac24d
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10953679202&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Table, @tag.Binding, @tag.Sanity`
> Spec:
> <hr>Fri, 20 Sep 2024 06:30:08 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


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

## Summary by CodeRabbit

- **Improvements**
- Enhanced the efficiency of the TableWidgetV2 by streamlining the
method for retrieving the index of selected rows.
- Improved code readability and maintainability without altering the
overall functionality.

- **New Features**
- Introduced new test cases to validate filtering and searching
functionalities within the Table Widget V2.
- Added a JSON configuration for a data-driven table interface,
supporting sorting, filtering, and dynamic data binding.
- Introduced fixture data for testing, allowing for comprehensive
validation of table behavior under various conditions.
- Added a JavaScript object containing employee data to facilitate
filtering and display in the table.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-20 12:25:23 +05:30
Ilia
d6f249b42d
chore: add blank line eslint rule (#36369)
## Description
Added ESLint rule to force blank lines between statements. 


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  -->
> [!CAUTION]
> 🔴 🔴 🔴 Some tests have failed.
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/10924926728>
> Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail"
target="_blank">Cypress dashboard</a>.
> Tags: @tag.All
> Spec: 
> The following are new failures, please fix them before merging the PR:
<ol>
> <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts
>
<li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts
>
<li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts
>
<li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts
>
<li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts
>
<li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts
>
<li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts
>
<li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts
>
<li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts
>
<li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts
>
<li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts
>
<li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts
>
<li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts
>
<li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts
>
<li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol>
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master"
target="_blank">List of identified flaky tests</a>.
> <hr>Wed, 18 Sep 2024 16:33:36 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No

---------

Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 19:35:28 +03:00
Valera Melnikov
a2bfe450b6
chore: enable no-explicit-any rule (#35321)
## Description
-  Enabled the rule `@typescript-eslint/no-explicit-any`
- Suppressed errors with comment
```
// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
```

Fixes #35308 

## 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/10181176984>
> Commit: 7fc604e24fa234da7ab2ff56e0b1c715268796ee
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10181176984&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Wed, 31 Jul 2024 15:00:45 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No
2024-07-31 18:41:28 +03:00
Pawan Kumar
eb0c13db79
fix: add customJS control for currency, notation and thousand separator (#33877)
Fixes #33858

/ok-to-test tags="@tag.Table"<!-- This is an auto-generated comment:
Cypress test results -->
> [!IMPORTANT]
> 🟣 🟣 🟣 Your tests are running.
> Tests running at:
<https://github.com/appsmithorg/appsmith/actions/runs/9318008514>
> Commit: 1ea0a6325c234a41c431c92329e3fa8e9d4fdf45
> Workflow: `PR Automation test suite`
> Tags: `@tag.Table`

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

---------

Co-authored-by: Pawan Kumar <pawankumar@Pawans-MacBook-Pro-2.local>
2024-05-31 18:35:38 +05:30
Valera Melnikov
6d90ce8dc9
chore: update storybook (#32828)
## Description
- Update Storybook and related dependencies
- Delete the stories for old widget components
- Rewrite stories for new widgets(mdx to tsx)

Note: local chromatic doesn't work because of this
https://github.com/storybookjs/storybook/issues/22531

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

- **New Features**
- Introduced new component stories across various packages to enhance
design system documentation and user experience.

- **Documentation**
- Updated `.gitignore` files to optimize version control settings for
Storybook and build logs.

- **Refactor**
- Modified UI element positioning in Storybook theming for improved
layout management.

- **Style**
- Adjusted CSS properties for the `Select` component to ensure better
visual presentation.

- **Chores**
- Updated dependencies and scripts in package configurations to maintain
up-to-date development tools.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-04-22 12:17:28 +03:00
balajisoundar
694b17062b
feat: Table widget currency column (#27819)
## Description
Adds a new currency column type on the table widget.

#### PR fixes following issue(s)
Fixes #5632 
> 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

- New feature (non-breaking change which adds functionality)
>
>
>
## 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
- [ ] Jest
- [x] Cypress
>
>
#### Test Plan
> https://github.com/appsmithorg/TestSmith/issues/2447
>
>
#### 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
- [x] 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-11-06 11:05:26 +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
Keyur Paralkar
614b3fe736
fix: retain columns on query change in deployed app (#24245)
## Description
This PR fixes the behaviour mentioned in the issue. 

This issue was happening due to table widget's column order wasn't
updating. It wasn't updating because we maintained column orders in
widget's DSL as well as in the meta property. Whenever the table data
changes, the widget updates `columnOrder` property in the DSL but this
gets overridden if you have the same property in the widget's meta
property.

To solve this we update the table widget's sticky and column order
property via `super.updateWidgetProperty`. We have also refactor the
hydration logic for sticky columns such that table widget's DSL acts as
a source of truth all the time.

Fixes #23969
#23827

#### Type of change
- Bug fix (non-breaking change which fixes an issue)

## 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
- To test that the column freeze functionality works as expected in edit
as well as deployed mode
- To check column freeze functionality works as expected when table
query changes
- To check if the column reordering is working as expected in view mode
- [ ] Jest
- [x] Cypress
- should test that the number of columns needs to be same when table
data changes in deployed app
>
>
#### 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
- [ ] 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
2023-06-27 10:45:41 +05:30
Rajat Agrawal
1434fb930c
fix: Fix default selected row on a page change when primary key is selected in a table and is unavailable in new data (#23863)
Fixes #24344


Steps to repro are in the connected issue.
2023-06-23 10:27:48 +05:30
Keyur Paralkar
3ee46ffd14
fix: add select options field to new row (#22003)
## Description

This PR introduces new two new properties: `Same options in new row` and
`New row options` for the select column type.
We show these two fields when the allow add new row is turned on in
table
- SameOptionsInNewRow -- Boolean field ; When turned on the option for
the first row is used in the new row. Default is true
     - Label : Use same options in new row
- Tooltip : Toggle to display same choices for new row and editing
existing row in column.
- NewRowOptions -- Array field; when the above boolean is turned off we
show this option to let people add options specifically for new row.
Supports static and dynamic data, but doesn't support currentRow
    - Label: New row options
- Tooltip : Options exclusively displayed in the column for new row
addition.

Fixes #20230


## Type of change

- Bug fix (non-breaking change which fixes an issue)


## How Has This Been Tested?

- Cypress:
- When allowAddNewRow is turned on, same new option should be true and
new row option should be invisible.
- When turned on same option, options of the first row should appear
while editing as well as adding new row.
    - When turned off, New row option should be visible
- Fill new row options, the new row options should appear while adding
new row in select field.
    -  New row options should not have access to the currentRow
- Both the options should only be visible only when allowNewRow is true.
    -  Should support static and dynamic values in new row options

- Manual
- For the new DnD Tables. Check if the above functionality is working as
expected.
- For Existing tables, Check if the above functionality is working as
expected. This needed to be tested from migration standpoint

### Test Plan
> https://github.com/appsmithorg/TestSmith/issues/2367

### 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
- [ ] 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-04-06 23:58:24 +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
Keyur Paralkar
2ccd20e1e5
fix: column dragging and column reordering (#20928)
## Description

This PR implements the following changes:
- Move the drag events from the Parent component's useEffect to the
`HeaderCell` component.
- Refactored the code. Inside the table component, we refactored the
code such that when SSP is disabled the component uses `StaticTable` and
when SSP enabled then we use `VirtualTable`.
- It also includes the fix for the following issue. Whenever the user
has a scroll to the bottom of the page, on clicking of add new button it
is expected that the scroll should move to the top but it wasn't
happening.

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

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


## Type of change


- Bug fix (non-breaking change which fixes an issue)


## How Has This Been Tested?

- Manual
    - Test cases:
        - Column name should appear on update from the property pane
        - reorder whenever SSP is enabled
        - On column re-size
        - When a col is frozen
        - When a col is unfrozen
        - When all the headers or one of them is removed
        - When sorted also should work
        - Enable multi-row selection
        - When in preview mode and back and forth(Check the above cases)
        - When in Deployed mode
- Dragging of columns from the column header should work as expected
both in Deploy and Published mode.
- 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
- [ ] 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
- [ ] 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-03-05 19:49:44 +05:30
Keyur Paralkar
b22ad3a769
feat: added column freeze and unfreeze functionality to table widget (#18757)
**PRD**:
https://www.notion.so/appsmith/Ability-to-freeze-columns-dd118f7ed2e14e008ee305056b79874a?d=300f4968889244da9f737e1bfd8c06dc#2ddaf28e10a0475cb69f1af77b938d0b

This PR adds the following features to the table widget:

- Freeze the columns to the left or right of the table.(Both canvas and
page view mode).
- Unfreeze the frozen columns. (Both canvas and page view mode).
- Columns that are left frozen, will get unfrozen at a position after
the last left frozen column. (Both canvas and page view mode).
- Columns that are right frozen, will get unfrozen at a position before
the first right frozen column. (Both canvas and page view mode).
- Column order can be persisted in the Page view mode.
- Users can also unfreeze the columns that are frozen by the developers.
- Columns that are frozen cannot be reordered(Both canvas and page view
mode)
- **Property pane changes (Columns property)**:
- If the column is frozen to the left then that column should appear at
top of the list.
- If the column is frozen to the right then that column should appear at
the bottom of the list.
- The columns that are frozen cannot be moved or re-ordered in the list.
They remain fixed in their position.
- In-Page mode, If there is a change in frozen or unfrozen columns in
multiple tables then the order of columns and frozen and unfrozen
columns should get persisted on refresh i.e. changes should get
persisted across refreshes.
2023-02-15 17:12:46 +05:30
Souma Ghosh
12ea1b86ea
feat: Date column type editing for table widget (#19181)
- Integrates Date picker component inside table's date column
- Enables edit mode for date type column in table widget
- Adds all the required Property controls for date picker
- Builds the user flow for date column editing in table widget
2023-01-16 14:53:56 +05:30
Dhruvik Neharia
5c3c5337bb
feat: Dynamic Menu Items - Table Widget (#18945)
## Description

This PR allows adding menu items from a Source for a Menu Button Column
inside the Table Widget.
2022-12-30 16:22:11 +05:30
balajisoundar
f49db2a90e
feat: Provide currentRow access in the table widget select column typ… (#18180) 2022-12-16 10:05:51 +05:30
Pawan Kumar
1821e31943
fix: Theme Stylesheet refactor (#18258)
* fix

* move stylesheet to widget level

* fix types

* fix types

* fix types

* fix types ( thanks to ashit )

* fix type issue

* add config for list widget

* fix jest tests
2022-11-28 10:14:31 +05:30
Souma Ghosh
99dc583514
feat: Resize Image option in Table Widget v2 (#17482)
* feat: Resize image option in Table Widget

* Change default image size from 64px to 32px

* Add cypress tests

* Move Image Size property control under Style tab

* Review changes

* Fix failing cypress tests

* fix prettier issue
2022-10-14 17:51:54 +05:30
balajisoundar
ed1dccaba7
feat: Table widget select column type (#16337) 2022-09-30 09:33:53 +05:30
Souma Ghosh
88fe538a70
feat: Autoassigns column datatype in table widget (#16701)
* feat: Autoassigns column datatype in table widget
- Limited to only number, string and boolean datatypes

* Review changes
Adjust jest tests accordingly

* Adds support for recognising Date type columns
Review changes

* Adds jest test for Date field

* Fix warning

* Adjust cypress tests and add helper method to account for code changes

* Fix failing test
2022-09-29 10:56:08 +05:30
balajisoundar
56d58d8e55
fix: table editaction column should be disabled when injected (#16693) 2022-09-21 17:05:15 +05:30
Keyur Paralkar
fff5c16f89
feat: table widget switch column type (#16262)
* feat: added checkbox column type

* fix: addressed review changes

* feat: added filter for checkbox column type

* fix: checkbox alignment

* fix: horizontal alignement property added for checkbox column type

* test: added cypress test and addressed feedback changes

* fix: add new property cellComponentHorizontalAlignment

* fix: addressed review comments

* fix: changed column type order to alphabetical order

* refactor: removed unused imports

* fix: typings for the dynamic label

* fix: addressed review comments

* feat: added switch column type to table widget

* fix: removed unused imports

* fix: disabled cursor flicker issue

* fix: inline editing for checkbox column type

* fix: addressed QA callouts

* fix: addressed qa callouts

* fix: addressed review callouts

* fix: horizontal alignment issue

* fix: added unsaved marker and cypress test

* fix: alginment issues for the tooltipped wrapped switches

* fix:
* rebase new property pane changes
* cypress test fixes
* added support to dynamically change the section name with the help of function

* fix:
* cypress tests
* rebased new property pane changes for switch column type

* fix: merge conflicts on property section

* fix: address code review callouts

Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2022-09-16 10:04:11 +05:30
balajisoundar
afb9aa93c1
feat: Table widget V2 Inline editing validation for plain text & number column (#15954) 2022-09-13 11:11:59 +05:30
Keyur Paralkar
e7209f06fd
feat: Table widget checkbox column type (#15933)
* feat: added checkbox column type

* fix: addressed review changes

* feat: added filter for checkbox column type

* fix: checkbox alignment

* fix: horizontal alignement property added for checkbox column type

* test: added cypress test and addressed feedback changes

* fix: add new property cellComponentHorizontalAlignment

* fix: addressed review comments

* fix: changed column type order to alphabetical order

* refactor: removed unused imports

* fix: typings for the dynamic label

* fix: addressed review comments

* fix: disabled cursor flicker issue

* fix: inline editing for checkbox column type

* fix: addressed QA callouts

* fix: addressed qa callouts

* fix: addressed review callouts

* fix: horizontal alignment issue

* fix:
* rebase new property pane changes
* cypress test fixes
* added support to dynamically change the section name with the help of function

* fix: type casting issue for sectionName

* fix: addressed review comments

* chore: removed unused imports

* fix: added prop.hidden comparision in the memoized PropertySection component

Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2022-09-08 16:35:59 +05:30
balajisoundar
a97ab3d9a2
feat: Table widget v2 with support for non-ASCII characters and improved jest coverage (#11307) 2022-07-14 12:32:35 +05:30