chore: external merge request from Contributor#36878
chore: external merge request from Contributor#36878rahulbarwal wants to merge 26 commits intoreleasefrom
Conversation
…ith-filter' into external-contri/fix/16584-table-edit-with-filter
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe pull request introduces significant enhancements to the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
- app/client/src/widgets/TableWidgetV2/widget/derived.js (1 hunks)
- app/client/src/widgets/TableWidgetV2/widget/derived.test.js (2 hunks)
🧰 Additional context used
🔇 Additional comments (2)
app/client/src/widgets/TableWidgetV2/widget/derived.js (1)
814-818: Great job incorporatingoriginalRowinto filter conditionsBy evaluating the filter conditions against both
originalRowanddisplayedRow, you ensure that filtering remains accurate even when rows have been edited. This approach effectively handles scenarios where the displayed data may differ from the original data, enhancing the functionality of the table when editing while filters are applied.app/client/src/widgets/TableWidgetV2/widget/derived.test.js (1)
199-204: Well done initializing the 'tableData' ininputWithDisplayTextYou have correctly structured the
tableData, which will be beneficial for your tests involving display text.
| ConditionFunctions[props.filters[i].condition]; | ||
|
|
||
| if (conditionFunction) { | ||
| const originalRow = props.tableData[row.__originalIndex__]; |
There was a problem hiding this comment.
Ensure originalRow is defined to prevent potential errors
It's important to verify that originalRow is valid before using it in the condition function. If row.__originalIndex__ does not correspond to a valid index in props.tableData, originalRow could be undefined, leading to runtime errors. Consider adding a check to ensure that originalRow is defined.
| const expected = [ | ||
| { id: 234, name: "Khadija Khafaga", __originalIndex__: 2 }, | ||
| { id: 123, name: "Hamza Anas", __originalIndex__: 1 }, | ||
| ]; | ||
|
|
||
| let result = getFilteredTableData(input, moment, _); | ||
|
|
||
| expect(result).toStrictEqual(expected); |
There was a problem hiding this comment.
Please revisit the expected results in your test case
After changing the name from "Hamza Khafaga" to "Hamza Anas", the row no longer meets the filter condition contains "Khafaga". Therefore, it should not appear in the filtered results. Let's update the expected results to reflect this change.
Apply this diff to correct the expected results:
const expected = [
{ id: 234, name: "Khadija Khafaga", __originalIndex__: 2 },
- { id: 123, name: "Hamza Anas", __originalIndex__: 1 },
];📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const expected = [ | |
| { id: 234, name: "Khadija Khafaga", __originalIndex__: 2 }, | |
| { id: 123, name: "Hamza Anas", __originalIndex__: 1 }, | |
| ]; | |
| let result = getFilteredTableData(input, moment, _); | |
| expect(result).toStrictEqual(expected); | |
| const expected = [ | |
| { id: 234, name: "Khadija Khafaga", __originalIndex__: 2 }, | |
| ]; | |
| let result = getFilteredTableData(input, moment, _); | |
| expect(result).toStrictEqual(expected); |
…/anasKhafaga/appsmith into external-contri/fix/16584-table-edit-with-filter
…o external-contri/fix/16584-table-edit-with-filter
|
/build-deploy-preview skip-tests=true |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/11359473512. |
|
Deploy-Preview-URL: https://ce-36878.dp.appsmith.com |
…/anasKhafaga/appsmith into external-contri/fix/16584-table-edit-with-filter
…/anasKhafaga/appsmith into external-contri/fix/16584-table-edit-with-filter
…o external-contri/fix/16584-table-edit-with-filter
|
/build-deploy-preview skip-tests=true |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/11434813360. |
|
Deploy-Preview-URL: https://ce-36878.dp.appsmith.com |
…/anasKhafaga/appsmith into external-contri/fix/16584-table-edit-with-filter
…o external-contri/fix/16584-table-edit-with-filter
…/anasKhafaga/appsmith into external-contri/fix/16584-table-edit-with-filter
…o external-contri/fix/16584-table-edit-with-filter
|
/build-deploy-preview skip-tests=true |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/11496843091. |
|
Deploy-Preview-URL: https://ce-36878.dp.appsmith.com |
…o external-contri/fix/16584-table-edit-with-filter
…/anasKhafaga/appsmith into external-contri/fix/16584-table-edit-with-filter
…o external-contri/fix/16584-table-edit-with-filter
…o external-contri/fix/16584-table-edit-with-filter
…o external-contri/fix/16584-table-edit-with-filter
|
Closing as original PR is merged. |
Description
Issue: #16584
Original PR: #36849
EE PR: https://github.com/appsmithorg/appsmith-ee/pull/5358
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
Caution
If you modify the content in this section, you are likely to disrupt the CI result for your PR.
Communication
Should the DevRel and Marketing teams inform users about this change?
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11588111041
Commit: f40199d
Cypress dashboard.
Tags:
@tag.AllSpec:
Wed, 30 Oct 2024 09:05:46 UTC