PromucFlow_constructor/app/client
Rahul Barwal 09d8a4deab
feat: adds custom sort function feature flag for table widget (#39649)
## Description
### Custom Sort Function for Table Widget

This PR introduces a new custom sort function feature for the Table
Widget, allowing users to define their own sorting logic for table data.

**Feature Flag Implementation**
- Added a new feature flag `release_table_custom_sort_function_enabled`
to control the availability of this feature
- Set the default value to `false` to allow for controlled rollout

**Table Widget Updates**
- Added `customSortFunction` property to the TableWidgetV2 props
interface
- Updated property configuration to include the custom sort function
control
- Added helper text and placeholder to guide users on proper
implementation
- Implemented visibility condition based on the feature flag and
sortable state

**Control Updates**
- Enhanced `TableCustomSortControl` to support the new custom sorting
logic
- Improved error handling in the sort function implementation
- Updated the binding structure to provide access to original data with
`original_` prefix
- Modified the function signature to use `(tableData, column, order)`
parameters

**Testing**
- Updated test cases to verify the extraction and computation of custom
sort expressions
- Implemented round-trip testing to ensure proper function parsing and
generation
- Added tests for edge cases like empty strings and non-matching formats

This feature enables users to implement complex sorting logic beyond the
default column-based sorting, such as multi-column sorting, custom
collation, or business-specific ordering rules.


Fixes #https://github.com/appsmithorg/appsmith-ee/issues/6503
_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.Sanity, @tag.Datasource"

### 🔍 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/13986693183>
> Commit: b64c2919c5d8eb1b82f6f8e6c76b98a60c2a6e22
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13986693183&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Table, @tag.Sanity, @tag.Datasource`
> Spec:
> <hr>Fri, 21 Mar 2025 08:35:48 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

- **New Features**
- Introduced custom table sorting, enabling users to define and apply
their own sorting logic in table displays.
- Added a new control interface for configuring custom sort functions,
offering enhanced flexibility in data presentation.
- Integrated an option to enable or disable the custom sort
functionality based on feature flags.
- Enhanced the table widget to support custom sorting function data,
allowing for dynamic data presentation.
- Added a new property configuration for custom sorting functions within
the table widget.

- **Tests**
- Implemented comprehensive tests to verify custom sorting input
processing and ensure accurate data computation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-03-21 15:45:29 +05:30
..
.husky
.yarn
config fix: sourcemaps (#39301) 2025-02-16 20:05:50 +03:00
cypress chore: Upgrade packages to resolve Dependabot issues (#39710) 2025-03-20 17:39:13 +05:30
docker/templates chore: add grafana faro sdk (CE) (#38301) 2024-12-26 10:37:41 +05:30
generators
packages chore: Upgrade packages to resolve Dependabot issues (#39710) 2025-03-20 17:39:13 +05:30
public chore: AppIDE Folder Structure (#39165) 2025-02-17 10:34:23 +03:00
scripts chore: Eject CRA (#39264) 2025-02-14 14:24:41 +05:30
src feat: adds custom sort function feature flag for table widget (#39649) 2025-03-21 15:45:29 +05:30
test fix: jest tests (#39839) 2025-03-21 02:05:05 +03:00
typings
.babelrc chore: Eject CRA (#39264) 2025-02-14 14:24:41 +05:30
.dockerignore
.editorconfig
.eslintrc.base.json
.eslintrc.js
.fork-ts-checkerrc
.gitignore
.lintstagedrc.json
.nvmrc
.prettierignore
.prettierrc
.sentryclirc
.yarnrc.yml
build.sh fix: sourcemaps (#39301) 2025-02-16 20:05:50 +03:00
cypress_ci_custom.config.ts
cypress_ci_hosted.config.ts
cypress_ci.config.ts
cypress-add-tags.js
cypress.config.ts
download-assets.js
jest.config.js chore: add grafana faro sdk (CE) (#38301) 2024-12-26 10:37:41 +05:30
knip.json chore: Eject CRA (#39264) 2025-02-14 14:24:41 +05:30
package.json chore: Upgrade packages to resolve Dependabot issues (#39710) 2025-03-20 17:39:13 +05:30
README.md
README.old.md
start-caddy.sh
start-https.sh chore: convert consolidated api etag to a weak one (#38939) 2025-01-31 16:35:20 +05:30
tailwind.config.js
tsconfig.json
tsconfig.path.json
vercel.json
yarn.lock chore: Upgrade packages to resolve Dependabot issues (#39710) 2025-03-20 17:39:13 +05:30

Appsmith Client

This project was bootstrapped with Create React App.

For details on setting up your development machine, please refer to the Setup Guide