Skip to content

chore: Turn off Allow filtering property on Table widget#34593

Merged
jacquesikot merged 8 commits intoreleasefrom
chore/change-filters-visibility-default
Jul 5, 2024
Merged

chore: Turn off Allow filtering property on Table widget#34593
jacquesikot merged 8 commits intoreleasefrom
chore/change-filters-visibility-default

Conversation

@carinanfonseca
Copy link
Contributor

@carinanfonseca carinanfonseca commented Jun 28, 2024

#34591

Description

Making Allow filtering option false by default.

Allow filtering off

Fixes #34591
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.Widget, @tag.Binding, @tag.Sanity"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9795462304
Commit: e0c1e83
Cypress dashboard.
Tags: @tag.Table, @tag.Widget, @tag.Binding, @tag.Sanity

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • Bug Fixes

    • Filtering is now disabled by default for the TableWidgetV2.
  • Tests

    • Updated test scripts to enable filtering for TableWidgetV2 in multiple scenarios.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 28, 2024

Walkthrough

The primary change in this update involves disabling the "Allow filtering" property by default for the TableWidgetV2 to avoid confusion among users and address issues with client-side filtering. Consequently, several Cypress tests were modified to turn this property back on explicitly before running filter-related tests.

Changes

Files Change Summary
app/client/src/widgets/TableWidgetV2/widget/index.tsx Set the isVisibleFilters property to false in TableWidgetV2.
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/... Added steps to enable filtering in various Cypress test files to accommodate the default off state.
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_1_Spec.ts Modified test script to enable filtering for table widget.
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_2_Spec.ts Added step to enable filtering in test.
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_1_Spec.ts Adjusted test script to turn on filtering for table widget.
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_2_Spec.ts Enabled filtering for table widget in test scenario.
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_DisplayText_spec.ts Added line of code to enable filtering for table widget.
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/checkboxCell_spec.js Added step to enable filtering for table widget before test interactions.
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/switchCell_spec.js Included step to enable filtering for table widget in test file.
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/server_side_filtering_spec_1.ts Added code to turn on filtering before creating SQL data source in test scenario.

Assessment against linked issues

Objective Addressed Explanation
"Allow filtering" property should be off by default (#34591)

Poem

In the land of code where widgets play,
Filters now by choice, not by the day,
Tables made clear without a surprise,
Users find ease with open eyes.
Cypress tests turn filters on anew,
A smoother path for me and you.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@rahulbarwal
Copy link
Contributor

/build-deploy-preview skip-tests=true

@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/9716053198.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 34593.
recreate: .

@github-actions
Copy link

Deploy-Preview-URL: https://ce-34593.dp.appsmith.com

@github-actions github-actions bot added Widgets Product This label groups issues related to widgets Table Widget Task A simple Todo labels Jun 29, 2024
@carinanfonseca carinanfonseca changed the title Turn off Allow filtering property on Table widget chore: Turn off Allow filtering property on Table widget Jun 29, 2024
@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Jun 29, 2024
@carinanfonseca carinanfonseca marked this pull request as ready for review June 29, 2024 00:50
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e662e7e and 17bd8a2.

Files selected for processing (1)
  • app/client/src/widgets/TableWidgetV2/widget/index.tsx (1 hunks)
Additional context used
Biome
app/client/src/widgets/TableWidgetV2/widget/index.tsx

[error] 274-276: Avoid redundant double-negation.

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation

(lint/complexity/noExtraBooleanCast)


[error] 473-473: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)


[error] 650-650: Avoid redundant double-negation.

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation

(lint/complexity/noExtraBooleanCast)


[error] 693-695: This else clause can be omitted because previous branches break early.

Unsafe fix: Omit the else clause.

(lint/style/noUselessElse)


[error] 722-722: Avoid redundant double-negation.

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation

(lint/complexity/noExtraBooleanCast)


[error] 788-788: Avoid redundant double-negation.

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation

(lint/complexity/noExtraBooleanCast)


[error] 1935-1935: Do not access Object.prototype method 'hasOwnProperty' from target object.

It's recommended using Object.hasOwn() instead of using Object.hasOwnProperty().
See MDN web docs for more details.

(lint/suspicious/noPrototypeBuiltins)


[error] 1936-1936: Do not access Object.prototype method 'hasOwnProperty' from target object.

It's recommended using Object.hasOwn() instead of using Object.hasOwnProperty().
See MDN web docs for more details.

(lint/suspicious/noPrototypeBuiltins)


[error] 2147-2155: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Unsafe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)


[error] 2178-2236: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Unsafe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)


[error] 2190-2233: This else clause can be omitted because previous branches break early.

Unsafe fix: Omit the else clause.

(lint/style/noUselessElse)


[error] 2207-2209: This else clause can be omitted because previous branches break early.

Unsafe fix: Omit the else clause.

(lint/style/noUselessElse)


[error] 2480-2480: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Unsafe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)


[error] 2866-2866: Do not access Object.prototype method 'hasOwnProperty' from target object.

It's recommended using Object.hasOwn() instead of using Object.hasOwnProperty().
See MDN web docs for more details.

(lint/suspicious/noPrototypeBuiltins)


[error] 2876-2878: This else clause can be omitted because previous branches break early.

Unsafe fix: Omit the else clause.

(lint/style/noUselessElse)

Additional comments not posted (1)
app/client/src/widgets/TableWidgetV2/widget/index.tsx (1)

213-213: Change aligns with PR objective.

The property isVisibleFilters has been correctly updated to false in the getDefaults method, turning off the "Allow filtering" property by default.

rahulbarwal
rahulbarwal previously approved these changes Jul 1, 2024
Copy link
Contributor

@rahulbarwal rahulbarwal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@rahulbarwal rahulbarwal added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jul 1, 2024
@nerbos
Copy link
Contributor

nerbos commented Jul 1, 2024

@rahulbarwal, don't we have a test to check defaults? If yes, won't this break that test?

@jacquesikot jacquesikot self-requested a review July 1, 2024 10:06
@rahulbarwal
Copy link
Contributor

@rahulbarwal, don't we have a test to check defaults? If yes, won't this break that test?

Yes @nerbos, In the initial tests run none of them failed which was surprising. In the second run we have 8 failing. @jacquesikot will take over this PR to ensure everything passes.

@nerbos
Copy link
Contributor

nerbos commented Jul 1, 2024

@rahulbarwal, don't we have a test to check defaults? If yes, won't this break that test?

Yes @nerbos, In the initial tests run none of them failed which was surprising. In the second run we have 8 failing. @jacquesikot will take over this PR to ensure everything passes.

@rahulbarwal the tests that failed where jest or cypress tests?

@rahulbarwal
Copy link
Contributor

rahulbarwal commented Jul 1, 2024

@rahulbarwal the tests that failed where jest or cypress tests?

@nerbos Cypress tests are failing. You can check the description of this PR.

@nerbos
Copy link
Contributor

nerbos commented Jul 1, 2024

@rahulbarwal is it worth having a jest to test defaults? Or this is not a practice in Engineer?

@jacquesikot jacquesikot added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jul 3, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 17bd8a2 and 29fc649.

Files selected for processing (8)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_1_Spec.ts (2 hunks)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_2_Spec.ts (1 hunks)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_1_Spec.ts (1 hunks)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_2_Spec.ts (1 hunks)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_DisplayText_spec.ts (1 hunks)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/checkboxCell_spec.js (1 hunks)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/switchCell_spec.js (1 hunks)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/server_side_filtering_spec_1.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_DisplayText_spec.ts
Additional context used
Path-based instructions (7)
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/server_side_filtering_spec_1.ts (1)

Pattern **/*.*: Do not use cy.wait in code.
Do call the add function.
Do not keep duplicate lines in code.
Descriptive test names are used to clearly convey the intent of each test.

app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_1_Spec.ts (1)

Pattern **/*.*: Do not use cy.wait in code.
Do call the add function.
Do not keep duplicate lines in code.
Descriptive test names are used to clearly convey the intent of each test.

app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/switchCell_spec.js (1)

Pattern **/*.*: Do not use cy.wait in code.
Do call the add function.
Do not keep duplicate lines in code.
Descriptive test names are used to clearly convey the intent of each test.

app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/checkboxCell_spec.js (1)

Pattern **/*.*: Do not use cy.wait in code.
Do call the add function.
Do not keep duplicate lines in code.
Descriptive test names are used to clearly convey the intent of each test.

app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_2_Spec.ts (1)

Pattern **/*.*: Do not use cy.wait in code.
Do call the add function.
Do not keep duplicate lines in code.
Descriptive test names are used to clearly convey the intent of each test.

app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_2_Spec.ts (1)

Pattern **/*.*: Do not use cy.wait in code.
Do call the add function.
Do not keep duplicate lines in code.
Descriptive test names are used to clearly convey the intent of each test.

app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_1_Spec.ts (1)

Pattern **/*.*: Do not use cy.wait in code.
Do call the add function.
Do not keep duplicate lines in code.
Descriptive test names are used to clearly convey the intent of each test.

Additional comments not posted (7)
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/server_side_filtering_spec_1.ts (1)

37-38: Enable filtering explicitly for the table widget.

The code correctly turns on filtering for the table widget as it is disabled by default in this PR.

app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_1_Spec.ts (1)

19-20: Enable filtering explicitly for the table widget.

The code correctly turns on filtering for the table widget as it is disabled by default in this PR.

app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/switchCell_spec.js (1)

43-44: Enable filtering explicitly for the table widget.

The code correctly turns on filtering for the table widget as it is disabled by default in this PR.

app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/checkboxCell_spec.js (1)

37-38: Enable filtering explicitly for the table widget.

The code correctly turns on filtering for the table widget as it is disabled by default in this PR.

app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_2_Spec.ts (1)

19-20: Enable filtering explicitly for the table widget.

The code correctly turns on filtering for the table widget as it is disabled by default in this PR.

app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_2_Spec.ts (1)

18-19: LGTM! The change aligns with the PR objective.

The addition of code to enable filtering for the table aligns with the PR's objective to disable filtering by default. The rest of the function remains consistent with the test case.

app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter2_1_Spec.ts (1)

19-20: LGTM! The change aligns with the PR objective.

The addition of code to enable filtering for the table aligns with the PR's objective to disable filtering by default. The rest of the function remains consistent with the test case.

@jacquesikot jacquesikot added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jul 3, 2024
@jacquesikot jacquesikot added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jul 4, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 29fc649 and e0c1e83.

Files selected for processing (1)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/checkboxCell_spec.js (1 hunks)
Files skipped from review due to trivial changes (1)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/checkboxCell_spec.js

@jacquesikot jacquesikot added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jul 4, 2024
@rahulbarwal rahulbarwal removed the ok-to-test Required label for CI label Jul 4, 2024
@rahulbarwal rahulbarwal added the ok-to-test Required label for CI label Jul 4, 2024
@jacquesikot jacquesikot requested a review from rahulbarwal July 4, 2024 15:11
@jacquesikot jacquesikot merged commit a2f2f79 into release Jul 5, 2024
@jacquesikot jacquesikot deleted the chore/change-filters-visibility-default branch July 5, 2024 07:46
Shivam-z pushed a commit to Shivam-z/appsmith that referenced this pull request Jul 10, 2024
…#34593)

appsmithorg#34591

## Description
Making _Allow filtering_ option false by default.

<img width="798" alt="Allow filtering off"
src="https://github.com/appsmithorg/appsmith/assets/121817440/8ac64773-2385-433d-96fa-0a90080e2462">


Fixes appsmithorg#34591
_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.Widget, @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/9795462304>
> Commit: e0c1e83
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9795462304&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Table, @tag.Widget, @tag.Binding, @tag.Sanity`
<!-- end of auto-generated comment: Cypress test results  -->




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


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

- **Bug Fixes**
  - Filtering is now disabled by default for the `TableWidgetV2`.

- **Tests**
- Updated test scripts to enable filtering for `TableWidgetV2` in
multiple scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Jacques Ikot <jacquesikot@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog Table Widget Task A simple Todo Widgets Product This label groups issues related to widgets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Allow filtering" property should be off by default

4 participants