Commit Graph

18 Commits

Author SHA1 Message Date
Aswath K
b0b8dc2991
fix: Makes use of mobile positioning properties in Table Widget (#24729)
## Description

Table widget's pageSize property was not taking account of mobile
position properties (`mobileTopRow` and `mobileBottomRow`) in Auto
Layout mode. This caused the issues mentioned in this PR.
Since this is a derived property, properties such as `isMobile` and
`appPositioningType` were not directly available. So, we added these
into the DataTree as well.

#### PR fixes following issue(s)
Fixes #22907
Fixes #22911

#### 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
- 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
- [ ] 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
- [ ] 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
- [ ] 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

---------

Co-authored-by: rahulramesha <rahul@appsmith.com>
2023-07-17 11:12:52 +05:30
Sangeeth Sivan
c5275d28f8
fix: table search is not working properly for url colums (#24244)
## Description
- If we have a column type of `url` in table, the search considers the
computed value and filters data based on that. But the search should
take the display text as the search value to filter data.

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

#### Media

#### 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
- [x] Jest
- [x] 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
- [ ] 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/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-21 17:31:06 +05:30
balajisoundar
a72e3347f5
feat: Table one click binding for MongoDB and Postgres (#23629)
> Pull Request Template
>
> Use this template to quickly create a well written pull request.
Delete all quotes before creating the pull request.
>
## Description
> Add a TL;DR when description is extra long (helps content team)
>
> Please include a summary of the changes and which issue has been
fixed. Please also include relevant motivation
> and context. List any dependencies that are required for this change
>
> Links to Notion, Figma or any other documents that might be relevant
to the PR
>
>
#### PR fixes following issue(s)
Fixes # (issue number)
> 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
- [x] Jest
- [x] Cypress
>
>
#### Test Plan
> One Click Binding -
https://github.com/appsmithorg/TestSmith/issues/2390
>
#### 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/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: Vemparala Surya Vamsi <vamsi@appsmith.com>
2023-06-01 22:56:05 +05:30
Keyur Paralkar
977cee645a
fix: null check before accessing editableCell property in table widget (#22500)
## Description

This PR adds optional chaining while accessing the properties of
`editableCell` object in the table widget.

Fixes #20789


## Type of change

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


## How Has This Been Tested?

Please refer to the
[comment.](https://github.com/appsmithorg/appsmith/issues/20789#issuecomment-1515845278)
### 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
- [ ] 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-04-20 18:42:31 +05:30
Rajat Agrawal
ba7099ce00
fix: Sorting by renamed custom column (#22405)
Fixes #19928 

Steps to repro:

1. Add a custom column named `customColumn1` to a table.
2. Modify the computed value for it to `{{currentIndex}}`.
3. Ensure that sorting is working for the table using `customColumn1`.
4. Go to property pane settings for this column and rename it to
`customColumn2` from its title in the property pane.
5. Ensure that sorting is working using `customColumn2`.

Actual Behavior:
Sorting isn't working using `customColumn2`.

Expected Behavior:
Sorting should work using `customColumn2`.
2023-04-20 12:11:38 +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
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
Rishabh Kashyap
29204f546e
feat: add tableheader property to autocomplete in table (#18137)
* tableheader logic initiated

* autocomplete logic done

* logic and test cases written

* test cases updated

* feedback incorporated

* incorporated feedback

* test cases reduced

* test case altered to write number inplace of object

* changes made in the cypress test
2022-11-25 11:42:23 +05:30
Keyur Paralkar
86a4929d64
feat: updatedRow property should point to the last edited row in table widget (#18225)
* fix: changed the updatedRow logic

* fix: removed only modifier from inline spec

* fix: addressed review comments

* chore: removed the downloads.html file

* fix: address review comments
2022-11-25 10:09:59 +05:30
balajisoundar
2df27a6fb2
feat: Option to add new row in Table widget (#17515) 2022-11-05 15:24:20 +05:30
Souma Ghosh
8f5668e23f
fix: Ends with operator not working as expected (#17519)
* fix: Ends with operator not working as expected
- fix issue
- uncomment cypress tests

* Review changes
2022-10-14 11:09:52 +05:30
balajisoundar
2aaa413d6d
chore: Remove the unnecessary error log from the derived property function (#17290) 2022-10-04 17:08:02 +05:30
Souma Ghosh
1dbcde6066
fix: Table interact-able columnTypes should not show in selectedRow (#16648)
* fix: Table interactable columnTypes should not show in selectedRow

* Review changes

* Update failing Cypress tests

* Remove comments
2022-09-21 16:28: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
Souma Ghosh
ca11be276f
feat: Add new pageOffset binding to Table Widget (#16083)
* feature: Add new pageOffset binding to Table Widget

* Add jest tests
Modify getPageOffset to account for failed tests

* Review changes

* take page size as tableData.length when Serverside pagination is on

* Update bindings count in cypress test for table widget v2

* Changes default value of pageOffset to 0
Use pageSize instead of tableData.length when tableData is not available

* Update jest tests according to changes in the code

Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2022-09-01 15:31:02 +05:30
balajisoundar
38f9661e45
fix: Table widget pagesize in short row height mode (#16045) 2022-08-23 17:19: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